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(
|
Future<void> runPatcher(
|
||||||
String packageName,
|
String packageName,
|
||||||
String apkFilePath,
|
String apkFilePath,
|
||||||
@ -191,10 +177,7 @@ class PatcherAPI {
|
|||||||
_outFile = File('${workDir.path}/out.apk');
|
_outFile = File('${workDir.path}/out.apk');
|
||||||
final Directory cacheDir = Directory('${workDir.path}/cache');
|
final Directory cacheDir = Directory('${workDir.path}/cache');
|
||||||
cacheDir.createSync();
|
cacheDir.createSync();
|
||||||
String originalFilePath = await getOriginalFilePath(packageName);
|
final String originalFilePath = apkFilePath;
|
||||||
if (originalFilePath.isEmpty) {
|
|
||||||
originalFilePath = apkFilePath;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
await patcherChannel.invokeMethod(
|
await patcherChannel.invokeMethod(
|
||||||
'runPatcher',
|
'runPatcher',
|
||||||
|
@ -209,20 +209,6 @@ class RootAPI {
|
|||||||
return res != null && res.isNotEmpty;
|
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(
|
Future<void> saveOriginalFilePath(
|
||||||
String packageName,
|
String packageName,
|
||||||
String originalFilePath,
|
String originalFilePath,
|
||||||
|
Loading…
Reference in New Issue
Block a user