From 62d981b364cdb71c0925924252f42423ec30d565 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Mon, 11 Jul 2022 08:17:59 +0200 Subject: [PATCH 1/2] Update gitignore to ignore .idea files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a1b9eab..09765c5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build/ user.gradle local.properties *.iml +.idea/* -- GitLab From 866133ccb58b5bfcf301c328ce24b6bd78dda9cd Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Fri, 8 Jul 2022 13:37:32 +0200 Subject: [PATCH 2/2] Implement minimal LicensingService Implemented ILicensingService & ILicenseResultListener interfaces with the minimal logic. For now, we always answer the listener that the license result is correct. --- fake-store/src/main/AndroidManifest.xml | 8 ++++++ .../licensing/ILicenseResultListener.aidl | 6 +++++ .../vending/licensing/ILicensingService.aidl | 8 ++++++ .../vending/licensing/LicensingService.kt | 27 +++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 fake-store/src/main/aidl/com/android/vending/licensing/ILicenseResultListener.aidl create mode 100644 fake-store/src/main/aidl/com/android/vending/licensing/ILicensingService.aidl create mode 100644 fake-store/src/main/java/com/android/vending/licensing/LicensingService.kt diff --git a/fake-store/src/main/AndroidManifest.xml b/fake-store/src/main/AndroidManifest.xml index 53e5f84..5cdd758 100644 --- a/fake-store/src/main/AndroidManifest.xml +++ b/fake-store/src/main/AndroidManifest.xml @@ -46,5 +46,13 @@ + + + + + + + diff --git a/fake-store/src/main/aidl/com/android/vending/licensing/ILicenseResultListener.aidl b/fake-store/src/main/aidl/com/android/vending/licensing/ILicenseResultListener.aidl new file mode 100644 index 0000000..b29424c --- /dev/null +++ b/fake-store/src/main/aidl/com/android/vending/licensing/ILicenseResultListener.aidl @@ -0,0 +1,6 @@ +package com.android.vending.licensing; + +interface ILicenseResultListener { + + void allow(int i); +} diff --git a/fake-store/src/main/aidl/com/android/vending/licensing/ILicensingService.aidl b/fake-store/src/main/aidl/com/android/vending/licensing/ILicensingService.aidl new file mode 100644 index 0000000..9d96b62 --- /dev/null +++ b/fake-store/src/main/aidl/com/android/vending/licensing/ILicensingService.aidl @@ -0,0 +1,8 @@ +package com.android.vending.licensing; + +import com.android.vending.licensing.ILicenseResultListener; + +interface ILicensingService { + + void checkLicense(long someLong, String someString, in ILicenseResultListener listener); +} \ No newline at end of file diff --git a/fake-store/src/main/java/com/android/vending/licensing/LicensingService.kt b/fake-store/src/main/java/com/android/vending/licensing/LicensingService.kt new file mode 100644 index 0000000..43edbfc --- /dev/null +++ b/fake-store/src/main/java/com/android/vending/licensing/LicensingService.kt @@ -0,0 +1,27 @@ +package com.android.vending.licensing + +import android.app.Service +import android.content.Intent +import android.os.IBinder + +class LicensingService : Service() { + + companion object { + const val LICENSED_OLD_KEY = 2 + } + + private val mServiceInterface = object : ILicensingService.Stub() { + override fun checkLicense( + someLong: Long, + someString: String, + listener: ILicenseResultListener + ) { + // Answer allow for each request + listener.allow(LICENSED_OLD_KEY) + } + } + + override fun onBind(intent: Intent): IBinder { + return mServiceInterface + } +} \ No newline at end of file -- GitLab