try fix app bundle not extract native libs

This commit is contained in:
Kr328 committed 2019-12-11 09:29:59 +08:00
1 parent 5ddeaf2783
commit c4f4c157bd
5 files changed
+23 -2

No files matched your search

+5 -2
View File
@@ -13,8 +13,8 @@ android {
applicationId "com.github.kr328.clash"
minSdkVersion 24
targetSdkVersion 29
versionCode 10016
versionName "1.0.16-alpha"
versionCode 10017
versionName "1.0.17-alpha"
}
buildTypes {
release {
@@ -29,6 +29,9 @@ android {
kotlinOptions {
jvmTarget = "1.8"
}
bundle {
}
}
dependencies {
+1
View File
@@ -7,6 +7,7 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:extractNativeLibs="true"
android:name=".MainApplication"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
+4
View File
@@ -19,3 +19,7 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kapt.incremental.apt=false
android.bundle.enableUncompressedNativeLibraries=false
@@ -15,6 +15,7 @@ import com.github.kr328.clash.core.utils.Log
import java.io.File
import java.io.IOException
import java.util.concurrent.Executors
import javax.xml.transform.SourceLocator
import kotlin.concurrent.thread
class ClashService : Service(), IClashEventObserver, ClashEventService.Master,
@@ -184,6 +185,8 @@ class ClashService : Service(), IClashEventObserver, ClashEventService.Master,
override fun onCreate() {
super.onCreate()
StubSoLoader.loadSo()
clash = Clash(
this,
filesDir.resolve("clash"),
@@ -0,0 +1,10 @@
package com.github.kr328.clash.service
import androidx.annotation.Keep
@Keep
object StubSoLoader {
fun loadSo() {
System.loadLibrary("clash")
}
}