Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo committed Nov 20, 2020
1 parent 1377ca2 commit 4c332d3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools-local/tasks/mobile.tasks/AndroidAppBuilder/ApkBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,15 @@ public void ReplaceFileInApk(string file)
string aapt = Path.Combine(buildToolsFolder, "aapt");
string apksigner = Path.Combine(buildToolsFolder, "apksigner");

string apkPath = Directory.GetFiles(Path.Combine(OutputDir, "bin"), "*.apk").First();
string apkPath = "";
if (string.IsNullOrEmpty(ProjectName))
apkPath = Directory.GetFiles(Path.Combine(OutputDir, "bin"), "*.apk").First();
else
apkPath = Path.Combine(OutputDir, "bin", $"{apkPath}.apk");

if (!File.Exists(apkPath))
throw new Exception($"{apkPath} was not found");

Utils.RunProcess(aapt, $"remove -v bin/{Path.GetFileName(apkPath)} {file}", workingDir: OutputDir);
Utils.RunProcess(aapt, $"add -v bin/{Path.GetFileName(apkPath)} {file}", workingDir: OutputDir);

Expand Down

0 comments on commit 4c332d3

Please sign in to comment.