This tool is used to decode binary xml file from android apps into human readable xml file and to encode human readable xml file into binary xml file.
Just copy axml folder and add it in your project directory.
If you want to decode a binary xml file from sdcard and take decoded xml as a String
. Then call this function.
InputStream inputFile = new FileInputStream("BinaryXmlFilePath");
String decodedXml = AxmlUtil.decode(inputFile);
If you want to decode a binary xml file and put it somewhere in sdcard then call this function
InputStream inputFile = new FileInputStream("BinaryXmlFilePath");
AxmlUtil.decode(inputFile, "OutputFilePath");
If you want to encode a xml file and take encoded xml as byte array then use this function
byte[] encodedXml = AxmlUtil.encodeFile("NormalXmlFilePath");
If tou want to encode xml file and put it somewhere in sdcard then use this function
AxmlUtil.encodeFile("NormalXmlFilePath", "OutputFilePath");
Don't forget to add this rule in your proguard config file if you are using proguard.
-keep class axml.xml.** { *; }
If you don't add this in proguard then AxmlUtil will not work while encoding a xml file.