2

In order to localize an android application (reverse engineer), I am comparing three XML files values (English, French & Arabic) to translate the missing values in French and Arabic. As a first step after decompiling the APK i have to make the XML files in a one excel sheet with four columns "Name, English,French,Arabic"

English

<?xml version="1.0" encoding="utf-8"?>
 <resources>
  <string name="cancel_action">Cancel</string>
  <string name="dialog_title">Dialog Title</string>
  <string name="application_title">Application Title</string>
  <string name="confirm_action">Confirm</string>
  ...
 </resources>

French

<?xml version="1.0" encoding="utf-8"?>
 <resources>
  <string name="dialog_title">Titre dialogue</string>
  <string name="application_title">Titre Application</string>
  <string name="cancel_action">Annuler</string>
  <string name="confirm_action">Confirmer</string>
  ...
</resources>

My issue is how to import & organize them pragmatically instead of excel filters ? because variable names have different locations ? I hope the idea is clear!

M. A.
  • 424
  • 6
  • 21

1 Answers1

2

I would use Notepad++ and the compare plug-in:

Notepad++
Compare for Notepad++

  1. Edit the 3 XML files to that all string name tags are in same order
  2. Where needed add missing name tags with empty value
  3. Use Notepad++ compare with ALT+D to see any differences in the names order more easily
  4. Copy each XML into this stringconvert tool, in the green box on the right
  5. Press "<< Convert" to get just the Key-value pairs (textbox at bottom) and copypaste that into Excel

Also, if you don't want to put all the string name tags in correct order by hand, and if the order is not really important, then you can just sort them alphabetically by doing the following.

Copy XMLs into backup file, remove ?xml, resources tag etc. so that you only keep the string name tags. Sort the lines in Notepad++ by selecting all text and then TextFX -> TextFX tools -> Sort lines. And then copy/paste back into original XML.

BdR
  • 2,770
  • 2
  • 17
  • 36