{"record":{"id":"ec5735fbfdd69e8e","repo":"MuntashirAkon/AppManager","slug":"ioexception-remoteexception","errorCode":null,"errorMessage":"IOException|RemoteException","messagePattern":"IOException\\|RemoteException","errorType":"exception","errorClass":"ApkFileException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/apk/ApkFile.java","lineNumber":251,"sourceCode":"                    // FIXME(#227): Give it a special name and verify integrity\n                    extension = \"apks\";\n                }\n            } catch (IOException | SecurityException e) {\n                throw new ApkFileException(e);\n            }\n        }\n        // Cache the file or use file descriptor for non-APKM files\n        if (extension.equals(\"apkm\")) {\n            // Convert to APKS\n            try {\n                mCacheFilePath = mFileCache.createCachedFile(\"apks\");\n                try (ParcelFileDescriptor inputFD = FileUtils.getFdFromUri(context, apkUri, \"r\");\n                     OutputStream outputStream = new FileOutputStream(mCacheFilePath)) {\n                    UnApkm unApkm = new UnApkm(context, UN_APKM_PKG);\n                    unApkm.decryptFile(inputFD, outputStream);\n                }\n            } catch (IOException | RemoteException e) {\n                throw new ApkFileException(e);\n            }\n        } else {\n            // Open file descriptor if necessary\n            File cacheFilePath = null;\n            if (ContentResolver.SCHEME_FILE.equals(apkUri.getScheme())) {\n                // File scheme may not require an FD\n                cacheFilePath = new File(apkUri.getPath());\n            }\n            if (!FmProvider.AUTHORITY.equals(apkUri.getAuthority())) {\n                // Content scheme has a third-party authority\n                try {\n                    mFd = FileUtils.getFdFromUri(context, apkUri, \"r\");\n                    cacheFilePath = FileUtils.getFileFromFd(mFd);\n                } catch (FileNotFoundException e) {\n                    throw new ApkFileException(e);\n                } catch (SecurityException e) {\n                    Log.e(TAG, e);\n                }","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/apk/ApkFile.java#L233-L269","documentation":"For a genuine (DRM-protected) APKM, ApkFile streams the URI into an .apks cache file and runs unApkm.decryptFile; an IOException (read/write failure on stream or cache) or RemoteException (the bundled decryption provider/service died or was unbound) aborts the conversion, wrapped as ApkFileException. Faulty input: the APKM stream or the decryption service binding.","triggerScenarios":"Thrown at app/src/main/java/io/github/muntashirakon/AppManager/apk/ApkFile.java:251 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure enough free cache space and retry the conversion","Verify the unApkm decryption provider is available and not killed by battery optimizations","Handle DRM-protected APKM by asking the user to obtain a DRM-free copy"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}