What are the response codes (values) returned by the Google Play server in response to a license?

I want to serve LICENSE_OLD_KEY in my Android license policy. I was going to change ServerManagedPolicy, since it is not suitable for this, as far as I can tell, it is just looking for a method Policy.LICENSEDor Policy.NOT_LICENSEDin processServerResponse:

public void processServerResponse(int response, ResponseData rawData) {

    // Update retry counter
    if (response != Policy.RETRY) {
        setRetryCount(0);
    } else {
        setRetryCount(mRetryCount + 1);
    }

    if (response == Policy.LICENSED) {
        // Update server policy data
        Map<String, String> extras = decodeExtras(rawData.extra);
        mLastResponse = response;
        setValidityTimestamp(extras.get("VT"));
        setRetryUntil(extras.get("GT"));
        setMaxRetries(extras.get("GR"));
    } else if (response == Policy.NOT_LICENSED) {
        // Clear out stale policy data
        setValidityTimestamp(DEFAULT_VALIDITY_TIMESTAMP);
        setRetryUntil(DEFAULT_RETRY_UNTIL);
        setMaxRetries(DEFAULT_MAX_RETRIES);
    }

    setLastResponse(response);
    mPreferences.commit();
}

I would like to know what is the response code for LICENSE_OLD_KEY, because this does not exist in the policy:

public static final int LICENSED = 0x0100;
public static final int NOT_LICENSED = 0x0231;
public static final int RETRY = 0x0123;

I looked here , but I can not find anywhere where the name and values ​​are listed.

I see that there is a list of server response codes in LicenseValidator, but they do not correspond to those specified in the policy:

    // Server response codes.
private static final int LICENSED = 0x0;
private static final int NOT_LICENSED = 0x1;
private static final int LICENSED_OLD_KEY = 0x2;
private static final int ERROR_NOT_MARKET_MANAGED = 0x3;
private static final int ERROR_SERVER_FAILURE = 0x4;
private static final int ERROR_OVER_QUOTA = 0x5;

private static final int ERROR_CONTACTING_SERVER = 0x101;
private static final int ERROR_INVALID_PACKAGE_NAME = 0x102;
private static final int ERROR_NON_MATCHING_UID = 0x103;
+5
source share
2 answers

, , Google Play , AlertDialog. :

LICENSED 256, Policy.LICENSED.

NOT_LICENSED 561, Policy.NOT_LICENSED.

, LICENSED_OLD_KEY 256, Policy.LICENSED.

, , LICENSED_OLD_KEY , , , LICENSED_OLD_KEY. , , Google .

, , , !

+5

, , . , LICENSED_OLD_KEY. . , , . LICENSED_OLD_KEY .

, LICENSED_OLD_KEY " ", - LicenseValidator.java, "OLD_KEY" , Google Play.

0

All Articles