{"record":{"id":"cdff23941fcb3d18","repo":"MuntashirAkon/AppManager","slug":"apk-is-larger-than-650-mb","errorCode":null,"errorMessage":"APK is larger than 650 MB.","messagePattern":"APK is larger than 650 MB\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/scanner/vt/VirusTotal.java","lineNumber":134,"sourceCode":"            // Retry is not available\n            throw new FileNotFoundException(\"Fetch error: \" + responseReport.error);\n        }\n        // Scan or retry\n        VtError error = Objects.requireNonNull(responseReport.error);\n        boolean waitFirst = false;\n        if (\"NotFoundError\".equals(error.code)) {\n            // Initiate scan\n            if (!response.uploadFile()) {\n                // Scanning disabled\n                throw new FileNotFoundException(\"File not found in VirusTotal.\");\n            }\n            waitFirst = true;\n            PowerManager.WakeLock wakeLock = CpuUtils.getPartialWakeLock(\"vt_upload\");\n            wakeLock.acquire();\n            try {\n                long fileSize = file.length();\n                if (fileSize > 650_000_000) {\n                    throw new IOException(\"APK is larger than 650 MB.\");\n                }\n                boolean largeFile = fileSize > 32_000_000L;\n                response.onUploadInitiated();\n                String filename = file.getName();\n                ResponseV3<String> uploadResponse;\n                try (InputStream is = file.openInputStream()) {\n                    uploadResponse = largeFile\n                            ? uploadLargeFile(filename, is)\n                            : uploadFile(filename, is);\n                }\n                if (uploadResponse.response != null) {\n                    response.onUploadCompleted(getPermalink(checksum));\n                }\n            } finally {\n                CpuUtils.releaseWakeLock(wakeLock);\n            }\n        }\n        int waitDuration = 60_000;","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/scanner/vt/VirusTotal.java#L116-L152","documentation":"During the VT upload path, fetchFileReportOrScan checks the file size and throws IOException(\"APK is larger than 650 MB.\") when it exceeds 650,000,000 bytes, since VirusTotal rejects uploads above ~650 MB.","triggerScenarios":"Calling fetchFileReportOrScan on a file whose length() exceeds 650_000_000 bytes and which is not already present in VT (upload path taken).","commonSituations":"Scanning very large APKs/obb bundles/game archives; attempting VT analysis of oversized split-APK merges.","solutions":["Check file.length() <= 650_000_000 before invoking VT scanning and skip VT for larger files.","Scan a smaller subset (e.g. base APK or individual dex files) instead of the whole archive.","Catch IOException and surface a clear 'file too large for VirusTotal' message."],"exampleFix":"// before\nvt.fetchFileReportOrScan(largeApk); // throws for >650MB\n// after\nif (new File(path).length() > 650_000_000L) {\n    showNotice(\"File too large for VirusTotal; skipping.\");\n} else {\n    vt.fetchFileReportOrScan(file);\n}","handlingStrategy":"validation","validationCode":"if (file.length() > 650_000_000L) {\n    throw new IllegalArgumentException(\"File exceeds VirusTotal's 650 MB upload limit.\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    VtFileReport r = vt.fetchFileReportOrScan(file);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"650 MB\")) showNotice(\"File too large for VirusTotal.\");\n}","preventionTips":["Check file size against 650 MB before VT operations.","Scan individual dex/base APK files instead of oversized merged archives.","Display expected size limits in the scanner UI."],"tags":["upload","size-limit","virus-total"],"backgroundTag":"file-size-limit-exceeded","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}