Tutorial How to bypass Pairip protections, LATEST (too easy)

NotAWeeb!

1/3 Games Approved
Original poster
Aug 31, 2023
202
33,585
1,193
japaneseland
Welcome, ladies and gentleman! :pepe019:

As of today, only having uploaded a mod out of the 3 required to become an Approved Modder, you may think I have little to no experience at modding. Let me tell ya, I'm just waiting to be truly advanced, so I'm a box full of surprises :face33:

I recently learnt the easiest way to bypass every pairip protection. And it's dead easy.


What's pairip?

Pairip, better known as the feared and improved signature and license verification protection, is a Google's creation that assures the APK / XAPK files from recent apps suffer no modification. It's often encountered in apps and games from the Play Store. It's probably a (bad) attempt to stop us, the modders, from creating MOD APK files.

There's not much information regarding all the protections, but it removes some parts of the game if a modification is detected (that's why you suffer black screen crashes and at the logcat they're produced by memory access violations) and it tries to safeguard certain libs' data by removing and restoring that data in real time as you play or use the app, thus creating another layer of protection and making it harder to make any modification attempts.

You can check if your game has pairip protection by extracting or decompiling the APK (or the APK that has the libs, extracting it first from the XAPK), then look at the "lib/architecture" folder. You should find a lib called "libpairipcore.so".

This little mf and its smali buddies are responsible for your failed attempts to merge your XAPK file to an APK, crashes every time you patch the libs, add new files or lines of code, etc.

It took me a while until I noticed pairip was the responsible for all of my failed attempts at modding an il2cpp game, so I took my time to figure a bypass that turned out to be too easy.

And as some people here really wanted to know how I do it, I'm creating a tutorial for you all :pepe020:


Requirements:

-A functional brain
-Some basic modding knowledge
-Your game or app APK/XAPK file


Disclaimer:

By now, you may have thought that it's something complicated to do, like changing smali files, patching the coreip lib... Nothing like that, my fella!

When I say it's easy, it's that it really is TOO EASY. It will make you feel dumb if you have tried to bypass it in hard ways :pepe001:

Anyways. You just need notions about modding. I don't teach you everything, this is not a tutorial for people with no experience.

If you guys want, I can create a little video tutorial with the steps, so let me know if you want it, but the procedure with text and images on spoilers should be more than enough.


Procedure:

First of all
, grab your APK file and decompile it.

In the case of it being an XAPK, make it an APK file using the following methodology. Works like a shot (it will crash if you test the merged APK, you need to make the pairip bypass first, so once you merge it, decompile it):

Once you'd have got your decompiled APK, make sure to make a backup of the original, unmodified APK. You're gonna need it. (In the case of the XAPK, make a backup of the base.apk / your.app.name.apk)

Then open the AndroidManifest.xml file from the decompiled APK with a text editor. I recommend Notepad++

After that, search for "pairip". You should find a single coincidence located at the first <application> line.

1.png

As you see, the path to the main pairip smali file is there: "com.pairip.application.Application" This is because the main pairip smali file gets called from the AndroidManifest.xml...

Y'know where this is going :pepe019:

Now that we have the path com/pairip/application/Application.smali, let's locate it at one of the smali_classes folder.

In my case, it was located at smali_classes2.

2.png

We simply open it and look at the first lines of code.

3.png

You see now that pairip main call from AndroidManifest.xml is inherited from Landroid/app/Application; which is the main game/app smali file. So to prevent pairip from being called and thus making it completely useless, we're going to change that line from the AndroidManifest file.

Pay closer attention now, because in this step it's easy to do it wrong, it happened to me 2 times in a row.

Go to the same pairip line at the AndroidManifest, and replace the pairip path by the one you found at the Application.smali file. In this case, "LAndroid/app/Application".

BUT, you have to change it, to make sure it's readable by the Manifest, so you have to add dots instead of "/" and remove the L. Just look at the example to see what I mean:

Code:
Example:

DON'T REPLACE IT LIKE THIS: "Landroid/app/Application"
REPLACE IT LIKE THIS: "android.app.Application"
4.png

Now, save the changes.

Wait! We're not done yet.

Compile the APK. When it's done, move the compiled APK and the backed up unmodified APK to your android device or android emulator of your preference.

To finish our bypass, we need to change the compiled APK CRC32 signature. Don't ask me why or how, but it's needed, and it's easier than coming up with a bypass of the CRC32 checker.

Download below a handy tool called Apkanalyzer+ that's useful to patch APK files, as we're going to use it to easily replace the CRC32 by the original and culminate this bypass.
👇

Free Download:
Hidden content
** You must be signed up and reply to the thread or click 'Like' under this post before you can see the hidden links contained here. **
If you still facing issues revealing the hidden links, please read this.
Download and install the Apkanalyzer+ APK in the android device or emulator. Then open it and accept the permissions.

Locate the compiled APK. Tap on it, then choose the option "Modify New Apk Old set Entry"

5.png

After that, select the unmodified APK, because it's the one we're going to copy the CRC32 from.

Then, deselect "set old time" and leave only "set old crc32" enabled. Then press PATCH. Wait until it's finished, and you're done!

Install the new APK file that has "Edit_Sign" at the end, then try it out! The app or game will work perfectly fine, with no trace of the pairip protections and crashes.

If you had to merge the XAPK to make it an APK, then you'll see your merged APK finally works now after this bypass.

Just repeat the CRC32 step every time you compile the APK with your modifications, and you're good to go.

Nothing's stopping you now :pepe019:

