microg/GmsCore · error · StandardIntegrityException

Server-specified exception

Error message

Server-specified exception

What it means

warmUpIntegrityToken throws StandardIntegrityException with the message 'Server-specified exception' when the intermediate integrity server response reports a WARMUP test error. The server-provided errorCode from the warmup response is wrapped into a StandardIntegrityException and rethrown to the caller. It signals the integrity token warmup failed on the server side.

Source

Thrown at vending-app/src/main/kotlin/com/google/android/finsky/expressintegrityservice/ExpressIntegrityService.kt:213

                    if (expressIntegritySession.webViewRequestMode != 0) {
                        requestMode(RequestMode.Builder().mode(expressIntegritySession.webViewRequestMode.takeIf { it in 0..2 } ?: 0).build())
                    }
                }.build()

                Log.d(TAG, "intermediateIntegrityRequest: $intermediateIntegrityRequest")

                val intermediateIntegrityResponse = requestIntermediateIntegrity(context, authToken, intermediateIntegrityRequest).intermediateIntegrityResponseWrapper?.intermediateIntegrityResponse
                    ?: IntermediateIntegrityResponse()

                Log.d(TAG, "requestIntermediateIntegrity response: ${intermediateIntegrityResponse.encode().encodeBase64(true)}")

                val errorCode = intermediateIntegrityResponse.errorInfo?.let { error ->
                    if (error.errorCode == null) {
                        null
                    } else if (error.testErrorType == TestErrorType.REQUEST_EXPRESS) {
                        error.errorCode
                    } else if (error.testErrorType == TestErrorType.WARMUP) {
                        throw StandardIntegrityException(error.errorCode, "Server-specified exception")
                    } else null
                }

                val defaultAccountName: String = runCatching {
                    if (expressIntegritySession.webViewRequestMode != 0) {
                        RESULT_UN_AUTH
                    } else {
                        AccountManager.get(context).getAccountsByType(DEFAULT_ACCOUNT_TYPE).firstOrNull()?.name ?: RESULT_UN_AUTH
                    }
                }.getOrDefault(RESULT_UN_AUTH)

                val callerKeyMd5 = clientKey.encode().md5() ?: throw StandardIntegrityException("Null callerKeyMd5")
                val refreshClientKey = clientKey.newBuilder()
                    .generated(makeTimestamp(System.currentTimeMillis()))
                    .build()
                val fixedAdvice = IntegrityAdvice.Builder()
                    .advices(intermediateIntegrityResponse.integrityAdvice?.advices.ensureContainsLockBootloader())
                    .build()

View on GitHub (pinned to 157c9d86ac)

Solutions

  1. Check the StandardIntegrityException errorCode to identify the server-reported cause and address it per Play Integrity error docs
  2. Verify the device has Play Protect certification and Google Play services is up to date
  3. Retry warmup after confirming network connectivity and device integrity
  4. If triggered by test error injection (TestErrorType.WARMUP), remove the test configuration on the server

Example fix

// before
throw StandardIntegrityException(error.errorCode, "Server-specified exception")
// after
try {
    integrityManager.requestIntegrityToken(request)
} catch (e: StandardIntegrityException) {
    Log.w(TAG, "warmup failed: ${e.errorCode}") // inspect errorCode before retrying
}
Defensive patterns

Strategy: try-catch

Validate before calling

// No pre-call check: server decides. Ensure device is Play Protect certified first.
val certified = GooglePlayServicesUtil.isGooglePlayServicesAvailable(context) == ConnectionResult.SUCCESS

Try / catch

try {
    warmUpIntegrityToken()
} catch (e: StandardIntegrityException) {
    Log.w(TAG, "warmup server error: ${e.errorCode}")
    // schedule retry with backoff
}

Prevention

When it happens

Trigger: Calling warmUpIntegrityToken while the intermediateIntegrityResponse carries errorInfo with a non-null errorCode and testErrorType == TestErrorType.WARMUP.

Common situations: Server-side test/error injection for warmup requests; backend flags the device or session as failing warmup attestation; Play services returns an error code for the warmup token request.

Related errors


AI-assisted analysis of microg/GmsCore@157c9d86ac (2026-09-06). Data as JSON: /api/errors/8f49012563505c74. Report an issue: GitHub.