Skip to content

Commit

Permalink
fix: permanent keystore path if available (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
aliernfrog authored Oct 9, 2022
1 parent f2b03b6 commit e46ad35
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/services/patcher_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class PatcherAPI {
MethodChannel('app.revanced.manager.flutter/patcher');
final ManagerAPI _managerAPI = locator<ManagerAPI>();
final RootAPI _rootAPI = RootAPI();
late Directory _dataDir;
late Directory _tmpDir;
late File _keyStoreFile;
List<Patch> _patches = [];
Expand All @@ -26,8 +27,9 @@ class PatcherAPI {
Future<void> initialize() async {
await _loadPatches();
Directory appCache = await getTemporaryDirectory();
_dataDir = await getExternalStorageDirectory() ?? appCache;
_tmpDir = Directory('${appCache.path}/patcher');
_keyStoreFile = File('${appCache.path}/revanced-manager.keystore');
_keyStoreFile = File('${_dataDir.path}/revanced-manager.keystore');
cleanPatcher();
}

Expand Down Expand Up @@ -163,6 +165,7 @@ class PatcherAPI {
integrationsFile = await _managerAPI.downloadIntegrations();
}
if (patchBundleFile != null) {
_dataDir.createSync();
_tmpDir.createSync();
Directory workDir = _tmpDir.createTempSync('tmp-');
File inputFile = File('${workDir.path}/base.apk');
Expand Down

0 comments on commit e46ad35

Please sign in to comment.