Enjoy Platinians!! :pepe023:

Any questions? Just leave them here in the thread and I'll try to help you. Though, I won't help you with obvious modding questions. Modding knowledge is already waiting for you, right here on this forum, so go learn it.
 

ArsonMods

Solid & Active Platinian
May 25, 2023
50
1,383
183
New Mexico, United States
Works great, tested procedure with APKTool M no-dex decompile and MT Manager for obtaining the new package name. I cannot believe it is this simple. I am kicking myself for the many hours wasted trying to reverse the main code only for it still activate and disable the app. My goodness this is this simplest protection of this nature, no need to even mod the DRM lib 😅. What a fail for Google.
 

NotAWeeb!

1/3 Games Approved
Original poster
Aug 31, 2023
202
33,585
1,193
japaneseland
Works great, tested procedure with APKTool M no-dex decompile and MT Manager for obtaining the new package name. I cannot believe it is this simple. I am kicking myself for the many hours wasted trying to reverse the main code only for it still activate and disable the app. My goodness this is this simplest protection of this nature, no need to even mod the DRM lib 😅. What a fail for Google.
:pepe001: glad it helped you out! And actually, I had been entire days (a week at least) trying to figure why my modifications and my merged APK wouldn't work, to then also some hours trying to figure a bypass.

So if you didn't insist on bypassing this protection, you wouldn't have found this guide. Keep up the hard work :pepe023:
 
  • Like
Reactions: AASIM_456

Ali.P.1368

Platinian
Jun 22, 2022
8
2
3
26
IR
Hello great master (NotAWeeb)
Your method was unique and really great.
But the problem I have is that after doing the mentioned tasks, the modded game with personal menu mode is great and works on Android 9 and above, but unfortunately not on Android 9 and below.
I am waiting for your help. Thank you very much.

Used game: Royal Match(17854)
 

NotAWeeb!

1/3 Games Approved
Original poster
Aug 31, 2023
202
33,585
1,193
japaneseland
Hello great master (NotAWeeb)
Your method was unique and really great.
But the problem I have is that after doing the mentioned tasks, the modded game with personal menu mode is great and works on Android 9 and above, but unfortunately not on Android 9 and below.
I am waiting for your help. Thank you very much.

Used game: Royal Match(17854)
Wow, really? That's actually interesting. I had someone write me with kind of a related issue. I got to bypass his game, but he still reported crashing issues. And after testing, apparently, it was just crashing in versions below Android 9. Very strange behaviour.

I currently can't retake modding for one or two days because I'm moving files from my old PC to the new one, but when I have time I will take a closer look and try it myself to see if Android versions below 9 really do have this problem.

Will try to remember, but if after a couple days I haven't replied with news, remind me.

Hold on... Now that I think about it... I think all this has to do with the fact that the games of today, those that already come in XAPK format and with pairip, are games that are no longer compatible with Android versions below 9, and it is something that makes sense in the face of security and planned obsolescence on Google's part. In the end, they are monopolizing the Android market and are responsible for most of these security changes.

Anyway, the latter is just speculation for now. As I told you, I have to check it out for myself, so give me some time.

If you get any news, let me know. Take care.
 

Ali.P.1368

Platinian
Jun 22, 2022
8
2
3
26
IR
Wow, really? That's actually interesting. I had someone write me with kind of a related issue. I got to bypass his game, but he still reported crashing issues. And after testing, apparently, it was just crashing in versions below Android 9. Very strange behaviour.

I currently can't retake modding for one or two days because I'm moving files from my old PC to the new one, but when I have time I will take a closer look and try it myself to see if Android versions below 9 really do have this problem.

Will try to remember, but if after a couple days I haven't replied with news, remind me.

Hold on... Now that I think about it... I think all this has to do with the fact that the games of today, those that already come in XAPK format and with pairip, are games that are no longer compatible with Android versions below 9, and it is something that makes sense in the face of security and planned obsolescence on Google's part. In the end, they are monopolizing the Android market and are responsible for most of these security changes.

Anyway, the latter is just speculation for now. As I told you, I have to check it out for myself, so give me some time.

If you get any news, let me know. Take care.
Thank you for your reply.
I am impatiently waiting for you to test and fix the problem, dear teacher.
Although I will work on the cause myself.
Also, when I install the original XAPK version with the ZArchiver program on Android 8, it works correctly.
God willing, the reason will be found.
Good luck to you
 

ebk21

Rookie
Mar 1, 2023
2
0
1
Reducted
Hi. Are you sure this method bypasses all 3 level of protection from automatic play intergrity(pairip) discussed here github.com/rednaga/APKiD/issues/329 ?
 

NotAWeeb!

1/3 Games Approved
Original poster
Aug 31, 2023
202
33,585
1,193
japaneseland
so according to github.com/rednaga/APKiD/issues/329#issuecomment-1815669043 you can only hope the game does not use any 'extra encrypted code' so that this method will work.
I mean, it's all about trying. And I think they don't understand how the bypass works, as according to the github comment and as I already mentioned in my bypass post, safeguarding libs by extracting code and restoring them it's a pairip functionality, and my bypass effectively skips any execution from pairip protections.

Still, pairip is a recent protection that's still kinda unknown, so if this bypass works, great. If not, let's keep learning. But don't let yourself be guided by some random users that didn't even try my bypass or failed with such simple steps. Try it yourself. You could try before writing anything.

This bypass works with apps and games such as OpenAI's ChatGPT and Pickle Pete.
 
Last edited:
  • Like
Reactions: Ali.P.1368