5

I've started to read about the AndroidManifest.xml file and the network_security_config.xml. So if I want to include the network_security_config.xml then I use this:

android:networkSecurityConfig="@path/to/config"

Yesterday I reversed a APK and inspected the AndroidManifest.xml. The file-path to the network_security_config.xml is /res/xml so if I thinking right, the Path in the AndroidManifest.xml should look like this:

android:networkSecurityConfig="@res/xml/network_security_config"

instead I've found this:

    android:networkSecurityConfig="@7F140000"

What does this number mean and how is it build? Is this some sort of obfuscation? If not: for what is it used?

Kind regards, Tyr

7

@res/xml/network_security_config means that the file containing the network security configuration is included as file into the APK. If you open the APK file using a ZIP tool you will find the file in the path /res/xml/network_security_config.xml.

If you use a decompiler like Jadx you can open the item /Resources/res/xml/network_security_config to see the content of the network_security_config.xml.

The decompiled result android:networkSecurityConfig="@7F140000" should mean more or less the same, but the decompiler just shows the resourceID as it is saved in the AndroidManifest.xml file instead of resolving the resource name. You can use the automatically generated R class (the package name of the R class can be found in AndroidManifest.xml <manifest package="...") for looking up the name of the resourceID (thanks to Andrew T. for pointing that out) . Depending on the used decompiler you may have to convert the resourceID from hexadecomal to decimal to find it.

2
  • 3
    For official reference: Accessing your app resources: "When your application is compiled, aapt generates the R class, which contains resource IDs for all the resources in your res/ directory. For each type of resource, there is an R subclass (for example, R.drawable for all drawable resources), and for each resource of that type, there is a static integer (for example, R.drawable.icon). This integer is the resource ID that you can use to retrieve your resource." – Andrew T. May 11 '20 at 9:17
  • Thank you both, now this gibberish is more clear! – Tyr May 11 '20 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.