{"record":{"id":"27507097521cddd3","repo":"MuntashirAkon/AppManager","slug":"could-not-read-the-prop-file","errorCode":null,"errorMessage":"Could not read the prop file","messagePattern":"Could not read the prop file","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/TBConverter.java","lineNumber":425,"sourceCode":"            }\n            try {\n                mFilesToBeDeleted.add(getApkFile(metadataV2.apkName, metadataV2.tarType));\n                // No error = APK file exists\n                metadataV2.flags.addFlag(BackupFlags.BACKUP_APK_FILES);\n            } catch (FileNotFoundException ignore) {\n            }\n            metadataV2.dataDirs = ConvertUtils.getDataDirs(mPackageName, mUserId, metadataV2.flags\n                    .backupInternalData(), metadataV2.flags.backupExternalData(), false);\n            metadataV2.keyStore = false;\n            metadataV2.installer = Prefs.Installer.getInstallerPackageName();\n            String base64Icon = prop.getProperty(\"app_gui_icon\");\n            if (base64Icon != null) {\n                byte[] decodedBytes = Base64.decode(base64Icon, 0);\n                mIcon = BitmapFactory.decodeByteArray(decodedBytes, 0, decodedBytes.length);\n            }\n            return metadataV2;\n        } catch (IOException e) {\n            throw new BackupException(\"Could not read the prop file\", e);\n        }\n    }\n\n    @NonNull\n    private Path getDataFile(String filePrefix, @TarUtils.TarType String tarType) throws FileNotFoundException {\n        String filename = filePrefix + \".tar\";\n        if (TAR_BZIP2.equals(tarType)) filename += \".bz2\";\n        else if (TAR_ZSTD.equals(tarType)) filename += \".zst\";\n        else filename += \".gz\";\n        return mBackupLocation.findFile(filename);\n    }\n\n    @NonNull\n    private Path getApkFile(String apkName, @TarUtils.TarType String tarType) throws FileNotFoundException {\n        if (TAR_BZIP2.equals(tarType)) apkName += \".bz2\";\n        else if (TAR_ZSTD.equals(tarType)) apkName += \".zst\";\n        else apkName += \".gz\";\n        return mBackupLocation.findFile(apkName);","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/TBConverter.java#L407-L443","documentation":"readPropFile() opens the prop file via mPropFile.openInputStream() and reads its properties; any IOException during reading or parsing is rethrown as BackupException(\"Could not read the prop file\", e). It signals the backup's metadata file is unreadable, so conversion cannot discover app name, version, flags, or codec.","triggerScenarios":"Calling convert() on a backup where the .prop file cannot be opened or read: missing file, permission denied, I/O error on the storage device, or a stream failure mid-read (e.g. after icon Base64 decoding).","commonSituations":"Pointing the converter at a directory without its prop file; SD card unmounted or corrupted; files copied over MTP losing metadata; restrictive file permissions after restore from another device.","solutions":["Confirm the .prop file exists next to the tar data file and the path passed to TBConverter points to it.","Check file permissions and storage state (mounted, readable) for the backup directory.","Re-copy the backup set completely (prop + tar + icons) from the source device.","Inspect e.getCause() to distinguish missing-file from mid-read I/O errors."],"exampleFix":"// before\nconverter.convert(new File(\"/backup/app\"));\n// after\nFile prop = new File(\"/backup/app\", \"app.prop\");\nif (!prop.canRead()) {\n    throw new IllegalStateException(\"Prop file missing/unreadable: \" + prop);\n}\nconverter.convert(new File(\"/backup/app\"));","handlingStrategy":"validation","validationCode":"File prop = new File(backupDir, backupDir.getName() + \".prop\");\nif (!prop.isFile() || !prop.canRead())\n    throw new IllegalStateException(\"Prop file missing or unreadable: \" + prop);","typeGuard":null,"tryCatchPattern":"try {\n    converter.convert(backupDir);\n} catch (BackupException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Could not read the prop file\")) {\n        Log.e(TAG, \"Unreadable prop\", e.getCause()); // check permissions/media state\n    } else throw e;\n}","preventionTips":["Check external storage is mounted and readable before batch conversions.","Copy backups with adb pull or tar rather than MTP to avoid silent metadata loss.","Fix file ownership/permissions after restoring backups between devices."],"tags":["android","backup","file-read","prop-file"],"backgroundTag":"file-read-failed","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}