Skip to content

feat: Add Disable pairip license check patch #4927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

hoo-dles
Copy link
Contributor

@hoo-dles hoo-dles commented May 8, 2025

Just a simple, little patch to bypass the client-side validation of the Google Play Licensing response. This should work for any app that only does the client validation (if we want to move the code to a shared location.)

Fixes #4776

@hoo-dles hoo-dles changed the title feat(Angulus): Adding Disable license check patch feat(Angulus): Add Disable license check patch May 8, 2025
Copy link
Contributor

@Nuckyz Nuckyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also take a look at changing the daily limit patch to returnEarly(0) as the method returns an int, and calling returnEarly without a value seems kinda weird

@dtricks
Copy link
Contributor

dtricks commented May 12, 2025

I would also take a look at changing the daily limit patch to returnEarly(0) as the method returns an int, and calling returnEarly without a value seems kinda weird

#4604 (comment)

I find returnEarly(0) more readable as well

@hoo-dles
Copy link
Contributor Author

I would also take a look at changing the daily limit patch to returnEarly(0) as the method returns an int, and calling returnEarly without a value seems kinda weird

@oSumAtrIX We currently don't have a helper method for returnEarly() that accepts primitive types other than boolean. returnEarly(false) does not seem any more readable in this instance since the original method returns an integer. Do we want to extend the existing helpers, or just leave the code as is?

@oSumAtrIX
Copy link
Member

What's a daily limit patch? Regarding the utility function, i guess the simplest is to pass the return operand as a string 👍

@hoo-dles
Copy link
Contributor Author

What's a daily limit patch?

The daily limit patch is the existing ads patch. App checks to see how many measurements the user has taken today, and then blocks functionality until an ad is watched.

Regarding the utility function, i guess the simplest is to pass the return operand as a string 👍

The constant size is hardcoded to a 4-bit const/4, how do you want to handle that?

@LisoUseInAIKyrios
Copy link
Contributor

LisoUseInAIKyrios commented May 12, 2025

Can add an overloaded function

fun MutableMethod.returnEarly(Boolean)

That calls into:
fun MutableMethod.returnEarly(String)

So the usage for boolean return methods is a bit more explicit

@LisoUseInAIKyrios
Copy link
Contributor

The constant size is hardcoded to a 4-bit const/4, how do you want to handle that?

Why not replace the instruction with regular const? If the 4-bit limit is the issue you're speaking of.

@hoo-dles
Copy link
Contributor Author

hoo-dles commented May 12, 2025

The constant size is hardcoded to a 4-bit const/4, how do you want to handle that?

Why not replace the instruction with regular const? If the 4-bit limit is the issue you're speaking of.

That's definitely a possibility. Although I don't think that would work for a string literal (where you'd use const-string), which is confusing if the returnEarly() function signature accepts a string. I figured I would ask the team considering this a widely used helper throughout the patches project.

@LisoUseInAIKyrios
Copy link
Contributor

Currently returnEarly (and it's similar returnLate) don't work with strings but feel free to add it to the existing util methods.

Instead of just boolean and string overloads, the utils method could be overloaded with all primitive types plus String, as that gives better type safety since the parameter type would need to match the method being patched. Then for the implementation just modify the existing private util method and have all the overloadeds call onto it.

@hoo-dles hoo-dles changed the title feat(Angulus): Add Disable license check patch feat: Add Disable pairip license check patch and add returnEarly/returnLate overloads May 13, 2025
@hoo-dles
Copy link
Contributor Author

hoo-dles commented May 13, 2025

Currently returnEarly (and it's similar returnLate) don't work with strings but feel free to add it to the existing util methods.

Instead of just boolean and string overloads, the utils method could be overloaded with all primitive types plus String, as that gives better type safety since the parameter type would need to match the method being patched. Then for the implementation just modify the existing private util method and have all the overloadeds call onto it.

Pushed new commits that move pairip patch to shared location, and added returnEarly() and returnLate() overloads for primitives.

I didn't do an overload for String because all the Smali code I've seen treats strings as the Java object. Wasn't sure if const-string accepts a variable size string literal (opcode list says string_id param), or if it plays nicely with a return type of Ljava/lang/String;.

@Suppress("unused")
val disableLicenseCheckPatch = bytecodePatch(
name = "Disable license check",
description = "Disable Play Integrity Protect (pairip) client-side license check."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description should be improved in my opinion. Basically every pairip version is based on libpairipcore.so, and that cannot be disabled (not by this patch, at least). May be worth noting it in the patch description, this patch is only bypassing the smali license check, but if the app has native checks, it won't open anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change it to whatever language someone suggests :P

@LisoUseInAIKyrios LisoUseInAIKyrios changed the title feat: Add Disable pairip license check patch and add returnEarly/returnLate overloads feat: Add Disable pairip license check patch May 13, 2025
@LisoUseInAIKyrios

This comment was marked as resolved.

@hoo-dles

This comment was marked as resolved.

@LisoUseInAIKyrios

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(Angulus): Hide ads succeeded but the app won't open
6 participants