{"record":{"id":"53f5625397d3bc21","repo":"Tencent/tinker","slug":"binder-transaction-failure","errorCode":null,"errorMessage":"Binder transaction failure.","messagePattern":"Binder transaction failure\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"tinker-android/tinker-android-loader/src/main/java/com/tencent/tinker/loader/TinkerDexOptimizer.java","lineNumber":399,"sourceCode":"                sPerformDexOptSecondaryTransactionCode[0]);\n\n        final IBinder pmsBinder = getPMSBinderProxy(context);\n        Parcel data = null;\n        Parcel reply = null;\n        try {\n            data = Parcel.obtain();\n            reply = Parcel.obtain();\n            boolean result;\n            try {\n                data.writeInterfaceToken(pmsBinder.getInterfaceDescriptor());\n                data.writeString(context.getPackageName());\n                final String compileFilter = ShareTinkerInternals.isNewerOrEqualThanVersion(31 /* Android S */, true)\n                        ? \"verify\" : \"speed-profile\";\n                data.writeString(compileFilter);\n                data.writeInt(1); // force\n                boolean status = pmsBinder.transact(sPerformDexOptSecondaryTransactionCode[0], data, reply, 0);\n                if (!status) {\n                    throw new IllegalStateException(\"Binder transaction failure.\");\n                }\n            } catch (RemoteException e) {\n                throw new IllegalStateException(e);\n            }\n            try {\n                reply.readException();\n            } catch (Throwable thr) {\n                throw new IllegalStateException(thr);\n            }\n            result = (0 != reply.readInt());\n            if (!result) {\n                ShareTinkerLog.w(TAG, \"[!] System API return false.\");\n            }\n        } finally {\n            if (reply != null) {\n                reply.recycle();\n            }\n            if (data != null) {","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/Tencent/tinker/blob/1b7ea02c239840f563ea64fb5bd286eb98d4011e/tinker-android/tinker-android-loader/src/main/java/com/tencent/tinker/loader/TinkerDexOptimizer.java#L381-L417","documentation":"After resolving the transaction code, Tinker hand-crafts the binder parcel for performDexOptSecondary and calls IBinder.transact on the PMS binder proxy. transact returning false means the binder driver/framework refused the transaction, so the dexopt request was never delivered to PackageManagerService.","triggerScenarios":"pmsBinder.transact(...) returning false because the transaction code is stale for the running framework (e.g. code resolved on a different API shape), the binder died, or an OEM PMS rejects unknown transactions. Distinct from RemoteException, which is caught separately and wrapped.","commonSituations":"Mismatched transaction code after an OS upgrade (code cached from a prior boot class); OEM ROMs with a different IPackageManager parcel layout; the dexopt call racing with PMS restart.","solutions":["Update Tinker — newer versions re-check the transaction code and add fallbacks.","Enable interpret mode to bypass the binder dexopt path entirely.","Catch the IllegalStateException during patch load and degrade to interpretation instead of failing the patch."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    pmsBinder.transact(code, data, reply, 0);\n} catch (IllegalStateException e) {\n    // transact refused: fall back to interpret-only compilation\n    compileInterpretOnly(dexFile);\n}","preventionTips":["Prefer interpret mode over binder-level dexopt on customized ROMs.","Recompute the transaction code per process run; never cache across OS updates.","Wrap patch load so a dexopt transport failure degrades instead of aborting."],"tags":["android","binder","dexopt","ipackagemanager","tinker"],"backgroundTag":null,"analyzedSha":"1b7ea02c239840f563ea64fb5bd286eb98d4011e","analyzedAt":"2026-08-14T15:16:52.110Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}