#1186 Performance: usage of String.format in ARSCDecoder.addMissingResSpecs

Reduces the time it takes to parse the Android framework by ~50%.

The synthesized name now has no leading zeroes, but this doesn't appear to matter since the numeric part of the name isn't used anywhere.
This commit is contained in:
Dave Nault 2016-03-07 11:33:07 -08:00
parent 5c7702396d
commit 2f1326c6ca

View File

@ -435,7 +435,7 @@ public class ARSCDecoder {
continue;
}
ResResSpec spec = new ResResSpec(new ResID(resId | i), String.format("APKTOOL_DUMMY_%04x", i), mPkg, mTypeSpec);
ResResSpec spec = new ResResSpec(new ResID(resId | i), "APKTOOL_DUMMY_" + Integer.toHexString(i), mPkg, mTypeSpec);
// If we already have this resID dont add it again.
if (! mPkg.hasResSpec(new ResID(resId | i))) {