5,596,235 Members 35,948 Now Online
XDA Developers Android and Mobile Development Forum

AXMLPrinter2 - Convert Android binary XML to human-readable XML

Tip us?
 
jashsu
Old
(Last edited by jashsu; 12th May 2009 at 04:16 AM.)
#1  
jashsu's Avatar
Senior Member - OP
Thanks Meter 10
Posts: 1,852
Join Date: Nov 2008
Default AXMLPrinter2 - Convert Android binary XML to human-readable XML

I've been poking around HTC's key.apk and HTC_CIME.apk in the hopes of somehow finding a way to activate the XT9 functionality (aka "Compact qwerty" and "20-key"). Still working on that. In the process, I found a neat little java app called AXMLPrinter2 which as the title suggests, converts Android's binary XML files back to human-readable XML. Take a look:

Code:
c:\and_test\java -jar AXMLPrinter2.jar p1220_symbol_sip.xml > p1220_symbol_sip.txt
Quote:
Originally Posted by Contents of p1220_symbol_sip.txt
<?xml version="1.0" encoding="utf-8"?>
<keyboard
width="53.0px"
hgap="0.0px"
vgap="0.0px"
height="55.0px"
keyTextSize="24.0px"
popupTextSize="32.0px"
accentPage="4"
keyboardBackground="@7F020074"
keyboardPadding="0,2,0,4"
functionKeyBackground="@7F020032"
commonKeyBackground="@7F020031"
pageKeyBackground="@7F02008A"
>
<row
>
<key
codes="0x0028,0x0040,0x005E,-14"
label="("
hgap="1.0px"
leftEdge="true"
popupCharacters="@7F08006B"
popupDelay="0"
accentType="3"
alignIndex="0"
>
</key>

...
Edit: there's supposed to be tabbing but xda forum code stripped em.
The Following User Says Thank You to jashsu For This Useful Post: [ Click to Expand ]
 
beagz
Old
#2  
beagz's Avatar
Senior Member
Thanks Meter 23
Posts: 1,056
Join Date: Jan 2009
Location: Greenacres, FL
Well,

Now I can read the .xml but how can I edit it. I have the hex editor but the strings seem different.
Unlocked and Rooted Sensation 4G
InsertCoin Rom.
Special thanks to Cyanogen, Enom, Sir*Mez, Drizzy, Manup, Jairomeo, Armyranger251, Dude, Haykuro, Stericson, JF, Lucid, Baadnewz and all the devs and themers here.
 
bjehsus
Old
#3  
Member
Thanks Meter 1
Posts: 85
Join Date: Feb 2009
Location: Hampshire
Quote:
Originally Posted by beagz View Post
Well,

Now I can read the .xml but how can I edit it. I have the hex editor but the strings seem different.
Hex editors are for modifying BINARY files, not plain text xml files. Use notepad, or something. But you'll need to rebuild the xml files after modifying for them to be of any use.
 
beagz
Old
(Last edited by beagz; 12th May 2009 at 12:25 PM.)
#4  
beagz's Avatar
Senior Member
Thanks Meter 23
Posts: 1,056
Join Date: Jan 2009
Location: Greenacres, FL
No I meant I can find the corresponding code in notepad using the .txt output and then I can change it in the hex editor. But I am trying to figure out what values to change.
.txt
text color="@7F050000"
.xml (hex)
00 00 05 7F

I can find the value but what part should be changed? in hex I know from stericson that values = BGR but which 6 of 8 should be changed?

OK, I found the problem. The ones that control color all have #FFFFFFFF as the format not @FFFFFFFF
thanks.
Unlocked and Rooted Sensation 4G
InsertCoin Rom.
Special thanks to Cyanogen, Enom, Sir*Mez, Drizzy, Manup, Jairomeo, Armyranger251, Dude, Haykuro, Stericson, JF, Lucid, Baadnewz and all the devs and themers here.
 
jashsu
Old
(Last edited by jashsu; 12th May 2009 at 12:27 PM.)
#5  
jashsu's Avatar
Senior Member - OP
Thanks Meter 10
Posts: 1,852
Join Date: Nov 2008
Quote:
Originally Posted by beagz View Post
No I meant I can find the corresponding code in notepad using the .txt output and then I can change it in the hex editor. But I am trying to figure out what values to change.
.txt
text color="@7F050000"
.xml (hex)
00 00 05 7F

I can find the value but what part should be changed? in hex I know from stericson that values = BGR but which 6 of 8 should be changed?
Looks like its just different endianness.

This app isn't particularly useful if you just want to alter color values in a hex editor. It's more for a situation where you want to completely alter ui elements in an app without source code.
 
beagz
Old
#6  
beagz's Avatar
Senior Member
Thanks Meter 23
Posts: 1,056
Join Date: Jan 2009
Location: Greenacres, FL
So then is there a way to convert back to binary?
Unlocked and Rooted Sensation 4G
InsertCoin Rom.
Special thanks to Cyanogen, Enom, Sir*Mez, Drizzy, Manup, Jairomeo, Armyranger251, Dude, Haykuro, Stericson, JF, Lucid, Baadnewz and all the devs and themers here.
 
xile6
Old
#7  
Senior Member
Thanks Meter 35
Posts: 788
Join Date: Dec 2008
Location: Dallas
anyone ever find a way to convert them back?
if im wrong tell me. I'd ratter be correct then live life being mislead.
Phone: HTC One m7 Tmobile root stock

Other Phone(s): T-mobile G1 < Htc Vision G2 < LG-P999 G2x < T989 S2 , HTC One m7 < Soon Note 3
 
xidominicanoix
Old
(Last edited by xidominicanoix; 15th August 2009 at 02:45 AM.)
#8  
xidominicanoix's Avatar
Senior Member
Thanks Meter 4
Posts: 1,077
Join Date: Oct 2006
Location: FL
wow .. wrong thread lol


ROM: bruce2728's CM10 KANG

Google Nexus One
ROM: CM7


Programs by JDuverge (aka ME)
Find and Pull™
Ultimate Extractor
 
temporizer
Old
#9  
Senior Member
Thanks Meter 0
Posts: 617
Join Date: Aug 2006
Location: Vancouver
Quote:
Originally Posted by xile6 View Post
anyone ever find a way to convert them back?
good question. anyone?
Samsung Captivate
 
xidominicanoix
Old
(Last edited by xidominicanoix; 15th August 2009 at 03:13 AM.)
#10  
xidominicanoix's Avatar
Senior Member
Thanks Meter 4
Posts: 1,077
Join Date: Oct 2006
Location: FL
Quote:
Originally Posted by temporizer View Post
good question. anyone?
yea i answered this in another thread .. lemme go look for my answer

EDIT: they talk about it here


ROM: bruce2728's CM10 KANG

Google Nexus One
ROM: CM7


Programs by JDuverge (aka ME)
Find and Pull™
Ultimate Extractor

The Following User Says Thank You to xidominicanoix For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Force Translucent Status Bar in KitKat ROMs with Xposed

It’s been a while since Android 4.4KitKat wasreleased, and we’re slowly … more

Fix the Ambient Light Issues on Your Google Nexus 5 using Xposed

The Google Nexus 5 is a great and rather popular device. This LG-produced … more

Google Glass XE16 Update Factory Image and Rooted Bootloader Now Available

You may recall that early yesterday, we talked about the XE16 … more