Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
fuqiuluo committed Oct 18, 2024
1 parent 86817a0 commit 9b942d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9b942d2

Please sign in to comment.