Editing
Guides/Monitoring network traffic from an Android app/editcopy
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Modify the application to allow user-installed certificates ==== <ol> <li> Firstly, we will add a new file to our application. This file will allow the app to trust user-added certificate authorities. Create the file at <code>base/res/xml/network_security_config.xml</code> with the following contents: <br> '''<code>base/res/xml/network_security_config.xml</code>''': <pre><nowiki> <network-security-config> <debug-overrides> <trust-anchors> <!-- Trust user added CAs while debuggable only --> <certificates src="user" /> </trust-anchors> </debug-overrides> </network-security-config> </nowiki></pre> </li> <li> The next few changes we will make will occur in the <code>[[AndroidManifest.xml]]</code> file. Open <code>base/AndroidManifest.xml</code> with a text editor of your choice. </li> <li> Find the <code><nowiki><application></nowiki></code> tag. It is located within the main <code><nowiki><manifest></nowiki></code> tag. We will insert two new attributes into this tag:<br> <pre> android:debuggable="true" android:networkSecurityConfig="@xml/network_security_config" </pre> This will make the app "debuggable", and it will load the settings from the <code>network_security_config.xml</code> file we created before. [[File:AndroidManifest.xml adding android-networkSecurityConfig Screenshot.png|900px|thumb|center|alt=Screenshot highlighting where to add the two attributes.|We added two new attributes: <code>android:debuggable="true"</code> and <code>android:networkSecurityConfig="@xml/network_security_config"</code> to the <code><nowiki><application></nowiki></code> tag.]]<br> </li> <li> Find an attribute named <code>package="..."</code> in the top-most <code><nowiki><manifest></nowiki></code> tag, and replace the contents of this attribute with your own app ID. In this example, we will replace <code>com.PigeonGames.Rizline</code> with <code>rgwiki.rizline.example_mod</code>. This change will allow us to have both the original, unmodified version of ''Rizline'' as well as our modified version at the same time. [[File:AndroidManifest.xml package ID Screenshot.png|700px|thumb|center|alt=Screenshot of the AndroidManifest.xml file with the package attribute highlighted.|We will change the <code>com.PigeonGames.Rizline</code> ID, to our own, made-up one: <code>rgwiki.rizline.example_mod</code>.]]<br> </li> <li> Find other instances of the original package ID and change them to our new package ID as well. In the case of ''Rizline'', the <code>com.PigeonGames.Rizline</code> ID also appears later in the file, as part of another ID: [[File:AndroidManifest.xml package ID in a provider ID Screenshot.png|900px|thumb|center|alt=Screenshot highlighting the package ID found in a different place in the file|We need to replace this part of an ID with our new ID as well.]] This varies from application to application. In this case, the app cannot be installed unless this other ID is changed to a new one. Other apps may have more IDs that you have to replace; and in some cases, you don't have to replace every ID with a new one, only some.<br><br> </li> <li> There is one more ID we have to change. Open the <code>split_config.arm64_v8a/AndroidManifest.xml</code> file. This file also has a package ID, and it should match with the package ID from the <code>AndroidManifest.xml</code> in the <code>base</code> directory. [[File:AndroidManifest.xml split package ID Screenshot.png.png|900px|thumb|center|alt=A screenshot showing a short AndroidManifest.xml file for a split APK|This is the last ID we have to change in ''Rizline''. In other apps, there may be more. Try to search the directory for the original ID and find them all!]]<br> </li> <li> The last change we will make, is a change of the application name, to differentiate between the two applications on the device more easily. Open <code>base/res/values/strings.xml</code> in a text editor. Find an entry that has the attribute: <code>name="app_name"</code>, and modify the value to whatever you want. In this case we will change "Rizline" to "Rizline Modded". [[File:Values.xml app name Rizline Modded.png|500px|thumb|center]] </li> </ol> We have modified all the files we need. Now we have to build the modified app and install it on our device.
Summary:
Please note that all contributions to Rhythm Game Wiki are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Rhythm Game Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Style guide
Archival efforts
Special pages
Games
Rizline
Gadvia
Arcaea
pages
Rizline discs
Rizline files
Gadvia islands
Gadvia buildings
Tools
What links here
Related changes
Page information