diff --git a/app/src/main/java/moe/fuqiuluo/portal/service/MockServiceHelper.kt b/app/src/main/java/moe/fuqiuluo/portal/service/MockServiceHelper.kt index d9e8e7b..5c267a4 100644 --- a/app/src/main/java/moe/fuqiuluo/portal/service/MockServiceHelper.kt +++ b/app/src/main/java/moe/fuqiuluo/portal/service/MockServiceHelper.kt @@ -238,15 +238,15 @@ object MockServiceHelper { runCatching { val tmpSoFile = File(soDir, "libportal.so.tmp").also { file -> var nativeDir = context.applicationInfo.nativeLibraryDir - val soFile = File(nativeDir, "libportal.so") - if (soFile.exists()) { - ShellUtils.executeCommand("cp ${soFile.absolutePath} ${file.absolutePath}") + val apkSoFile = File(nativeDir, "libportal.so") + if (apkSoFile.exists()) { + ShellUtils.executeCommand("cp ${apkSoFile.absolutePath} ${file.absolutePath}") } else { - Log.e("MockServiceHelper", "Failed to copy portal library: ${soFile.absolutePath}") + Log.e("MockServiceHelper", "Failed to copy portal library: ${apkSoFile.absolutePath}") return@runCatching } } - if (soDir.exists()) { + if (soFile.exists()) { val originalHash = ShellUtils.executeCommandToBytes("head -c 4096 ${soFile.absolutePath}") val newHash = ShellUtils.executeCommandToBytes("head -c 4096 ${tmpSoFile.absolutePath}") if (originalHash.contentEquals(newHash)) { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f7052ec..79b4061 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Sep 23 06:55:49 HKT 2024 +#Sat Oct 19 02:12:31 HKT 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/xposed/src/main/java/moe/fuqiuluo/xposed/RemoteCommandHandler.kt b/xposed/src/main/java/moe/fuqiuluo/xposed/RemoteCommandHandler.kt index 7755d9c..2e0a009 100644 --- a/xposed/src/main/java/moe/fuqiuluo/xposed/RemoteCommandHandler.kt +++ b/xposed/src/main/java/moe/fuqiuluo/xposed/RemoteCommandHandler.kt @@ -199,6 +199,10 @@ object RemoteCommandHandler { "load_library" -> { val path = rely.getString("path") ?: return false + if (isLoadedLibrary && path.endsWith("libportal.so")) { + rely.putString("result", "success") + return true + } runCatching { System.load(path) }.onSuccess {