mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2026-05-09 18:11:26 +08:00
Update app (#428)
This commit is contained in:
1
core/.gitignore
vendored
Normal file
1
core/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/src/main/cpp/version.h
|
||||
@@ -1,8 +1,6 @@
|
||||
import android.databinding.tool.ext.capitalizeUS
|
||||
import com.github.kr328.golang.GolangBuildTask
|
||||
import com.github.kr328.golang.GolangPlugin
|
||||
import java.io.FileOutputStream
|
||||
import java.net.URL
|
||||
import java.time.Duration
|
||||
|
||||
plugins {
|
||||
kotlin("android")
|
||||
@@ -62,4 +60,15 @@ afterEvaluate {
|
||||
tasks.withType(GolangBuildTask::class.java).forEach {
|
||||
it.inputs.dir(golangSource)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val abis = listOf("armeabi-v7a" to "ArmeabiV7a", "arm64-v8a" to "Arm64V8a", "x86_64" to "X8664", "x86" to "X86")
|
||||
|
||||
androidComponents.onVariants { variant ->
|
||||
afterEvaluate {
|
||||
for ((abi, goAbi) in abis) {
|
||||
val cmakeName = if (variant.buildType == "debug") "Debug" else "RelWithDebInfo"
|
||||
tasks.getByName("buildCMake$cmakeName[$abi]").dependsOn(tasks.getByName("externalGolangBuild${variant.name.capitalizeUS()}$goAbi"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.github.kr328.clash.core">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
</manifest>
|
||||
|
||||
@@ -61,7 +61,7 @@ object Bridge {
|
||||
.detachFd()
|
||||
|
||||
val home = ctx.filesDir.resolve("clash").apply { mkdirs() }.absolutePath
|
||||
val versionName = ctx.packageManager.getPackageInfo(ctx.packageName, 0).versionName
|
||||
val versionName = ctx.packageManager.getPackageInfo(ctx.packageName, 0).versionName ?: "unknown"
|
||||
val sdkVersion = Build.VERSION.SDK_INT
|
||||
|
||||
Log.d("Home = $home")
|
||||
|
||||
Reference in New Issue
Block a user