diff --git a/.gitignore b/.gitignore index a1b9eab7e8f3c6b9f0cad9af7d788b00157d0650..09765c58956da6823088d06095759f0d475a2d0e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build/ user.gradle local.properties *.iml +.idea/* diff --git a/fake-store/src/main/AndroidManifest.xml b/fake-store/src/main/AndroidManifest.xml index 53e5f84df7a75e9e87dea391dc9f6985de252370..5cdd75812e1b796d7d59688bb6f05801b61aed47 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 0000000000000000000000000000000000000000..b29424c40bfa724f3bcf5b84d0c60a4f91e39718 --- /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 0000000000000000000000000000000000000000..9d96b622d1658ad697b0f5c07b23534686196b52 --- /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 0000000000000000000000000000000000000000..43edbfc9b523d17aaa47dfccf5b623515924ec76 --- /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