Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ suspend fun HttpClient.makeLicenseV2Request(
url = "https://play-fe.googleapis.com/fdfe/apps/checkLicenseServerFallback?pkgn=$packageName&vc=$versionCode",
headers = buildRequestHeaders(auth, androidId),
adapter = GoogleApiResponse.ADAPTER
).payload?.licenseV2Response?.license?.jwt?.let {
// Field present ←→ user has license
).payload?.licenseV2Response?.license?.jwt?.takeIf { it.isNotEmpty() }?.let {
// Field present and non-empty ←→ user has license
V2Response(LICENSED, it)
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class LicensingService : Service() {
*/
if (response?.result == LICENSED && response is V2Response) {
val bundle = Bundle()
Log.e(TAG, "checkLicenseV2 jwt: ${response.jwt}")
bundle.putString(KEY_V2_RESULT_JWT, response.jwt)

try {
Expand Down Expand Up @@ -143,6 +144,7 @@ class LicensingService : Service() {

// Attempt to acquire license if app is free ("auto-purchase")
if (isLicensingPurchaseFreeAppsEnabled(this@LicensingService)) {
Log.d(TAG, "Attempting to acquire license for free app $packageName")
val firstAccount = accounts[0]
if (httpClient.acquireFreeAppLicense(
this@LicensingService,
Expand Down
Loading