{"record":{"id":"b8bb1fbb9b7668f5","repo":"Tencent/matrix","slug":"e-getmessage-b8bb1f","errorCode":null,"errorMessage":"<e.getMessage()>","messagePattern":"<e\\.getMessage\\(\\)>","errorType":"exception","errorClass":"TaskExecuteException","httpStatus":null,"severity":"error","filePath":"matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/UnzipTask.java","lineNumber":287,"sourceCode":"                outEntryName = writeEntry(zipFile, entry);\n                if (!Util.isNullOrNil(outEntryName)) {\n                    JsonObject fileItem = new JsonObject();\n                    fileItem.addProperty(\"entry-name\", outEntryName);\n                    fileItem.addProperty(\"entry-size\", entry.getCompressedSize());\n                    jsonArray.add(fileItem);\n                    entrySizeMap.put(outEntryName, Pair.of(entry.getSize(), entry.getCompressedSize()));\n                    entryNameMap.put(entry.getName(), outEntryName);\n                }\n            }\n\n            config.setEntrySizeMap(entrySizeMap);\n            config.setEntryNameMap(entryNameMap);\n            ((TaskJsonResult) taskResult).add(\"entries\", jsonArray);\n            taskResult.setStartTime(startTime);\n            taskResult.setEndTime(System.currentTimeMillis());\n            return taskResult;\n        } catch (Exception e) {\n            throw new TaskExecuteException(e.getMessage(), e);\n        } finally {\n            if (zipFile != null) {\n                try {\n                    zipFile.close();\n                } catch (IOException e) {\n                    e.printStackTrace();\n                }\n            }\n        }\n    }\n}\n","sourceCodeStart":269,"sourceCodeEnd":299,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/UnzipTask.java#L269-L299","documentation":"UnzipTask.call() wraps its entire unzip-and-analyze body in a catch-all that rethrows any Exception as TaskExecuteException(e.getMessage(), e). The message shown (<e.getMessage()>) is the underlying cause's message: corrupted APK/zip entries, XML parse failures, IO errors, or NullPointerExceptions during analysis all surface here.","triggerScenarios":"Any exception inside the unzip/parse loop: ZipFile open failure, bad/corrupt zip entries, AndrolibException from resource decoding, missing entries, or NPEs when expected data is absent.","commonSituations":"Analyzing a corrupted or specially obfuscated APK; APK encrypted/packed by a packer that breaks standard zip layout; mismatched mapping file causing NPE in analysis; disk full during extraction.","solutions":["Inspect the chained cause (getCause()) of the TaskExecuteException to find the real failure.","Verify the APK opens with standard zip tools (unzip -t) and is not packed/encrypted in a way that breaks parsing.","Re-run with a clean output directory and correct mapping files; retry with an unmodified release APK."],"exampleFix":"// before\n} catch (TaskExecuteException e) { log(e.getMessage()); }\n// after\n} catch (TaskExecuteException e) {\n    e.printStackTrace(); // inspect e.getCause() for the real error\n}","handlingStrategy":"try-catch","validationCode":"// pre-validate: APK must be a well-formed zip before analysis\njava.util.zip.ZipFile zf = new java.util.zip.ZipFile(config.getApkPath());\nzf.close();","typeGuard":null,"tryCatchPattern":"try {\n    task.call();\n} catch (TaskExecuteException e) {\n    Throwable cause = e.getCause();\n    logger.error(\"UnzipTask failed: \" + e.getMessage(), cause); // always inspect cause\n}","preventionTips":["Sanity-check the APK with `unzip -t` before analysis.","Use a clean output directory each run to avoid stale-state NPEs.","Keep the checker updated for APKs produced by newer AGP/obfuscation tools."],"tags":["apk-canary","wrapped-exception","zip-parsing"],"backgroundTag":"internal-invariant-violation","analyzedSha":"3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7","analyzedAt":"2026-09-08T08:01:39.722Z","contentChangedAt":"2026-09-08T08:01:39.722Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}