Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
Rename project to KeystoreInjection
Browse files Browse the repository at this point in the history
  • Loading branch information
aviraxp committed Jun 17, 2024
1 parent f25d2a8 commit dfb52a2
Show file tree
Hide file tree
Showing 28 changed files with 40 additions and 207 deletions.
14 changes: 0 additions & 14 deletions .github/FUNDING.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
- name: Build with Gradle
run: ./gradlew assembleRelease

- name: Upload PlayIntegrityFix.zip
- name: Upload KeystoreInjection.zip
uses: actions/upload-artifact@v4
with:
name: PlayIntegrityFix
name: KeystoreInjection
path: module/*
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/deploymentTargetDropDown.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/deploymentTargetSelector.xml

This file was deleted.

19 changes: 0 additions & 19 deletions .idea/gradle.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/migrations.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/misc.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

57 changes: 2 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,3 @@
# Play Integrity Fix
# Zygisk-KeystoreInjection

This module tries to fix Play Integrity and SafetyNet verdicts to get a valid attestation.

## NOTE
If you use a custom ROM, make sure it is signed with the maintainer's private keys, otherwise, you will never be able to pass the Device verdict.

This module is not made to hide the root, nor to avoid detections in other apps. It only serves to obtain the Device verdict in the Play Integrity tests and certify your device.
All issues created to report a non-Google app not working will be closed without notice.

## Tutorial

You will need root and Zygisk, so you must choose ONE of this three setups:

- [Magisk](https://github.com/topjohnwu/Magisk) with Zygisk enabled.
- [KernelSU](https://github.com/tiann/KernelSU) with [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) module installed.
- [APatch](https://github.com/bmax121/APatch) with [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) module installed.

After flashing and reboot your device, you can check PI and SN using these apps:

- Play Integrity -> https://play.google.com/store/apps/details?id=gr.nikolasspyr.integritycheck
- SafetyNet -> https://play.google.com/store/apps/details?id=rikka.safetynetchecker

NOTE: if you get an error message about a limit, you need to use another app, this is because a lot of users are requesting an attestation.

NOTE: SafetyNet is obsolete, more info here: https://developer.android.com/privacy-and-security/safetynet/deprecation-timeline

Also, if you are using custom rom or custom kernel, be sure that your kernel name isn't blacklisted, you can check it running ```uname -r``` command. This is a list of banned strings: https://xdaforums.com/t/module-play-integrity-fix-safetynet-fix.4607985/post-89308909

## Verdicts

After requesting an attestation in Play Integrity API you should get this result:

- MEETS_BASIC_INTEGRITY ✅
- MEETS_DEVICE_INTEGRITY ✅
- MEETS_STRONG_INTEGRITY ❌
- MEETS_VIRTUAL_INTEGRITY ❌

You can know more about verdicts in this post: https://xdaforums.com/t/info-play-integrity-api-replacement-for-safetynet.4479337/

And in SafetyNet you should get this:

- basicIntegrity: true
- ctsProfileMatch: true
- evaluationType: BASIC

NOTE: Strong verdict is impossible to pass on unlocked bootloader devices, there are few devices and "exploits" which will allow you to pass it, but, in normal conditions, this verdict will be green only if you are using stock ROM and locked bootloader. The old posts talking about Strong pass was an "exploit" in Google servers, obviously, now it's patched.

## FAQ
https://xdaforums.com/t/pif-faq.4653307/

## Download
https://github.com/chiteroman/PlayIntegrityFix/releases/latest

## Donations
[PayPal](https://www.paypal.com/paypalme/chiteroman)
This module tries to Generate a valid certificate chain by injecting custom Keystore provider.
12 changes: 6 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

android {
namespace = "es.chiteroman.playintegrityfix"
namespace = "io.github.aviraxp.keystoreinjection"
compileSdk = 34
ndkVersion = "26.3.11579264"
buildToolsVersion = "34.0.0"
Expand All @@ -13,11 +13,11 @@ android {
}

defaultConfig {
applicationId = "es.chiteroman.playintegrityfix"
minSdk = 26
applicationId = "io.github.aviraxp.keystoreinjection"
minSdk = 34
targetSdk = 34
versionCode = 15990
versionName = "v15.9.9"
versionCode = 10
versionName = "v0.1.0"
multiDexEnabled = false

packaging {
Expand Down Expand Up @@ -110,7 +110,7 @@ tasks.register("copyFiles") {
tasks.register<Zip>("zip") {
dependsOn("copyFiles")

archiveFileName.set("PlayIntegrityFix_${project.android.defaultConfig.versionName}.zip")
archiveFileName.set("KeystoreInjection_${project.android.defaultConfig.versionName}.zip")
destinationDirectory.set(project.rootDir.resolve("out"))

from(project.rootDir.resolve("module"))
Expand Down
10 changes: 5 additions & 5 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-keep class es.chiteroman.playintegrityfix.EntryPoint {public <methods>;}
-keep class es.chiteroman.playintegrityfix.CustomProvider
-keep class es.chiteroman.playintegrityfix.CustomKeyStoreSpi
-keep class es.chiteroman.playintegrityfix.CustomKeyStoreKeyPairGeneratorSpi$EC
-keep class es.chiteroman.playintegrityfix.CustomKeyStoreKeyPairGeneratorSpi$RSA
-keep class io.github.aviraxp.keystoreinjection.EntryPoint {public <methods>;}
-keep class io.github.aviraxp.keystoreinjection.CustomProvider
-keep class io.github.aviraxp.keystoreinjection.CustomKeyStoreSpi
-keep class io.github.aviraxp.keystoreinjection.CustomKeyStoreKeyPairGeneratorSpi$EC
-keep class io.github.aviraxp.keystoreinjection.CustomKeyStoreKeyPairGeneratorSpi$RSA

-keep class org.bouncycastle.jcajce.provider.** { *; }
-keep class org.bouncycastle.jce.provider.** { *; }
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.22.1)

project(playintegrityfix)
project(keystoreinjection)

find_package(cxx REQUIRED CONFIG)

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "PIF", __VA_ARGS__)

#define CLASSES_DEX "/data/adb/modules/playintegrityfix/classes.dex"
#define CLASSES_DEX "/data/adb/modules/keystoreinjection/classes.dex"

#define KEYBOX_FILE_PATH "/data/adb/keybox.xml"

Expand Down Expand Up @@ -37,7 +37,7 @@ ssize_t xwrite(int fd, void *buffer, size_t count) {
return total;
}

class PlayIntegrityFix : public zygisk::ModuleBase {
class KeystoreInjection : public zygisk::ModuleBase {
public:
void onLoad(zygisk::Api *api, JNIEnv *env) override {
this->api = api;
Expand Down Expand Up @@ -119,7 +119,7 @@ class PlayIntegrityFix : public zygisk::ModuleBase {
LOGD("load class");
auto loadClass = env->GetMethodID(clClass, "loadClass",
"(Ljava/lang/String;)Ljava/lang/Class;");
auto entryClassName = env->NewStringUTF("es.chiteroman.playintegrityfix.EntryPoint");
auto entryClassName = env->NewStringUTF("io.github.aviraxp.keystoreinjection.EntryPoint");
auto entryClassObj = env->CallObjectMethod(dexCl, loadClass, entryClassName);

auto entryPointClass = (jclass) entryClassObj;
Expand Down Expand Up @@ -169,6 +169,6 @@ static void companion(int fd) {
xwrite(fd, xmlVector.data(), xmlSize);
}

REGISTER_ZYGISK_MODULE(PlayIntegrityFix)
REGISTER_ZYGISK_MODULE(KeystoreInjection)

REGISTER_ZYGISK_COMPANION(companion)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package es.chiteroman.playintegrityfix;
package io.github.aviraxp.keystoreinjection;

import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.cert.X509CertificateHolder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package es.chiteroman.playintegrityfix;
package io.github.aviraxp.keystoreinjection;

import android.annotation.SuppressLint;
import android.os.Build;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package es.chiteroman.playintegrityfix;
package io.github.aviraxp.keystoreinjection;

import android.util.Log;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package es.chiteroman.playintegrityfix;
package io.github.aviraxp.keystoreinjection;

import java.security.Provider;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package es.chiteroman.playintegrityfix;
package io.github.aviraxp.keystoreinjection;

import android.util.Log;

Expand Down Expand Up @@ -84,6 +84,6 @@ static Keybox box(String type) {
}

static void LOG(String msg) {
Log.d("PIF", msg);
Log.d("KeystoreInjection", msg);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package es.chiteroman.playintegrityfix;
package io.github.aviraxp.keystoreinjection;

import org.bouncycastle.asn1.x500.X500Name;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package es.chiteroman.playintegrityfix;
package io.github.aviraxp.keystoreinjection;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
Expand Down
13 changes: 0 additions & 13 deletions changelog.md

This file was deleted.

6 changes: 3 additions & 3 deletions module/customize.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Error on < Android 8.
if [ "$API" -lt 26 ]; then
abort "- !!! You can't use this module on Android < 8.0"
# Error on < Android 14.
if [ "$API" -lt 34 ]; then
abort "- !!! You can't use this module on Android < 14"
fi
13 changes: 6 additions & 7 deletions module/module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
id=playintegrityfix
name=Play Integrity Fix
version=v15.9.9
versionCode=15990
author=chiteroman
description=Universal modular fix for Play Integrity (and SafetyNet) on devices running Android 8-14.
updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json
id=keystoreinjection
name=Keystore Injection
version=v0.1.0
versionCode=10
author=aviraxp
description=Generate a valid certificate chain by injecting custom Keystore provider.
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ dependencyResolutionManagement {
}
}

rootProject.name = "PlayIntegrityFix"
rootProject.name = "KeystoreInjection"
include(":app")
6 changes: 2 additions & 4 deletions update.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"version": "v15.9.9",
"versionCode": 15990,
"zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v15.9.9/PlayIntegrityFix_v15.9.9.zip",
"changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/changelog.md"
"version": "v0.1.0",
"versionCode": 10
}

0 comments on commit dfb52a2

Please sign in to comment.