Tencent/matrix · error · TaskExecuteException

<e.getMessage()>

Error message

<e.getMessage()>

What it means

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.

Solutions

  1. Inspect the chained cause (getCause()) of the TaskExecuteException to find the real failure.
  2. Verify the APK opens with standard zip tools (unzip -t) and is not packed/encrypted in a way that breaks parsing.
  3. Re-run with a clean output directory and correct mapping files; retry with an unmodified release APK.

Example fix

// before
} catch (TaskExecuteException e) { log(e.getMessage()); }
// after
} catch (TaskExecuteException e) {
    e.printStackTrace(); // inspect e.getCause() for the real error
}
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-validate: APK must be a well-formed zip before analysis
java.util.zip.ZipFile zf = new java.util.zip.ZipFile(config.getApkPath());
zf.close();

Try / catch

try {
    task.call();
} catch (TaskExecuteException e) {
    Throwable cause = e.getCause();
    logger.error("UnzipTask failed: " + e.getMessage(), cause); // always inspect cause
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of Tencent/matrix@3b8293bd65 (2026-09-08). Data as JSON: /api/errors/b8bb1fbb9b7668f5. Report an issue: GitHub.

Appendix: source

Thrown at matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/UnzipTask.java:287

                outEntryName = writeEntry(zipFile, entry);
                if (!Util.isNullOrNil(outEntryName)) {
                    JsonObject fileItem = new JsonObject();
                    fileItem.addProperty("entry-name", outEntryName);
                    fileItem.addProperty("entry-size", entry.getCompressedSize());
                    jsonArray.add(fileItem);
                    entrySizeMap.put(outEntryName, Pair.of(entry.getSize(), entry.getCompressedSize()));
                    entryNameMap.put(entry.getName(), outEntryName);
                }
            }

            config.setEntrySizeMap(entrySizeMap);
            config.setEntryNameMap(entryNameMap);
            ((TaskJsonResult) taskResult).add("entries", jsonArray);
            taskResult.setStartTime(startTime);
            taskResult.setEndTime(System.currentTimeMillis());
            return taskResult;
        } catch (Exception e) {
            throw new TaskExecuteException(e.getMessage(), e);
        } finally {
            if (zipFile != null) {
                try {
                    zipFile.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

View on GitHub (pinned to 3b8293bd65)