diff --git a/.gitignore b/.gitignore index 527c983..b4df54f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ build captures .externalNativeBuild app/src/.deps -app/src/main/jniLibs \ No newline at end of file +app/src/main/jniLibs +/app/release diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser deleted file mode 100644 index de840b0..0000000 Binary files a/.idea/caches/build_file_checksums.ser and /dev/null differ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 30aa626..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index df593d5..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 37a7509..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 3af49f0..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index e9f3131..45a7de8 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,5 @@ Shadowsocks plugin Cloak for Android ## Build Instructions -1. Edit ndk-bundle\build\tools\make_standalone_toolchain.py, change the line `flags = '-target {} -stdlib=libc++'.format(target)` to `flags = '-target {}'.format(target)` (see https://github.com/golang/go/issues/29706) -2. Execute `make.sh` -3. Build with Android Studio +1. Execute `make.sh` +2. Build with Android Studio diff --git a/app/build.gradle b/app/build.gradle index af6bede..22fd0d0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,10 +12,10 @@ android { //buildToolsVersion '26.0.2' defaultConfig { applicationId "com.github.shadowsocks.plugin.ck_client" - minSdkVersion 19 + minSdkVersion 21 targetSdkVersion 29 versionCode 6 - versionName '2.1.3' + versionName '2.1.4' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -31,11 +31,10 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' - implementation 'androidx.appcompat:appcompat:1.0.0' - implementation 'com.github.shadowsocks:plugin:0.1.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' + implementation 'com.github.shadowsocks:plugin:1.3.4' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test:runner:1.2.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' } diff --git a/app/src/main/java/com/github/shadowsocks/plugin/ck_client/BinaryProvider.kt b/app/src/main/java/com/github/shadowsocks/plugin/ck_client/BinaryProvider.kt index 487eb8f..53fe3da 100644 --- a/app/src/main/java/com/github/shadowsocks/plugin/ck_client/BinaryProvider.kt +++ b/app/src/main/java/com/github/shadowsocks/plugin/ck_client/BinaryProvider.kt @@ -10,25 +10,20 @@ import java.io.FileNotFoundException class BinaryProvider : NativePluginProvider() { override fun populateFiles(provider: PathProvider) { - provider.addPath("ck-client", "755") + provider.addPath("ck-client", 0b111101101) } override fun getExecutable(): String { - val exec = context.applicationInfo.nativeLibraryDir + "/libck-client.so" + val exec = context!!.applicationInfo.nativeLibraryDir + "/libck-client.so" Log.d("execPath", exec) Log.d("execExists", File(exec).exists().toString()) return exec } - override fun openFile(uri: Uri?): ParcelFileDescriptor { - if (uri == null) { - Log.d("URI", "null") - throw FileNotFoundException() - } + override fun openFile(uri: Uri): ParcelFileDescriptor { when (uri.path) { "/ck-client" -> return ParcelFileDescriptor.open(File(getExecutable()), ParcelFileDescriptor.MODE_READ_ONLY) else -> throw FileNotFoundException() } - } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/github/shadowsocks/plugin/ck_client/ConfigFragment.kt b/app/src/main/java/com/github/shadowsocks/plugin/ck_client/ConfigFragment.kt index e37c81c..67c18d6 100644 --- a/app/src/main/java/com/github/shadowsocks/plugin/ck_client/ConfigFragment.kt +++ b/app/src/main/java/com/github/shadowsocks/plugin/ck_client/ConfigFragment.kt @@ -16,8 +16,9 @@ class ConfigFragment : PreferenceFragment() { fun onInitializePluginOptions(options: PluginOptions) { this._options = options val ary = arrayOf(Pair("ProxyMethod","shadowsocks"), Pair("EncryptionMethod","plain"), - Pair("UID", ""), Pair("PublicKey",""), Pair("ServerName", "bing.com"), - Pair("NumConn","4"), Pair("BrowserSig", "chrome"), Pair("StreamTimeout","300")) + Pair("Transport", "direct"), Pair("UID", ""), Pair("PublicKey",""), Pair("ServerName", "bing.com"), + Pair("NumConn","4"), Pair("BrowserSig", "chrome"), Pair("StreamTimeout","300"), + Pair("KeepAlive", "0")) for (element in ary) { val key = element.first val defaultValue = element.second @@ -56,4 +57,4 @@ class ConfigFragment : PreferenceFragment() { } addPreferencesFromResource(R.xml.config) } -} \ No newline at end of file +} diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml index da18799..a9e17e6 100644 --- a/app/src/main/res/values/array.xml +++ b/app/src/main/res/values/array.xml @@ -9,4 +9,8 @@ aes-gcm chacha20-poly1305 + + direct + CDN + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 33f8c76..3f7a7c6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -6,6 +6,8 @@ Number of Connections Browser Signature Encryption Method + Transport Proxy Method Stream Timeout + Keep Alive diff --git a/app/src/main/res/xml/config.xml b/app/src/main/res/xml/config.xml index 4b5905f..2681cb0 100644 --- a/app/src/main/res/xml/config.xml +++ b/app/src/main/res/xml/config.xml @@ -12,10 +12,9 @@ android:summary="%s" android:entries="@array/algorithms" android:entryValues="@array/algorithms" /> - + + - - + + + - \ No newline at end of file + diff --git a/build.gradle b/build.gradle index d8511a9..5de3e80 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.11' + ext.kotlin_version = '1.3.72' repositories { google() jcenter() maven { url "https://jitpack.io" } } dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.android.tools.build:gradle:3.6.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 59edc3c..1b1bc4a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Mar 07 13:01:33 GMT 2020 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip +#Tue May 26 15:42:25 GMT+02:00 2020 +distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME