[Soot-list] Regenerating Androidmanifest.xml file after Instrumenting Android

Modhi Alsobiehy m99m20 at hotmail.com
Sun Oct 12 18:41:30 EDT 2014


Your quick response is highly appreciated!

-Thank you!
Modhi

> On Oct 9, 2014, at 12:34 AM, "Modhi Alsobiehy" <m99m20 at hotmail.com> wrote:
> 
> Hi Steven,
> I'm getting the following exception from the line calling toByteArray() and I couldn’t figure out how to fix it or what I have done wrong!!
> Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
> 
> at pxb.android.axml.AxmlWriter$NodeImpl.write(AxmlWriter.java:238)
> 
> at pxb.android.axml.AxmlWriter$NodeImpl.write(AxmlWriter.java:254)
> 
> at pxb.android.axml.AxmlWriter.toByteArray(AxmlWriter.java:388)
> 
> at soot.jimple.infoflow.android.axml.AXmlHandler.toByteArray(Unknown Source)
> 
> this is the code responsible for a regenerating the manifest file, the axmlhandler instance is updated with the new axmlnode
> 
> File apkFile = new File(apk);
> 
> ProcessManifest pm = new ProcessManifest(apkFile);
> 
> AXmlHandler axmlh = pm.getAXml();
> 
> AXmlNode newAXmlNode = new AXmlNode("uses-permission", null, axmlh.getRoot());
> 
> newAXmlNode.addAttribute(new AXmlAttribute("name", "android.permission.READ_LOGS", null));
> 
> AXmlNode temp = axmlh.getRoot().addChild(newAXmlNode);
> 
> byte[] axmlBA = axmlh.toByteArray();
> 
> FileOutputStream fileOuputStream = new FileOutputStream(".\\AndroidManifest.xml");
> 
> fileOuputStream.write(axmlBA);
> 
> fileOuputStream.close();
> 
>  Thank you,,
> Modhi
> 
> 
> 
> From: Steven Arzt
> Sent: ‎Monday‎, ‎September‎ ‎29‎, ‎2014 ‎7‎:‎20‎ ‎AM
> To: Modhi Alsobeihy
> Cc: soot-list at sable.mcgill.ca, soot-list at CS.McGill.CA
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20141012/b97f2811/attachment-0003.html 
-------------- next part --------------
_______________________________________________
Soot-list mailing list
Soot-list at CS.McGill.CA
https://mailman.CS.McGill.CA/mailman/listinfo/soot-list


More information about the Soot-list mailing list