Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The method for extracting strings from strings.xml using Androguard is as follows:

  1. Import the necessary modules:
from androguard import misc
from androguard.axml.axmlparser import AXMLParser
  1. Load the APK file:
a, d, dx = misc.AnalyzeAPK('path_to_apk')
  1. Get the strings.xml file:
xml_string = a.get_android_resources()['xml']['strings.xml'].decode('utf-8')
  1. Create an AXMLParser object and parse the XML string:
parser = AXMLParser(xml_string)
parser.parse()
  1. Get the list of string resources:
strings = parser.get_string_resources()
  1. Print the list of string resources:
for string in strings:
    print(string)

This will output a list of all the strings extracted from the strings.xml file.