Hello Amazon Devs
I’m creating an Amazon DRM extension for GameMaker:Studio and eventually IAPs and other features.
The problem at the moment it’s that when I got into debug mode after call:
adb shell setprop debug.amazon.sandboxmode debug
I stop getting callbacks, just never got triggered
but if I close the app and call:
adb shell setprop debug.amazon.sandboxmode noone
Open the app I got the callbacks again… any idea?
more information:
First I called:
adb kill-server
adb start-server
adb devices
This is the code that I’m using:
public void amazon_verify_license()
{
	Log.i("yoyo","amazon_verify_license");
	try{
		
		RunnerActivity.ViewHandler.post(new Runnable() {
			public void run() {
				Toast.makeText(activity, "amazon_verify_license!", Toast.LENGTH_LONG).show();
			}
		});
		
		LicensingService.verifyLicense(activity, this);
		
		RunnerActivity.ViewHandler.post(new Runnable() {
			public void run() {
				Toast.makeText(activity, "amazon_verify_license POST!", Toast.LENGTH_LONG).show();
			}
		});
		
		
	int dsMapIndex = RunnerJNILib.jCreateDsMap(null, null, null);
	RunnerJNILib.DsMapAddString(dsMapIndex, "type", "TEST");
	RunnerJNILib.CreateAsynEventWithDSMap(dsMapIndex, EVENT_OTHER_SOCIAL);
		
	}catch(Exception e)
	{
		RunnerActivity.ViewHandler.post(new Runnable() {
			public void run() {
				Toast.makeText(activity, e.getMessage(), Toast.LENGTH_LONG).show();
			}
		});
	}
}
///////////////////////////////LicensingListener
@Override
public void onLicenseCommandResponse(LicenseResponse licenseResponse) {
	
	Log.i("yoyo", "onLicenseCommandResponse");
	
	final RequestStatus status = licenseResponse.■■■■■■■■■■■■■■■■();
	
	int dsMapIndex = RunnerJNILib.jCreateDsMap(null, null, null);
	RunnerJNILib.DsMapAddString(dsMapIndex, "type", "amazon_verify_license");
	Log.i("yoyo", "onLicenseCommandResponse: RequestStatus (" + status + ")");
    switch (status) {
        case LICENSED:
            Log.i("yoyo", "LicenseResponse status: " + status);
			RunnerJNILib.DsMapAddString(dsMapIndex, "status", "LICENSED");
            break;
        case NOT_LICENSED:
            Log.i("yoyo", "LicenseResponse status: " + status);
			RunnerJNILib.DsMapAddString(dsMapIndex, "status", "NOT_LICENSED");
        case EXPIRED:
            Log.i("yoyo", "LicenseResponse status: " + status);
            break;
        case ERROR_VERIFICATION:
            Log.i("yoyo", "LicenseResponse status: " + status);
			RunnerJNILib.DsMapAddString(dsMapIndex, "status", "ERROR_VERIFICATION");
        case ERROR_INVALID_LICENSING_KEYS:
            Log.i("yoyo", "LicenseResponse status: " + status);
			RunnerJNILib.DsMapAddString(dsMapIndex, "status", "ERROR_INVALID_LICENSING_KEYS");
			break;
		// case EXPIRED:
			// RunnerJNILib.DsMapAddString(dsMapIndex, "status", "EXPIRED");
			// break;
        case UNKNOWN_ERROR:
            Log.i("yoyo", "LicenseResponse status: " + status);
			RunnerJNILib.DsMapAddString(dsMapIndex, "status", "UNKNOWN_ERROR");
			break;
		default:
			RunnerJNILib.DsMapAddString(dsMapIndex, "status", "OTHER");
			break;
    }
	
	RunnerJNILib.CreateAsynEventWithDSMap(dsMapIndex, EVENT_OTHER_SOCIAL);
}
I added this implementation:
implementation ‘com.amazon.device:amazon-appstore-sdk:3.+’
and this receiver:
<receiver android:name = "com.amazon.device.drm.ResponseReceiver" android:exported="true" 
          android:permission = "com.amazon.drm.Permission.NOTIFY" >
    <intent-filter>
        <action android:name = "com.amazon.drm.NOTIFY" />
    </intent-filter>
</receiver>
I’m using The Amazon HD 7, I tested the SamleDRMApp project and it’s working correctly (even I can change the response), app tester it’s installed, AppstoreAuthenticationKey.pem and amazon.sdktester.json in place where should be.
Any idea?
Hope someone can help me
I can bring any additional information.
Regards


