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

View File

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

View File

@ -20,6 +20,11 @@ static jmethodID spoofFieldsMethod = nullptr;
static void spoofFields() {
if (jvm == nullptr) {
LOGD("JavaVM is null!");
return;
}
JNIEnv *env;
jvm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6);
@ -119,11 +124,28 @@ public:
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);
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 process(rawProcess);
bool isGms = dir.ends_with("/com.google.android.gms");
bool isGmsUnstable = process == "com.google.android.gms.unstable";
@ -178,8 +200,7 @@ public:
close(fd);
std::string_view jsonStr(jsonVector.cbegin(), jsonVector.cend());
json = nlohmann::json::parse(jsonStr, nullptr, false, true);
json = nlohmann::json::parse(jsonVector, nullptr, false, true);
parseJson();
}
@ -187,18 +208,6 @@ public:
void postAppSpecialize(const zygisk::AppSpecializeArgs *args) override {
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();
doHook();

View File

@ -76,14 +76,12 @@ public final class EntryPoint {
public static void spoofFields() {
map.forEach((field, s) -> {
field.setAccessible(true);
try {
field.set(null, s);
LOG("Set " + field.getName() + " field value: " + s);
} catch (IllegalAccessException 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;
}

View File

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

View File

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