Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
jashsu
Old
(Last edited by jashsu; 12th May 2009 at 04:16 AM.)
#1  
jashsu's Avatar
Senior Member - OP
Thanks Meter 4
Posts: 1,845
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 22
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 22
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 4
Posts: 1,845
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 22
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 18
Posts: 623
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: t989 s2 ota jelly bean

Other Phone(s): T-mobile G1 < Htc Vision < LG-P999 < T989 , soon to be htc one m7 or samsung s4.
 
xidominicanoix
Old
(Last edited by xidominicanoix; 15th August 2009 at 02:45 AM.)
#8  
xidominicanoix's Avatar
Senior Member
Thanks Meter 3
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 3
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

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

App Analytics, or the Death of the Independent App Developer

This is entry number one in a series of articles about tools for app developers, … more

Serajr Power Toggles Brings Settings to the Small App World

Ever since the introduction of multi-window with things like Cornerstone and … more

Gear Up Because it’s Time to Save Earth

*Cue Dramatic Music*Put on your red and blue latex overalls and cape because it’s time to … more