Added HTC resources from Desire rom.

This commit is contained in:
Ryszard Wiśniewski 2010-04-28 20:47:45 +02:00
parent 9503976b59
commit e520d13d6b
2 changed files with 15 additions and 1 deletions

Binary file not shown.

View File

@ -44,6 +44,9 @@ final public class AndrolibResources {
if (! resTable.hasPackage(1)) { if (! resTable.hasPackage(1)) {
decodeArsc(resTable, new ExtFile(getAndroidResourcesFile()), false); decodeArsc(resTable, new ExtFile(getAndroidResourcesFile()), false);
} }
if (! resTable.hasPackage(2)) {
decodeArsc(resTable, new ExtFile(getHtcResourcesFile()), false);
}
return resTable; return resTable;
} }
@ -87,7 +90,7 @@ final public class AndrolibResources {
public void aaptPackage(File apkFile, File manifest, File resDir, public void aaptPackage(File apkFile, File manifest, File resDir,
File rawDir, File assetDir, boolean update, boolean framework) File rawDir, File assetDir, boolean update, boolean framework)
throws AndrolibException { throws AndrolibException {
String[] cmd = new String[14]; String[] cmd = new String[16];
int i = 0; int i = 0;
cmd[i++] = "aapt"; cmd[i++] = "aapt";
cmd[i++] = "p"; cmd[i++] = "p";
@ -103,6 +106,8 @@ final public class AndrolibResources {
} else { } else {
cmd[i++] = "-I"; cmd[i++] = "-I";
cmd[i++] = getAndroidResourcesFile().getAbsolutePath(); cmd[i++] = getAndroidResourcesFile().getAbsolutePath();
cmd[i++] = "-I";
cmd[i++] = getHtcResourcesFile().getAbsolutePath();
} }
cmd[i++] = "-S"; cmd[i++] = "-S";
cmd[i++] = resDir.getAbsolutePath(); cmd[i++] = resDir.getAbsolutePath();
@ -308,6 +313,15 @@ final public class AndrolibResources {
} }
} }
private File getHtcResourcesFile() throws AndrolibException {
try {
return Jar.getResourceAsFile(
"/brut/androlib/com.htc.resources.apk");
} catch (BrutException ex) {
throw new AndrolibException(ex);
}
}
public static String escapeForResXml(String value) { public static String escapeForResXml(String value) {
if (value.isEmpty()) { if (value.isEmpty()) {
return value; return value;