From dc5d47ebeff2239e3906c10e108bc4dd016fbd41 Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Wed, 15 May 2024 22:33:18 +0200 Subject: [PATCH] Fix build on linux Note that the class android.os.Build.VERSION may not exist --- .../xposed/pixelifygooglephotos/DeviceSpoofer.kt | 12 +++++++----- gradlew | 0 2 files changed, 7 insertions(+), 5 deletions(-) mode change 100644 => 100755 gradlew diff --git a/app/src/main/java/balti/xposed/pixelifygooglephotos/DeviceSpoofer.kt b/app/src/main/java/balti/xposed/pixelifygooglephotos/DeviceSpoofer.kt index 419b621..43fb853 100644 --- a/app/src/main/java/balti/xposed/pixelifygooglephotos/DeviceSpoofer.kt +++ b/app/src/main/java/balti/xposed/pixelifygooglephotos/DeviceSpoofer.kt @@ -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]}") + } } } } -} \ No newline at end of file +} diff --git a/gradlew b/gradlew old mode 100644 new mode 100755