mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: original.apk
not found despite existing (#1052)
This commit is contained in:
parent
096b315701
commit
64744b2abf
@ -144,20 +144,6 @@ class PatcherAPI {
|
||||
);
|
||||
}
|
||||
|
||||
Future<String> getOriginalFilePath(String packageName) async {
|
||||
try {
|
||||
final bool hasRootPermissions = await _rootAPI.hasRootPermissions();
|
||||
if (hasRootPermissions) {
|
||||
return await _rootAPI.getOriginalFilePath(packageName);
|
||||
}
|
||||
} on Exception catch (e) {
|
||||
if (kDebugMode) {
|
||||
print(e);
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
Future<void> runPatcher(
|
||||
String packageName,
|
||||
String apkFilePath,
|
||||
@ -191,10 +177,7 @@ class PatcherAPI {
|
||||
_outFile = File('${workDir.path}/out.apk');
|
||||
final Directory cacheDir = Directory('${workDir.path}/cache');
|
||||
cacheDir.createSync();
|
||||
String originalFilePath = await getOriginalFilePath(packageName);
|
||||
if (originalFilePath.isEmpty) {
|
||||
originalFilePath = apkFilePath;
|
||||
}
|
||||
final String originalFilePath = apkFilePath;
|
||||
try {
|
||||
await patcherChannel.invokeMethod(
|
||||
'runPatcher',
|
||||
|
@ -209,20 +209,6 @@ class RootAPI {
|
||||
return res != null && res.isNotEmpty;
|
||||
}
|
||||
|
||||
Future<String> getOriginalFilePath(String packageName) async {
|
||||
final String originalPath = '$_revancedDirPath/$packageName/original.apk';
|
||||
final String oldOrigPath = '$_revancedOldDirPath/$packageName/original.apk';
|
||||
final bool isInstalled = await isAppInstalled(packageName);
|
||||
if (isInstalled && await isMounted(packageName)) {
|
||||
if (await fileExists(originalPath)) {
|
||||
return originalPath;
|
||||
} else if (await fileExists(oldOrigPath)) {
|
||||
return oldOrigPath;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
Future<void> saveOriginalFilePath(
|
||||
String packageName,
|
||||
String originalFilePath,
|
||||
|
Loading…
Reference in New Issue
Block a user