Skip to content

Commit 9a27afe

Browse files
committed
Fix errors
1 parent 44a0ccc commit 9a27afe

22 files changed

+85
-2210
lines changed

build.gradle.kts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3+
alias(libs.plugins.android.application) apply false
34
alias(libs.plugins.android.library) apply false
45
}
56

@@ -11,8 +12,8 @@ tasks.register("copyZygiskFiles") {
1112
val zygiskBuildDir = zygiskModule.layout.buildDirectory.get().asFile
1213

1314
val classesJar = zygiskBuildDir
14-
.resolve("intermediates/aar_main_jar/release/syncReleaseLibJars/classes.jar")
15-
classesJar.copyTo(moduleFolder.resolve("classes.jar"), overwrite = true)
15+
.resolve("intermediates/dex/release/minifyReleaseWithR8/classes.dex")
16+
classesJar.copyTo(moduleFolder.resolve("classes.dex"), overwrite = true)
1617

1718
val zygiskSoDir = zygiskBuildDir
1819
.resolve("intermediates/stripped_native_libs/release/stripReleaseDebugSymbols/out/lib")

changelog.md

-9
This file was deleted.

gradle/libs.versions.toml

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ hiddenapibypass = { group = "org.lsposed.hiddenapibypass", name = "hiddenapibypa
99

1010
[plugins]
1111
android-library = { id = "com.android.library", version.ref = "agp" }
12+
android-application = { id = "com.android.application", version.ref = "agp" }

inject/src/main/cpp/inject.cpp

+20-15
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static nlohmann::json json;
1515
static bool spoofProps = true, spoofProvider = true, spoofSignature = false;
1616

1717
static bool DEBUG = false;
18-
static std::string DEVICE_INITIAL_SDK_INT, SECURITY_PATCH, BUILD_ID;
18+
static std::string DEVICE_INITIAL_SDK_INT = "21", SECURITY_PATCH, BUILD_ID;
1919

2020
typedef void (*T_Callback)(void *, const char *, const char *, uint32_t);
2121

@@ -215,11 +215,10 @@ static void injectDex() {
215215
auto dexClClass = env->FindClass("dalvik/system/PathClassLoader");
216216
auto dexClInit = env->GetMethodID(
217217
dexClClass, "<init>",
218-
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/ClassLoader;)V");
219-
auto str1 = env->NewStringUTF((dir + "/classes.dex").c_str());
220-
auto str2 = env->NewStringUTF(dir.c_str());
218+
"(Ljava/lang/String;Ljava/lang/ClassLoader;)V");
219+
auto classesJar = env->NewStringUTF((dir + "/classes.dex").c_str());
221220
auto dexCl =
222-
env->NewObject(dexClClass, dexClInit, str1, str2, systemClassLoader);
221+
env->NewObject(dexClClass, dexClInit, classesJar, systemClassLoader);
223222

224223
if (env->ExceptionCheck()) {
225224
env->ExceptionDescribe();
@@ -257,17 +256,15 @@ static void injectDex() {
257256
env->DeleteLocalRef(entryClassObj);
258257
env->DeleteLocalRef(jsonStr);
259258
env->DeleteLocalRef(dexCl);
260-
env->DeleteLocalRef(str1);
261-
env->DeleteLocalRef(str2);
259+
env->DeleteLocalRef(classesJar);
262260
env->DeleteLocalRef(dexClClass);
263261
env->DeleteLocalRef(clClass);
264262

265263
LOGD("jni memory free");
266264
}
267265

268266
extern "C" [[gnu::visibility("default"), maybe_unused]] bool
269-
init(JavaVM *vm, const std::string &gmsDir) {
270-
bool close = true;
267+
init(JavaVM *vm, const std::string &gmsDir, bool trickyStore, bool testSignedRom) {
271268

272269
if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK) {
273270
LOGE("[INJECT] JNI_ERR!");
@@ -283,20 +280,28 @@ init(JavaVM *vm, const std::string &gmsDir) {
283280

284281
parseJSON();
285282

283+
if (trickyStore) {
284+
spoofProvider = false;
285+
spoofSignature = false;
286+
spoofProps = false;
287+
}
288+
289+
if (testSignedRom) {
290+
spoofProvider = true;
291+
spoofSignature = true;
292+
}
293+
286294
UpdateBuildFields();
287295

288296
if (spoofProvider || spoofSignature) {
289297
injectDex();
290298
} else {
291-
LOGD("[INJECT] Dex file won't be injected due spoofProvider and "
292-
"spoofSignature are false");
299+
LOGD("[INJECT] Dex file won't be injected due spoofProvider and spoofSignature are false");
293300
}
294301

295302
if (spoofProps) {
296-
close = !doHook();
303+
return !doHook();
297304
}
298305

299-
LOGD("[INJECT] Done!");
300-
301-
return close;
306+
return true;
302307
}

module/classes.jar

-8.33 KB
Binary file not shown.

module/module.prop

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
id=playintegrityfix
2-
name=Play Integrity Fix
3-
version=v18.9
4-
versionCode=18900
2+
name=Play Integrity Fix [INJECT]
3+
version=v3-inject
4+
versionCode=3
55
author=chiteroman
66
description=Universal modular fix for Play Integrity (and SafetyNet) on devices running Android 8-15
7-
updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json

update.json

-6
This file was deleted.

zygisk/build.gradle.kts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
alias(libs.plugins.android.library)
2+
alias(libs.plugins.android.application)
33
}
44

55
android {
@@ -53,9 +53,7 @@ android {
5353
release {
5454
isMinifyEnabled = true
5555
multiDexEnabled = false
56-
proguardFiles(
57-
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
58-
)
56+
proguardFiles += file("proguard-rules.pro")
5957
}
6058
}
6159

zygisk/src/main/cpp/CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ find_package(cxx REQUIRED CONFIG)
99
link_libraries(cxx::cxx)
1010

1111
add_library(zygisk SHARED zygisk.cpp)
12-
13-
add_subdirectory(xdl)
14-
15-
target_link_libraries(zygisk PRIVATE xdl)

zygisk/src/main/cpp/xdl/CMakeLists.txt

-21
This file was deleted.

zygisk/src/main/cpp/xdl/include/xdl.h

-95
This file was deleted.

0 commit comments

Comments
 (0)