Skip to content

Commit

Permalink
Fix build on linux
Browse files Browse the repository at this point in the history
Note that the class android.os.Build.VERSION may not exist
  • Loading branch information
JingMatrix committed May 15, 2024
1 parent 6abb832 commit dc5d47e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@ class DeviceSpoofer: IXposedHookLoadPackage {
androidVersionToSpoof?.getAsMap()?.run {

val classLoader = lpparam?.classLoader ?: return
val classBuild = XposedHelpers.findClass("android.os.Build.VERSION", classLoader)
runCatching {
val classBuild = XposedHelpers.findClass("android.os.Build.VERSION", classLoader)

keys.forEach {
XposedHelpers.setStaticObjectField(classBuild, it, this[it])
if (verboseLog) log("VERSION SPOOF: $it - ${this[it]}")
keys.forEach {
XposedHelpers.setStaticObjectField(classBuild, it, this[it])
if (verboseLog) log("VERSION SPOOF: $it - ${this[it]}")
}
}
}

}

}
}
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit dc5d47e

Please sign in to comment.