From 2f1326c6cab6f82f43800c4068efd9a28fca5403 Mon Sep 17 00:00:00 2001 From: Dave Nault Date: Mon, 7 Mar 2016 11:33:07 -0800 Subject: [PATCH] #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. --- .../src/main/java/brut/androlib/res/decoder/ARSCDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java index dea33ff4..509deeb1 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java @@ -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))) {