v15.3-test

This commit is contained in:
chiteroman 2024-01-23 04:12:52 +01:00
parent 4992274bdd
commit e397ca3db1
7 changed files with 49 additions and 24 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "app/src/main/cpp/Dobby"]
path = app/src/main/cpp/Dobby
url = https://github.com/LSPosed/Dobby.git

View File

@ -12,18 +12,23 @@ android {
applicationId = "es.chiteroman.playintegrityfix" applicationId = "es.chiteroman.playintegrityfix"
minSdk = 26 minSdk = 26
targetSdk = 34 targetSdk = 34
versionCode = 15320 versionCode = 15330
versionName = "v15.3.2" versionName = "v15.3.3"
buildFeatures {
prefab = true
}
packaging { packaging {
jniLibs { jniLibs {
excludes += "**/liblog.so"
excludes += "**/libdobby.so" excludes += "**/libdobby.so"
} }
} }
externalNativeBuild { externalNativeBuild {
cmake { cmake {
arguments += "-DANDROID_STL=c++_static" arguments += "-DANDROID_STL=none"
arguments += "-DCMAKE_BUILD_TYPE=MinSizeRel" arguments += "-DCMAKE_BUILD_TYPE=MinSizeRel"
cppFlags += "-std=c++20" cppFlags += "-std=c++20"
@ -58,6 +63,10 @@ android {
} }
} }
dependencies {
implementation("dev.rikka.ndk.thirdparty:cxx:1.2.0")
}
tasks.register("updateModuleProp") { tasks.register("updateModuleProp") {
doLast { doLast {
val versionName = project.android.defaultConfig.versionName val versionName = project.android.defaultConfig.versionName

View File

@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.22.1)
project("playintegrityfix") project("playintegrityfix")
find_package(cxx REQUIRED CONFIG)
link_libraries(cxx::cxx)
add_library(${CMAKE_PROJECT_NAME} SHARED main.cpp) add_library(${CMAKE_PROJECT_NAME} SHARED main.cpp)
if (NOT TARGET dobby) if (NOT TARGET dobby)

View File

@ -20,6 +20,11 @@ static jmethodID spoofFieldsMethod = nullptr;
static void spoofFields() { static void spoofFields() {
if (jvm == nullptr) {
LOGD("JavaVM is null!");
return;
}
JNIEnv *env; JNIEnv *env;
jvm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6); jvm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6);
@ -119,11 +124,28 @@ public:
void preAppSpecialize(zygisk::AppSpecializeArgs *args) override { void preAppSpecialize(zygisk::AppSpecializeArgs *args) override {
auto rawProcess = env->GetStringUTFChars(args->nice_name, nullptr); if (args == nullptr || args->nice_name == nullptr || args->app_data_dir == nullptr) {
api->setOption(zygisk::DLCLOSE_MODULE_LIBRARY);
return;
}
auto rawDir = env->GetStringUTFChars(args->app_data_dir, nullptr); auto rawDir = env->GetStringUTFChars(args->app_data_dir, nullptr);
std::string_view process(rawProcess); if (rawDir == nullptr) {
api->setOption(zygisk::DLCLOSE_MODULE_LIBRARY);
return;
}
auto rawProcess = env->GetStringUTFChars(args->nice_name, nullptr);
if (rawProcess == nullptr) {
env->ReleaseStringUTFChars(args->app_data_dir, rawDir);
api->setOption(zygisk::DLCLOSE_MODULE_LIBRARY);
return;
}
std::string_view dir(rawDir); std::string_view dir(rawDir);
std::string_view process(rawProcess);
bool isGms = dir.ends_with("/com.google.android.gms"); bool isGms = dir.ends_with("/com.google.android.gms");
bool isGmsUnstable = process == "com.google.android.gms.unstable"; bool isGmsUnstable = process == "com.google.android.gms.unstable";
@ -178,8 +200,7 @@ public:
close(fd); close(fd);
std::string_view jsonStr(jsonVector.cbegin(), jsonVector.cend()); json = nlohmann::json::parse(jsonVector, nullptr, false, true);
json = nlohmann::json::parse(jsonStr, nullptr, false, true);
parseJson(); parseJson();
} }
@ -187,18 +208,6 @@ public:
void postAppSpecialize(const zygisk::AppSpecializeArgs *args) override { void postAppSpecialize(const zygisk::AppSpecializeArgs *args) override {
if (vector.empty() || json.empty()) return; if (vector.empty() || json.empty()) return;
LOGD("JSON keys: %d", static_cast<int>(json.size()));
if (!json.contains("PRODUCT") ||
!json.contains("DEVICE") ||
!json.contains("MANUFACTURER") ||
!json.contains("BRAND") ||
!json.contains("MODEL") ||
!json.contains("FINGERPRINT")) {
LOGD("JSON doesn't contain important fields to spoof!");
return;
}
injectDex(); injectDex();
doHook(); doHook();

View File

@ -76,14 +76,12 @@ public final class EntryPoint {
public static void spoofFields() { public static void spoofFields() {
map.forEach((field, s) -> { map.forEach((field, s) -> {
field.setAccessible(true);
try { try {
field.set(null, s); field.set(null, s);
LOG("Set " + field.getName() + " field value: " + s); LOG("Set " + field.getName() + " field value: " + s);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
LOG("Couldn't set " + field.getName() + " value " + s + " | Exception: " + e); LOG("Couldn't set " + field.getName() + " value " + s + " | Exception: " + e);
} }
field.setAccessible(false);
}); });
} }
@ -100,6 +98,8 @@ public final class EntryPoint {
} }
} }
field.setAccessible(true);
return field; return field;
} }

View File

@ -4,6 +4,6 @@ https://t.me/playintegrityfix
# v15.3 # v15.3
- Migrated from Dobby to ShadowHook (again) - New way to spoof field values!
- Update code logic. - Update code logic.
- Fixed few bugs. - Fixed few bugs.

View File

@ -1,7 +1,7 @@
id=playintegrityfix id=playintegrityfix
name=Play Integrity Fix name=Play Integrity Fix
version=v15.3.2 version=v15.3.3
versionCode=15320 versionCode=15330
author=chiteroman author=chiteroman
description=Universal modular fix for Play Integrity (and SafetyNet) on devices running Android 8+. description=Universal modular fix for Play Integrity (and SafetyNet) on devices running Android 8+.
updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json