Skip to content

Commit

Permalink
Project cleanup dependency update (#12)
Browse files Browse the repository at this point in the history
* Project update.

* Add new Cloak options to preferences.

* Fix IntelliJ Idea.

* Remove dev specific IntelliJ Idea files.

* Ignore app/release

* Update to latest dependencies, remove unneeded steps from README. Fix compile issues. Add new prefs.
  • Loading branch information
notsure2 authored May 27, 2020
1 parent b0c1cb5 commit b0b6df9
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 136 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ build
captures
.externalNativeBuild
app/src/.deps
app/src/main/jniLibs
app/src/main/jniLibs
/app/release
Binary file removed .idea/caches/build_file_checksums.ser
Binary file not shown.
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

20 changes: 0 additions & 20 deletions .idea/gradle.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/misc.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 7 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -56,4 +57,4 @@ class ConfigFragment : PreferenceFragment() {
}
addPreferencesFromResource(R.xml.config)
}
}
}
4 changes: 4 additions & 0 deletions app/src/main/res/values/array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
<item>aes-gcm</item>
<item>chacha20-poly1305</item>
</string-array>
<string-array name="transportTypes">
<item>direct</item>
<item>CDN</item>
</string-array>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<string name="cloak_num_conn">Number of Connections</string>
<string name="cloak_browser_sig">Browser Signature</string>
<string name="cloak_encryption_method">Encryption Method</string>
<string name="cloak_transport">Transport</string>
<string name="cloak_proxy_method">Proxy Method</string>
<string name="cloak_stream_timeout">Stream Timeout</string>
<string name="cloak_keepalive">Keep Alive</string>
</resources>
27 changes: 10 additions & 17 deletions app/src/main/res/xml/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
android:summary="%s"
android:entries="@array/algorithms"
android:entryValues="@array/algorithms" />
<EditTextPreference
android:key="UID"
android:persistent="false"
android:title="@string/cloak_uid" />
<ListPreference android:title="@string/cloak_transport" android:entries="@array/transportTypes"
android:entryValues="@array/transportTypes" android:key="Transport" />
<EditTextPreference android:key="UID" android:persistent="false" android:title="@string/cloak_uid" />
<EditTextPreference
android:key="PublicKey"
android:persistent="false"
Expand All @@ -26,24 +25,18 @@
android:key="ServerName"
android:persistent="false"
android:title="@string/cloak_server_name" />
<EditTextPreference
android:key="NumConn"
android:persistent="false"
android:inputType="numberDecimal"
android:digits="0123456789"
android:title="@string/cloak_num_conn" />
<ListPreference
android:key="BrowserSig"
android:persistent="false"
android:title="@string/cloak_browser_sig"
android:summary="%s"
android:entries="@array/browsers"
android:entryValues="@array/browsers" />
<EditTextPreference
android:key="StreamTimeout"
android:persistent="false"
android:inputType="numberDecimal"
android:digits="0123456789"
android:title="@string/cloak_stream_timeout"/>
<EditTextPreference android:key="NumConn" android:persistent="false" android:inputType="numberDecimal"
android:digits="0123456789" android:title="@string/cloak_num_conn" />
<EditTextPreference android:key="StreamTimeout" android:persistent="false" android:inputType="numberDecimal"
android:digits="0123456789" android:title="@string/cloak_stream_timeout" android:singleLine="true" />
<EditTextPreference android:key="KeepAlive" android:persistent="false" android:inputType="numberDecimal"
android:digits="0123456789" android:title="@string/cloak_keepalive" android:singleLine="true" />
</PreferenceCategory>
</PreferenceScreen>
</PreferenceScreen>
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b0b6df9

Please sign in to comment.