Skip to content

Commit

Permalink
Release v16.6
Browse files Browse the repository at this point in the history
  • Loading branch information
chiteroman committed Jul 20, 2024
1 parent 1c29473 commit 5d42e12
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 31 deletions.
24 changes: 12 additions & 12 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
applicationId = "es.chiteroman.playintegrityfix"
minSdk = 26
targetSdk = 35
versionCode = 16500
versionCode = 16600
versionName = "v16.6"
multiDexEnabled = false

Expand All @@ -31,17 +31,17 @@ android {

externalNativeBuild {
cmake {
arguments += "-DANDROID_STL=none"
arguments += "-DCMAKE_BUILD_TYPE=MinSizeRel"

cFlags += "-w"
cppFlags += "-w"

cppFlags += "-std=c++2c"
cppFlags += "-fno-exceptions"
cppFlags += "-fno-rtti"
cppFlags += "-fvisibility=hidden"
cppFlags += "-fvisibility-inlines-hidden"
arguments += arrayOf(
"-DANDROID_STL=none",
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON",
"-DANDROID_CPP_FEATURES=no-rtti no-exceptions",
"-DCMAKE_BUILD_TYPE=MinSizeRel",
"-DCMAKE_CXX_STANDARD=23",
"-DCMAKE_C_STANDARD=23",
"-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON",
"-DCMAKE_CXX_VISIBILITY_PRESET=hidden",
"-DCMAKE_C_VISIBILITY_PRESET=hidden",
)
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions app/src/main/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ static void (*o_system_property_read_callback)(const prop_info *, T_Callback, vo

static void
my_system_property_read_callback(const prop_info *pi, T_Callback callback, void *cookie) {
if (callback && cookie) callbacks[cookie] = callback;
if (pi && callback && cookie) callbacks[cookie] = callback;
return o_system_property_read_callback(pi, modify_callback, cookie);
}

static void doHook() {
LOGD("JSON contains DEVICE_INITIAL_SDK_INT key. Hooking native prop symbol");
void *handle = DobbySymbolResolver(nullptr, "__system_property_read_callback");
if (!handle) {
LOGE("error resolving __system_property_read_callback symbol!");
Expand Down Expand Up @@ -154,9 +155,10 @@ class PlayIntegrityFix : public zygisk::ModuleBase {
void postAppSpecialize(const zygisk::AppSpecializeArgs *args) override {
if (dexVector.empty()) return;

parseJSON();
if (!json.empty()) parseJSON();

doHook();
if (enableHook) doHook();
else api->setOption(zygisk::DLCLOSE_MODULE_LIBRARY);

injectDex();
}
Expand All @@ -170,11 +172,11 @@ class PlayIntegrityFix : public zygisk::ModuleBase {
JNIEnv *env = nullptr;
std::vector<uint8_t> dexVector;
nlohmann::json json;
bool enableHook = false;

void parseJSON() {
if (json.empty()) return;

if (json.contains("DEVICE_INITIAL_SDK_INT")) {
enableHook = true;
if (json["DEVICE_INITIAL_SDK_INT"].is_string()) {
DEVICE_INITIAL_SDK_INT = json["DEVICE_INITIAL_SDK_INT"].get<std::string>();
} else if (json["DEVICE_INITIAL_SDK_INT"].is_number_integer()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package es.chiteroman.playintegrityfix;

import android.util.Log;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand All @@ -10,7 +12,6 @@
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.util.Arrays;
import java.util.Date;
import java.util.Enumeration;
import java.util.Locale;
Expand All @@ -25,8 +26,11 @@ public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmExc

@Override
public Certificate[] engineGetCertificateChain(String alias) {
if (Arrays.stream(Thread.currentThread().getStackTrace()).anyMatch(e -> e.getClassName().toLowerCase(Locale.US).contains("droidguard"))) {
throw new UnsupportedOperationException();
for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace()) {
if (stackTraceElement.getClassName().toLowerCase(Locale.US).contains("droidguard")) {
Log.w(EntryPoint.TAG, "DroidGuard invoke engineGetCertificateChain! Throwing exception...");
throw new UnsupportedOperationException();
}
}
return keyStoreSpi.engineGetCertificateChain(alias);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public static void init(String json) {

jsonObject.keys().forEachRemaining(s -> {
try {
if ("DEVICE_INITIAL_SDK_INT".equals(s)) return;

String value = jsonObject.getString(s);

if (TextUtils.isEmpty(value)) return;
Expand Down
8 changes: 3 additions & 5 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ If not, try removing /data/adb/pif.json file.
Donations:
https://www.paypal.com/paypalme/chiteroman

# v16.5
# v16.6

- Update hook framework: [Dobby](https://github.com/chiteroman/Dobby.git)
- Fix Device not passing in few devices
- Improve code
- Reduce Zygisk libs size
- Change fingerprint to fix RCS
- Misc improvements
2 changes: 1 addition & 1 deletion module/module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=playintegrityfix
name=Play Integrity Fix
version=v16.6
versionCode=16500
versionCode=16600
author=chiteroman
description=Universal modular fix for Play Integrity (and SafetyNet) on devices running Android 8-15
updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json
6 changes: 3 additions & 3 deletions update.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "v16.5",
"versionCode": 16500,
"zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v16.5/PlayIntegrityFix_v16.5.zip",
"version": "v16.6",
"versionCode": 16600,
"zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v16.6/PlayIntegrityFix_v16.6.zip",
"changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/changelog.md"
}

0 comments on commit 5d42e12

Please sign in to comment.