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!
==== Build and sign the modified APKs ==== Building the app from a directory of files is simple. Unfortunately, creating an APK file is not enough to install it to a device. To actually install the application, we will need to ''sign'' the APK files as well. <ol> <li> To build the APKs from files, we will use [https://apktool.org/ Apktool] again. Open the terminal in the <code>rizline_mod</code> directory and type the following commands: <pre> apktool b "base" apktool b "split_config.arm64_v8a" </pre> This will combine all of the files in the <code>base</code> directory into an APK file, and separately, combine all of the files in the <code>split_config.arm64_v8a</code> directory into a second APK file. Those new APK files are stored in <code>base/dist/base.apk</code> and <code>split_config.arm64_v8a/dist/split_config.arm64_v8a.apk</code> respectively. </li> <li> Now we will use <code>zipalign</code> to optimize the APK. <pre> zipalign -P 16 -f -v 4 "base/dist/base.apk" "base/dist/base_signed.apk" zipalign -P 16 -f -v 4 "split_config.arm64_v8a/dist/split_config.arm64_v8a.apk" "split_config.arm64_v8a/dist/split_config.arm64_v8a_signed.apk" </pre> This will create new files named <code>base_signed.apk</code> and <code>split_config.arm64_v8a_signed.apk</code> in the same directory as the original files. </li> <li> Before signing the APK, we need to create a keystore. A keystore is a file that stores our key pair used to sign APKs. We only need to create a keystore file once, and then we can use it repeatedly. We will use <code>keytool</code> to create a new keystore. The command below will create a new keystore with the filename <code>keystore.jks</code>, and it will be valid for 99999 days. <pre> keytool -genkeypair -keystore "keystore.jks" -keyalg RSA -validity 99999 </pre> After entering this comand, you will be asked to set a password. In this guide, we will simply use the word "password" as the password. Don't forget the password you set - you will need it later. Then, you will be prompted to provide various pieces of information. You can skip all of the prompts by just pressing Enter - apart from the last one, where you have to type <code>yes</code>. [[File:Keytool create keystore example screenshot.png|800px|thumb|center|alt=Screenshot of a terminal with a basic keytool command.|You can just skip most of the prompts, and type "yes" at the end.]] </li> <li> Now it's time to sign the APK files. Use the commands below and type in the keystore password you set at the previous step to sign the APKs. <pre> apksigner sign --ks "keystore.jks" "base/dist/base_signed.apk" apksigner sign --ks "keystore.jks" "split_config.arm64_v8a/dist/split_config.arm64_v8a_signed.apk" </pre> </li> <li> We can verify that we've signed the files properly using <code>apksigner verify</code>: <pre> apksigner verify "base/dist/base_signed.apk" apksigner verify "split_config.arm64_v8a/dist/split_config.arm64_v8a_signed.apk" </pre> If there is no output, that means that we've done everything correctly! If there are some warnings, chances are you can probably ignore them. In the case of ''Rizline'', there are some warnings, but everything still works. If there are errors, the app will likely not work. These are the steps that you have to do every time you make a change to the app files. If you want to speed up the process of building in the future, you might want to consider creating a shell script to execute all of these commands for you. [[File:Apktool building and signing an APK file terminal screenshot.png|900px|thumb|center|alt=A screenshot of commands used to create an APK file and sign it.|All commands used to build and sign an APK file. In this example, we omitted the <code>-v</code> flag in <code>zipalign</code> to hide unnecesary output.]] </li> </ol>
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