Merge pull request #387 from yuhan6665/target-29

Target sdk 29
This commit is contained in:
2dust
2020-08-29 20:32:59 +08:00
committed by GitHub
15 changed files with 27 additions and 21 deletions
+4 -3
View File
@@ -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) {
+2
View File
@@ -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{})
+2 -2
View File
@@ -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"
Binary file not shown.
+2 -1
View File
@@ -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">
<activity
android:name=".ui.MainActivity"
android:theme="@style/AppTheme.NoActionBar"
@@ -103,6 +103,7 @@ class V2RayVpnService : VpnService() {
val policy = StrictMode.ThreadPolicy.Builder().permitAll().build()
StrictMode.setThreadPolicy(policy)
v2rayPoint.packageName = Utils.packagePath(applicationContext)
v2rayPoint.packageCodePath = applicationContext.applicationInfo.nativeLibraryDir + "/"
Seq.setContext(applicationContext)
}
@@ -165,8 +165,8 @@ class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedList
importBatchConfig(data?.getStringExtra("SCAN_RESULT"))
}
REQUEST_FILE_CHOOSER -> {
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()
}
@@ -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())
}
}
}
}
}
}
@@ -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
*/
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -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
+3 -3
View File
@@ -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