research · October 15, 2026 · 5 min read
Tracing and Bypassing PairIP’s Google Play License Check
I was testing an Android app with ReFlutter to inspect its network traffic. The Play-installed build opened normally, but the patched APK redirected to Google Play with “Get this app from Play.”
I traced the launch path through com.pairip.licensecheck to find what triggered the redirect. The app name and package are anonymized throughout this post. abc.company.xyz stands in for the real package, and the app reference is blurred in the screenshot.
The launch logs point to a licensing check
Before opening the app, I started collecting logs in a separate terminal:
adb logcat -v threadtime > work/pairip/blocked-logcat.txtIn another terminal, I launched the app and saved the activity state:
PACKAGE='abc.company.xyz'adb shell am start -W -n "$PACKAGE/.MainActivity"adb shell dumpsys activity activities > work/pairip/blocked-activities.txtThe licensing logs included:
I LicenseClient: Local install check failed due to wrong installer.D LicenseClient: Connecting to the main licensing service...D LicenseClient: Connected to the licensing service.D LicenseClient: Sending request to licensing service...D LicenseClient: Request to licensing service sent.The activity logs showed com.pairip.licensecheck.LicenseActivity being launched and then closed. Google Play became the foreground app with an intent pointing to http://play.google.com/store/license/paywall?id=abc.company.xyz

The logs show an installer check followed by a request to the licensing service. I looked for the code path that starts the check and handles its response.
Finding the startup hook
I decoded the base APK and searched the manifest and smali files. Here, work/pairip/base.apk is the base APK from the build that failed to open:
apktool d work/pairip/base.apk -o work/pairip/decoded
rg -n 'com\.pairip|LicenseActivity|LicenseContentProvider' work/pairip/decoded/AndroidManifest.xml
rg -n 'LicenseClient;->checkLicense|initializeLicenseCheck' work/pairip/decoded -g '*.smali'The manifest names com.pairip.application.Application as the Application class and declares com.pairip.licensecheck.LicenseActivity with android:exported="false".
I also found a LicenseContentProvider class under smali_classes2/com/pairip/licensecheck/, but it was not declared as a provider in the manifest. Finding the class in the DEX did not, by itself, show that it ran during startup. The concrete entry point for this build was in smali_classes2/com/pairip/application/Application.smali: the class extends android.app.Application and overrides attachBaseContext().
.method protected attachBaseContext(Landroid/content/Context;)V .locals 0
invoke-static {p1}, Lcom/pairip/licensecheck/LicenseClient;->checkLicense(Landroid/content/Context;)V
invoke-super {p0, p1}, Lcom/pairip/application/Application;->attachBaseContext(Landroid/content/Context;)V
return-void.end methodcheckLicense(Context) queues a Runnable through mainThreadRunner. That Runnable reaches lambda$checkLicense$0(Context), gets the client instance, and calls initializeLicenseCheck():
.method static synthetic lambda$checkLicense$0(Landroid/content/Context;)V .locals 0
.line 183 invoke-static {p0}, Lcom/pairip/licensecheck/LicenseClient;->getInstance(Landroid/content/Context;)Lcom/pairip/licensecheck/LicenseClient;
move-result-object p0
invoke-virtual {p0}, Lcom/pairip/licensecheck/LicenseClient;->initializeLicenseCheck()V
return-void.end methodA search for direct calls to checkLicense(Context) found two callers: the Application class and the provider class. For the build I tested, the manifest and the Application override explained the startup path.
Following the response to the Play screen
In the initial CHECK_REQUIRED state, initializeLicenseCheck() schedules a local installer check when that check is enabled. performLocalInstallerCheck() calls PackageManager.getInstallSourceInfo(packageName).getInstallingPackageName() and compares the result with com.android.vending.
When the installer is absent or has a different name, the check logs the “wrong installer” message and returns false. The following callback still opens a connection to the main licensing service. That sequence matches the launch logs.
Farther down the response handler, processResponse(int, Bundle) handles response code 2 by reading PAYWALL_INTENT from the Bundle and passing it to startPaywallActivity(PendingIntent). That method prepares an intent for LicenseActivity, adds the PendingIntent and the PAYWALL activity type, schedules app shutdown, and starts the activity.
LicenseActivity.onStart() dispatches that activity type to showPaywallAndCloseApp(). Its callback sends the PendingIntent, closes the app’s tasks, and calls System.exit(0).
This connects the Application hook to the Google Play screen I observed. The response-code-2 branch comes from the smali trace. I did not capture the numeric response at the IPC boundary.
Patching and validating the test build
The call in attachBaseContext() gave me a place to stop the check before it scheduled any licensing work.
In smali_classes2/com/pairip/application/Application.smali, I replaced the invoke-static instruction targeting checkLicense(Context) with nop:
.method protected attachBaseContext(Landroid/content/Context;)V .locals 0
nop
invoke-super {p0, p1}, Lcom/pairip/application/Application;->attachBaseContext(Landroid/content/Context;)V
return-void.end methodThe call to the superclass remains in place, and the manifest still names the PairIP Application class. In this build, the change prevents the startup call from creating the licensing client and scheduling the check.
I rebuilt the decoded APK, aligned it, and signed it with the same key used for the repackaged build. The test device used 16 KB pages, so the alignment command includes -P 16. work/pairip/test.p12 represents the existing keystore:
apktool b -f work/pairip/decoded -o work/pairip/patched-unsigned.apk
zipalign -P 16 4 work/pairip/patched-unsigned.apk work/pairip/patched-aligned.apk
apksigner sign --ks work/pairip/test.p12 --out work/pairip/patched-signed.apk work/pairip/patched-aligned.apk
apksigner verify --verbose --print-certs work/pairip/patched-signed.apk
zipalign -c -P 16 4 work/pairip/patched-signed.apkThe smali change targets one instruction in classes2.dex. In the validation build, only that DEX was reassembled. The compiled manifest, resources, assets, and other DEX files matched those from the blocked build.
The app was installed as a base APK and five splits. Because the patch used the same signing key as the repackaged build and reused the signed splits, I could install it as an update:
adb install-multiple -r work/pairip/patched-signed.apk work/pairip/signed-splits/*.apkTo test a cold launch, I started a fresh log capture in a separate terminal:
adb logcat -v threadtime > work/pairip/patched-logcat.txtThen I force-stopped the app and launched it again:
adb shell am force-stop "$PACKAGE"adb shell am start -W -n "$PACKAGE/.MainActivity"adb shell dumpsys activity activities > work/pairip/patched-activities.txtam start reported LaunchState: COLD. After I dismissed the notification permission dialog, the app opened to its onboarding screen with MainActivity in the foreground. The Google Play redirect did not appear in this test.
The new launch logs contained no LicenseClient or LicenseActivity lines. I also verified that the hashes of all six APKs installed on the device matched the corresponding signed files kept locally.
| Build | Application class in manifest | checkLicense() call | Observed launch |
|---|---|---|---|
| Repackaged APK before the PairIP patch | com.pairip.application.Application | Present | “Get this app from Play” |
| Patched APK with the same signing key and splits | com.pairip.application.Application | Replaced with nop | Onboarding reached |
For this build, the startup licensing check was the call that blocked the launch. Removing it let me return to the network analysis that motivated the ReFlutter patch.
A broader alternative is pairipfix by Ahmed Mani, an LSPosed module targeting the “Get this app from Play” screen for apps installed outside Google Play. It includes hooks for signature and licensing checks. In this test, changing the startup call was enough.