AndrolibResources.aaptPackage(): added possibility to package framework resources.

This commit is contained in:
Ryszard Wiśniewski 2010-04-01 17:37:23 +02:00
parent 79a1b564e7
commit 5a6e684f80
2 changed files with 12 additions and 10 deletions

View File

@ -213,7 +213,8 @@ public class Androlib {
mAndRes.aaptPackage(
apkFile,
new File(appDir, "AndroidManifest.xml"),
new File(appDir, "res"), ninePatch, null, false
new File(appDir, "res"), ninePatch, null, false,
false
);
new ExtFile(apkFile).getDirectory()
@ -261,7 +262,7 @@ public class Androlib {
assetDir = null;
}
mAndRes.aaptPackage(outApk, null, null,
new File(appDir, APK_DIRNAME), assetDir, false);
new File(appDir, APK_DIRNAME), assetDir, false, false);
}
private boolean isModified(File working, File stored) {

View File

@ -80,13 +80,8 @@ final public class AndrolibResources {
}
}
public void aaptPackage(File apkFile, File manifest, File resDir)
throws AndrolibException {
aaptPackage(apkFile, manifest, resDir, null, null, false);
}
public void aaptPackage(File apkFile, File manifest, File resDir,
File rawDir, File assetDir, boolean update)
File rawDir, File assetDir, boolean update, boolean framework)
throws AndrolibException {
String[] cmd = new String[13];
int i = 0;
@ -97,8 +92,14 @@ final public class AndrolibResources {
}
cmd[i++] = "-F";
cmd[i++] = apkFile.getAbsolutePath();
cmd[i++] = "-I";
cmd[i++] = getAndroidResourcesFile().getAbsolutePath();
if (framework) {
cmd[i++] = "-x";
} else {
cmd[i++] = "-I";
cmd[i++] = getAndroidResourcesFile().getAbsolutePath();
}
if (manifest != null) {
cmd[i++] = "-M";
cmd[i++] = manifest.getAbsolutePath();