diff --git a/AndroidLibV2rayLite/CoreI/Status.go b/AndroidLibV2rayLite/CoreI/Status.go index a5d4b942..1534b26a 100644 --- a/AndroidLibV2rayLite/CoreI/Status.go +++ b/AndroidLibV2rayLite/CoreI/Status.go @@ -5,8 +5,9 @@ import ( ) type Status struct { - IsRunning bool - PackageName string + IsRunning bool + PackageName string + PackageCodePath string Vpoint v2core.Server } @@ -20,7 +21,7 @@ func (v *Status) GetDataDir() string { } func (v *Status) GetApp(name string) string { - return v.PackageName + name + return v.PackageCodePath + name } func (v *Status) GetTun2socksArgs(localDNS bool, enableIPv6 bool) (ret []string) { diff --git a/AndroidLibV2rayLite/interact.go b/AndroidLibV2rayLite/interact.go index 2a2e067b..bc98faae 100644 --- a/AndroidLibV2rayLite/interact.go +++ b/AndroidLibV2rayLite/interact.go @@ -44,6 +44,7 @@ type V2RayPoint struct { closeChan chan struct{} PackageName string + PackageCodePath string DomainName string ConfigureFileContent string EnableLocalDNS bool @@ -67,6 +68,7 @@ func (v *V2RayPoint) RunLoop() (err error) { defer v.v2rayOP.Unlock() //Construct Context v.status.PackageName = v.PackageName + v.status.PackageCodePath = v.PackageCodePath if !v.status.IsRunning { v.closeChan = make(chan struct{}) diff --git a/V2rayNG/app/build.gradle b/V2rayNG/app/build.gradle index b9589f12..9ac68172 100644 --- a/V2rayNG/app/build.gradle +++ b/V2rayNG/app/build.gradle @@ -3,8 +3,8 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 28 - buildToolsVersion '28.0.3' + compileSdkVersion Integer.parseInt("$compileSdkVer") + buildToolsVersion buildToolsVer compileOptions { targetCompatibility = "8" diff --git a/V2rayNG/app/libs/libv2ray.aar b/V2rayNG/app/libs/libv2ray.aar index 9b0f9359..253da328 100644 Binary files a/V2rayNG/app/libs/libv2ray.aar and b/V2rayNG/app/libs/libv2ray.aar differ diff --git a/V2rayNG/app/src/main/AndroidManifest.xml b/V2rayNG/app/src/main/AndroidManifest.xml index 4c0e837c..84f0d30b 100644 --- a/V2rayNG/app/src/main/AndroidManifest.xml +++ b/V2rayNG/app/src/main/AndroidManifest.xml @@ -27,7 +27,8 @@ android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + android:extractNativeLibs="true"> { - if (resultCode == RESULT_OK) { - val uri = data!!.data + val uri = data?.data + if (resultCode == RESULT_OK && uri != null) { readContentFromUri(uri) } } @@ -460,9 +460,10 @@ class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedList .subscribe { if (it) { try { - val inputStream = contentResolver.openInputStream(uri) - val configText = inputStream.bufferedReader().readText() - importCustomizeConfig(configText) + contentResolver.openInputStream(uri).use { + val configText = it?.bufferedReader()?.readText() + importCustomizeConfig(configText) + } } catch (e: Exception) { e.printStackTrace() } diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ScannerActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ScannerActivity.kt index 5e019309..eff431da 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ScannerActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ScannerActivity.kt @@ -119,10 +119,10 @@ class ScannerActivity : BaseActivity(), ZXingScannerView.ResultHandler { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) when (requestCode) { - REQUEST_FILE_CHOOSER -> - if (resultCode == RESULT_OK) { + REQUEST_FILE_CHOOSER -> { + val uri = data?.data + if (resultCode == RESULT_OK && uri != null) { try { - val uri = data!!.data val bitmap = BitmapFactory.decodeStream(contentResolver.openInputStream(uri)) val text = QRCodeDecoder.syncDecodeQRCode(bitmap) finished(text) @@ -131,6 +131,7 @@ class ScannerActivity : BaseActivity(), ZXingScannerView.ResultHandler { toast(e.message.toString()) } } + } } } } diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt index 1a403778..1320277d 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt @@ -95,7 +95,7 @@ object Utils { try { val cmb = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clipData = ClipData.newPlainText(null, content) - cmb.primaryClip = clipData + cmb.setPrimaryClip(clipData) } catch (e: Exception) { e.printStackTrace() } @@ -441,7 +441,6 @@ object Utils { return path } - /** * readTextFromAssets */ diff --git a/V2rayNG/app/src/main/resources/lib/arm64-v8a/tun2socks b/V2rayNG/app/src/main/resources/lib/arm64-v8a/tun2socks new file mode 100644 index 00000000..b46649ef Binary files /dev/null and b/V2rayNG/app/src/main/resources/lib/arm64-v8a/tun2socks differ diff --git a/V2rayNG/app/src/main/resources/lib/armeabi-v7a/tun2socks b/V2rayNG/app/src/main/resources/lib/armeabi-v7a/tun2socks new file mode 100644 index 00000000..b1aa74e3 Binary files /dev/null and b/V2rayNG/app/src/main/resources/lib/armeabi-v7a/tun2socks differ diff --git a/V2rayNG/app/src/main/resources/lib/x86/tun2socks b/V2rayNG/app/src/main/resources/lib/x86/tun2socks new file mode 100644 index 00000000..f5c05b58 Binary files /dev/null and b/V2rayNG/app/src/main/resources/lib/x86/tun2socks differ diff --git a/V2rayNG/app/src/main/resources/lib/x86_64/tun2socks b/V2rayNG/app/src/main/resources/lib/x86_64/tun2socks new file mode 100644 index 00000000..8f426499 Binary files /dev/null and b/V2rayNG/app/src/main/resources/lib/x86_64/tun2socks differ diff --git a/V2rayNG/dpreference/build.gradle b/V2rayNG/dpreference/build.gradle index 8acdf31c..09d2240c 100644 --- a/V2rayNG/dpreference/build.gradle +++ b/V2rayNG/dpreference/build.gradle @@ -1,8 +1,8 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 28 - buildToolsVersion '28.0.3' + compileSdkVersion Integer.parseInt("$compileSdkVer") + buildToolsVersion buildToolsVer defaultConfig { minSdkVersion 17 diff --git a/V2rayNG/gradle.properties b/V2rayNG/gradle.properties index d83eebd3..44823400 100644 --- a/V2rayNG/gradle.properties +++ b/V2rayNG/gradle.properties @@ -16,7 +16,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro ankoVersion=0.10.8 kotlinVersion=1.3.40 supportLibVersion=28.0.0 -buildToolsVer=28.0.3 -compileSdkVer=28 +buildToolsVer=29.0.3 +compileSdkVer=29 kotlin.incremental=true -targetSdkVer=28 +targetSdkVer=29