Skip to content

Commit

Permalink
fix: Copy APK to working directory before trying to write to it
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Mar 9, 2024
1 parent ca365ba commit 5cd1cba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/services/patcher_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ class PatcherAPI {
if (integrationsFile != null) {
_dataDir.createSync();
_tmpDir.createSync();
final Directory workDir = _tmpDir.createTempSync('tmp-');
final Directory workDir = await _tmpDir.createTemp('tmp-');

final File inApkFile = File('${workDir.path}/in.apk');
await File(apkFilePath).copy(inApkFile.path);

outFile = File('${workDir.path}/out.apk');

Expand All @@ -182,7 +185,7 @@ class PatcherAPI {
await patcherChannel.invokeMethod(
'runPatcher',
{
'inFilePath': apkFilePath,
'inFilePath': inApkFile.path,
'outFilePath': outFile!.path,
'integrationsPath': integrationsFile.path,
'selectedPatches': selectedPatches.map((p) => p.name).toList(),
Expand Down

0 comments on commit 5cd1cba

Please sign in to comment.