From 7a5223cda170580c35812286f9a9d3adbc9b9c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ryszard=20Wi=C5=9Bniewski?= Date: Wed, 24 Mar 2010 11:09:41 +0100 Subject: [PATCH] Androlib.buildPackage: deleting out.apk file before packaging. It fixes bug related to bs command not working. --- src/brut/androlib/Androlib.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/brut/androlib/Androlib.java b/src/brut/androlib/Androlib.java index 289128ee..450d3535 100644 --- a/src/brut/androlib/Androlib.java +++ b/src/brut/androlib/Androlib.java @@ -158,11 +158,16 @@ public class Androlib { } public void buildPackage() throws AndrolibException { - File distDir = new File("dist"); - if (! distDir.exists()) { - distDir.mkdirs(); + File outApk = new File("dist/out.apk"); + if (outApk.exists()) { + outApk.delete(); + } else { + File outDir = outApk.getParentFile(); + if (! outDir.exists()) { + outDir.mkdirs(); + } } - mAndRes.aaptPackage(new File("dist/out.apk"), null, null, + mAndRes.aaptPackage(outApk, null, null, new File("build/apk"), false); } }