From ca623f661777d6f5576cdfb97919cfa8dbc61302 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Sat, 22 Sep 2012 22:40:33 -0500 Subject: [PATCH] fixes #37 reverts public.xml change --- .../org/jf/util/ClassFileNameHandler.java | 2 +- .../brut/androlib/res/AndrolibResources.java | 52 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/brut.apktool.smali/util/src/main/java/org/jf/util/ClassFileNameHandler.java b/brut.apktool.smali/util/src/main/java/org/jf/util/ClassFileNameHandler.java index ba42e03a..8405715a 100644 --- a/brut.apktool.smali/util/src/main/java/org/jf/util/ClassFileNameHandler.java +++ b/brut.apktool.smali/util/src/main/java/org/jf/util/ClassFileNameHandler.java @@ -114,7 +114,7 @@ public class ClassFileNameHandler { try { FileWriter writer = new FileWriter(f); - writer.write("test"); + //writer.write("test"); writer.flush(); writer.close(); f.delete(); //doesn't throw IOException diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java index fc2a6bc2..3a0983c8 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java @@ -356,32 +356,32 @@ final public class AndrolibResources { private void generatePublicXml(ResPackage pkg, Directory out, XmlSerializer serial) throws AndrolibException { -// try { -// OutputStream outStream = out.getFileOutput("values/public.xml"); -// serial.setOutput(outStream, null); -// serial.startDocument(null, null); -// serial.startTag(null, "resources"); -// -// for (ResResSpec spec : pkg.listResSpecs()) { -// serial.startTag(null, "public"); -// serial.attribute(null, "type", spec.getType().getName()); -// serial.attribute(null, "name", spec.getName()); -// serial.attribute(null, "id", String.format( -// "0x%08x", spec.getId().id)); -// serial.endTag(null, "public"); -// } -// -// serial.endTag(null, "resources"); -// serial.endDocument(); -// serial.flush(); -// outStream.close(); -// } catch (IOException ex) { -// throw new AndrolibException( -// "Could not generate public.xml file", ex); -// } catch (DirectoryException ex) { -// throw new AndrolibException( -// "Could not generate public.xml file", ex); -// } + try { + OutputStream outStream = out.getFileOutput("values/public.xml"); + serial.setOutput(outStream, null); + serial.startDocument(null, null); + serial.startTag(null, "resources"); + + for (ResResSpec spec : pkg.listResSpecs()) { + serial.startTag(null, "public"); + serial.attribute(null, "type", spec.getType().getName()); + serial.attribute(null, "name", spec.getName()); + serial.attribute(null, "id", String.format( + "0x%08x", spec.getId().id)); + serial.endTag(null, "public"); + } + + serial.endTag(null, "resources"); + serial.endDocument(); + serial.flush(); + outStream.close(); + } catch (IOException ex) { + throw new AndrolibException( + "Could not generate public.xml file", ex); + } catch (DirectoryException ex) { + throw new AndrolibException( + "Could not generate public.xml file", ex); + } } private ResPackage[] getResPackagesFromApk(ExtFile apkFile,