Skip to content

Vending: Add background licensing service for local license reports - #4061

Open
grenadin wants to merge 1 commit into
microg:masterfrom
grenadin:feature/vending-background-licensing
Open

grenadin wants to merge 1 commit into
microg:masterfrom
grenadin:feature/vending-background-licensing

Conversation

@grenadin

@grenadin grenadin commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Apps protected by Play Automatic Integrity Protection (pairip) report a passed local installer check to com.android.vending.licensing.IBackgroundLicensingService. Companion does not provide it, so when an app is installed through Companion the client retries the bind three times (about 6 s) and logs errors before continuing.

This adds a no-op implementation that requires the CHECK_LICENSE permission, as the Play Store's service does. The interface comes from the pairip client bundled in the apps: transaction 3 (= 2 in AIDL), String packageName and a Bundle that was always null. The same code and parcel layout are used by all 8 apps I checked.

Tested with eCrew 283 on a Huawei MatePad Mini: installed with the microG installer the report now succeeds in about 30 ms; installed with the Aurora session installer the existing checkLicenseV2 path still passes.

Logs and checked apps

Before (official Companion 0.3.18):

D/LicenseClient: Connecting to the background licensing service...
W/ActivityManager: Unable to start service Intent { act=com.android.vending.licensing.IBackgroundLicensingService pkg=com.android.vending } U=0: not found from pms
D/LicenseClient: Retry #1. License check failed with error 'Could not bind with the licensing service: com.android.vending.licensing.IBackgroundLicensingService'. Next try in 2s...
...
E/LicenseClient: Retry limit reached for: com.pairip.licensecheck.LicenseCheckException: Could not bind with the licensing service: com.android.vending.licensing.IBackgroundLicensingService

After (microG installer):

D/LicenseClient: Connecting to the background licensing service...
D/LicenseClient: Connected to the licensing service.
D/LicenseClient: Sending request to license reporting service...
D/BackgroundLicensing: reportAutoVerifiedLicense(aero.aims.eCrew, null)
D/LicenseClient: Request to licensing reporting service sent.

Checked by disassembling the bundled pairip client with dexdump (LicenseClient.reportSuccessfulLicenseCheck and populateInputDataForReportAutoVerifiedLicense):

App Transaction Parcel
aero.aims.eCrew 3 interface token, String, int 0
ai.x.grok 3 interface token, String, int 0
com.airvisual 3 interface token, String, int 0
com.androidfung.drminfo 3 interface token, String, int 0
com.goyalsoftech.hashcalc 3 interface token, String, int 0
com.pockethaven.roguelegend 3 interface token, String, int 0
com.shopee.spx.th.express 3 interface token, String, int 0
jp.naver.linecamera.android 3 interface token, String, int 0

Only eCrew was tested on a device.

Apps protected by Play Automatic Integrity Protection report a passed
local installer check to IBackgroundLicensingService. Without it they
retry the bind several times and log errors before continuing.
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.

1 participant