Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acd89cc999 | ||
|
|
382af46d91 | ||
|
|
415a9f6847 | ||
|
|
91a069bc44 |
+1
-12
@@ -20,18 +20,7 @@ before_install:
|
|||||||
- export PATH=${PATH}:${ANDROID_NDK_HOME}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
|
- export PATH=${PATH}:${ANDROID_NDK_HOME}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
|
||||||
- echo "y" | android update sdk --filter tools,platform-tools,build-tools-20.0.0,android-19,extra-google-m2repository --no-ui --no-https -a
|
- echo "y" | android update sdk --filter tools,platform-tools,build-tools-20.0.0,android-19,extra-google-m2repository --no-ui --no-https -a
|
||||||
- echo "y" | android update sdk --filter extra-android-m2repository --no-ui --no-https -a
|
- echo "y" | android update sdk --filter extra-android-m2repository --no-ui --no-https -a
|
||||||
install:
|
|
||||||
- gem install --version 0.8.9 faraday
|
|
||||||
- gem install travis-artifacts
|
|
||||||
script:
|
script:
|
||||||
- ./build-ndk.sh
|
- ./build-ndk.sh
|
||||||
- cp local.properties.travis local.properties
|
- cp local.properties.travis local.properties
|
||||||
- sbt clean android:package-release
|
- sbt android:package-release
|
||||||
after_success:
|
|
||||||
- ./deploy target/android-bin shadowsocks-release.apk
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- "ARTIFACTS_AWS_REGION=us-east-1"
|
|
||||||
- "ARTIFACTS_S3_BUCKET=travis-nightly"
|
|
||||||
- secure: "GkAdnMh07id2VKhpCW16lE73A0LK2Jsk3hzkFvdx76JKW8FjLgaimLJ2T/+i\nxFfDw8XBinLE09dqg8JxSNS6JbLHLcav8P3yJIlzFh1NqfJABU9U4I8atb6P\nITSdSo9nb3LX6sB8SOU0nqXb5U+nj7jiekQqiBhmEmu6iDmMtfU="
|
|
||||||
- secure: "eCh5BjCFccp+sB/FIrjsmxJU4475D4qiWvDV++khcIHLel6lgUjDX18ImBlJ\n+IdiCKxvR6EpRDV1Cs4gJ2jZEAV0PbojQMoQOXbs1FLggM8RRq/Re1qWQFq7\nWkBRjjr8w8ddjJZHRo459cTUvgvD7krhp07coabAnEahDaGWSUo="
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.github.shadowsocks"
|
package="com.github.shadowsocks"
|
||||||
android:versionCode="68"
|
android:versionCode="69"
|
||||||
android:versionName="2.2.0">
|
android:versionName="2.2.1">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
|
|||||||
@@ -44,7 +44,6 @@
|
|||||||
<string name="forward_stop">后台服务已停止。</string>
|
<string name="forward_stop">后台服务已停止。</string>
|
||||||
<string name="service_failed">请检查你的网络状态后并重试。</string>
|
<string name="service_failed">请检查你的网络状态后并重试。</string>
|
||||||
<string name="stop">停止服务</string>
|
<string name="stop">停止服务</string>
|
||||||
<string name="vpn_status">推荐通过通知栏关闭 VPN 服务</string>
|
|
||||||
<string name="vpn_error">无法启动 VPN 服务:\"%s\"。看来和你的设备存在兼容性问题,请使用 Root 模式。</string>
|
<string name="vpn_error">无法启动 VPN 服务:\"%s\"。看来和你的设备存在兼容性问题,请使用 Root 模式。</string>
|
||||||
<string name="ok_iknow">确定</string>
|
<string name="ok_iknow">确定</string>
|
||||||
<string name="port_alert">端口号应大于1024</string>
|
<string name="port_alert">端口号应大于1024</string>
|
||||||
|
|||||||
@@ -57,7 +57,6 @@
|
|||||||
<string name="forward_stop">Shadowsocks stopped.</string>
|
<string name="forward_stop">Shadowsocks stopped.</string>
|
||||||
<string name="service_failed">Please check your network status and try again.</string>
|
<string name="service_failed">Please check your network status and try again.</string>
|
||||||
<string name="stop">Stop the service</string>
|
<string name="stop">Stop the service</string>
|
||||||
<string name="vpn_status">Recommend to disable the VPN service through the notification bar.</string>
|
|
||||||
<string name="vpn_error">Unable to start VPN service: "%s". It seems to be a compatibility issue with your device. Please consider using ROOT mode instead.</string>
|
<string name="vpn_error">Unable to start VPN service: "%s". It seems to be a compatibility issue with your device. Please consider using ROOT mode instead.</string>
|
||||||
|
|
||||||
<!-- alert category -->
|
<!-- alert category -->
|
||||||
|
|||||||
@@ -919,7 +919,6 @@ class Shadowsocks
|
|||||||
if (isVpnEnabled) {
|
if (isVpnEnabled) {
|
||||||
val style = new Style.Builder().setBackgroundColorValue(Style.holoBlueLight).build()
|
val style = new Style.Builder().setBackgroundColorValue(Style.holoBlueLight).build()
|
||||||
val config = new Configuration.Builder().setDuration(Configuration.DURATION_LONG).build()
|
val config = new Configuration.Builder().setDuration(Configuration.DURATION_LONG).build()
|
||||||
Crouton.makeText(Shadowsocks.this, R.string.vpn_status, style).setConfiguration(config).show()
|
|
||||||
changeSwitch(checked = false)
|
changeSwitch(checked = false)
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
|
|||||||
@@ -220,12 +220,12 @@ class ShadowsocksNatService extends Service with BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def notifyForegroundAlert(title: String, info: String, rate: Int) {
|
def notifyForegroundAlert(title: String, info: String, rate: Int) {
|
||||||
val openIntent: Intent = new Intent(this, classOf[Shadowsocks])
|
val openIntent = new Intent(this, classOf[Shadowsocks])
|
||||||
openIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
openIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
|
||||||
val contentIntent: PendingIntent = PendingIntent.getActivity(this, 0, openIntent, 0)
|
val contentIntent = PendingIntent.getActivity(this, 0, openIntent, 0)
|
||||||
val closeIntent: Intent = new Intent(Action.CLOSE)
|
val closeIntent = new Intent(Action.CLOSE)
|
||||||
val actionIntent: PendingIntent = PendingIntent.getBroadcast(this, 0, closeIntent, 0)
|
val actionIntent = PendingIntent.getBroadcast(this, 0, closeIntent, 0)
|
||||||
val builder: NotificationCompat.Builder = new NotificationCompat.Builder(this)
|
val builder = new NotificationCompat.Builder(this)
|
||||||
|
|
||||||
val icon = getResources.getDrawable(R.drawable.ic_stat_shadowsocks)
|
val icon = getResources.getDrawable(R.drawable.ic_stat_shadowsocks)
|
||||||
if (rate >= 0) {
|
if (rate >= 0) {
|
||||||
@@ -309,14 +309,6 @@ class ShadowsocksNatService extends Service with BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override def onStartCommand(intent: Intent, flags: Int, startId: Int): Int = {
|
|
||||||
Service.START_STICKY
|
|
||||||
}
|
|
||||||
|
|
||||||
override def onTaskRemoved(intent: Intent) {
|
|
||||||
stopRunner()
|
|
||||||
}
|
|
||||||
|
|
||||||
def killProcesses() {
|
def killProcesses() {
|
||||||
Console.runRootCommand(Utils.getIptables + " -t nat -F OUTPUT")
|
Console.runRootCommand(Utils.getIptables + " -t nat -F OUTPUT")
|
||||||
|
|
||||||
@@ -564,13 +556,6 @@ class ShadowsocksNatService extends Service with BaseService {
|
|||||||
timer = null
|
timer = null
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean up context
|
|
||||||
stopForegroundCompat(1)
|
|
||||||
if (receiver != null) {
|
|
||||||
unregisterReceiver(receiver)
|
|
||||||
receiver = null
|
|
||||||
}
|
|
||||||
|
|
||||||
// reset NAT
|
// reset NAT
|
||||||
killProcesses()
|
killProcesses()
|
||||||
|
|
||||||
@@ -578,6 +563,13 @@ class ShadowsocksNatService extends Service with BaseService {
|
|||||||
if (callbackCount == 0) {
|
if (callbackCount == 0) {
|
||||||
stopSelf()
|
stopSelf()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clean up context
|
||||||
|
if (receiver != null) {
|
||||||
|
unregisterReceiver(receiver)
|
||||||
|
receiver = null
|
||||||
|
}
|
||||||
|
stopForegroundCompat(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
override def stopBackgroundService() {
|
override def stopBackgroundService() {
|
||||||
|
|||||||
@@ -118,13 +118,8 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
|||||||
|
|
||||||
def startVpn() {
|
def startVpn() {
|
||||||
|
|
||||||
val openIntent: Intent = new Intent(this, classOf[Shadowsocks])
|
|
||||||
openIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
|
||||||
val configIntent = PendingIntent.getActivity(this, 0, openIntent, 0)
|
|
||||||
|
|
||||||
val builder = new Builder()
|
val builder = new Builder()
|
||||||
builder
|
builder
|
||||||
.setConfigureIntent(configIntent)
|
|
||||||
.setSession(config.profileName)
|
.setSession(config.profileName)
|
||||||
.setMtu(VPN_MTU)
|
.setMtu(VPN_MTU)
|
||||||
.addAddress(PRIVATE_VLAN.format("1"), 24)
|
.addAddress(PRIVATE_VLAN.format("1"), 24)
|
||||||
@@ -221,17 +216,13 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def notifyAlert(title: String, info: String) {
|
def notifyAlert(title: String, info: String) {
|
||||||
val openIntent: Intent = new Intent(this, classOf[Shadowsocks])
|
val builder = new NotificationCompat.Builder(this)
|
||||||
openIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
|
||||||
val contentIntent: PendingIntent = PendingIntent.getActivity(this, 0, openIntent, 0)
|
|
||||||
val builder: NotificationCompat.Builder = new NotificationCompat.Builder(this)
|
|
||||||
builder
|
builder
|
||||||
.setSmallIcon(R.drawable.ic_stat_shadowsocks)
|
.setSmallIcon(R.drawable.ic_stat_shadowsocks)
|
||||||
.setWhen(0)
|
.setWhen(0)
|
||||||
.setTicker(title)
|
.setTicker(title)
|
||||||
.setContentTitle(getString(R.string.app_name))
|
.setContentTitle(getString(R.string.app_name))
|
||||||
.setContentText(info)
|
.setContentText(info)
|
||||||
.setContentIntent(contentIntent)
|
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
notificationManager.notify(1, builder.build)
|
notificationManager.notify(1, builder.build)
|
||||||
}
|
}
|
||||||
@@ -255,14 +246,6 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
|||||||
.asInstanceOf[NotificationManager]
|
.asInstanceOf[NotificationManager]
|
||||||
}
|
}
|
||||||
|
|
||||||
override def onStartCommand(intent: Intent, flags: Int, startId: Int): Int = {
|
|
||||||
Service.START_STICKY
|
|
||||||
}
|
|
||||||
|
|
||||||
override def onTaskRemoved(intent: Intent) {
|
|
||||||
stopRunner()
|
|
||||||
}
|
|
||||||
|
|
||||||
override def onRevoke() {
|
override def onRevoke() {
|
||||||
stopRunner()
|
stopRunner()
|
||||||
}
|
}
|
||||||
@@ -363,12 +346,6 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
|||||||
.set(Fields.SESSION_CONTROL, "stop")
|
.set(Fields.SESSION_CONTROL, "stop")
|
||||||
.build())
|
.build())
|
||||||
|
|
||||||
// clean up the context
|
|
||||||
if (receiver != null) {
|
|
||||||
unregisterReceiver(receiver)
|
|
||||||
receiver = null
|
|
||||||
}
|
|
||||||
|
|
||||||
// reset VPN
|
// reset VPN
|
||||||
killProcesses()
|
killProcesses()
|
||||||
|
|
||||||
@@ -378,13 +355,28 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
|||||||
conn = null
|
conn = null
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset notifications
|
|
||||||
notificationManager.cancel(1)
|
|
||||||
|
|
||||||
// stop the service if no callback registered
|
// stop the service if no callback registered
|
||||||
if (callbackCount == 0) {
|
if (callbackCount == 0) {
|
||||||
stopSelf()
|
stopSelf()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clean up the context
|
||||||
|
if (receiver != null) {
|
||||||
|
unregisterReceiver(receiver)
|
||||||
|
receiver = null
|
||||||
|
}
|
||||||
|
|
||||||
|
// reset notifications
|
||||||
|
notificationManager.cancel(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
override def onStartCommand(intent: Intent, flags: Int, startId: Int): Int =
|
||||||
|
{
|
||||||
|
Service.START_STICKY
|
||||||
|
}
|
||||||
|
|
||||||
|
override def onTaskRemoved(intent: Intent) {
|
||||||
|
stopRunner()
|
||||||
}
|
}
|
||||||
|
|
||||||
override def stopBackgroundService() {
|
override def stopBackgroundService() {
|
||||||
|
|||||||
Reference in New Issue
Block a user