Difference between revisions of "Modding:Installing SMAPI on Android"

From Stardew Valley Wiki
Jump to navigation Jump to search
m
(copyedit, clarify risks of downloading third-party SDK, mention SMAPI mods, minor changes)
Line 1: Line 1:
==Before You Begin==
+
← [[Modding:Index]]
Mod at your own risk, not all mods will be compatible with Android. User has the full responsibility of ensuring they do not cause damage by following this guide.
 
  
==Where To Obtain The APK==
+
This page explains how to use mods on Android. Modding on Android is trickier than PC; you can't use SMAPI mods yet and they're more complex to install.
Unfortunately sourcing the apk from third party websites is not recommended as it can be unsafe and can pose a risk to your device.
 
However, the apk can be taken directly from your device, providing you have root access. It can be located at <code>/data/app/com.chucklefish.stardewvalley-1/base.apk</code>
 
  
==XNB Mods: How To==
+
For help with mods on Linux/Mac/Windows, see the [https://stardewvalleywiki.com/Modding:Player_Guide player's guide to mods].
# Install zip program of your choice. Recommended: [https://www.7-zip.org/download.html 7zip].
+
 
 +
==Obtaining the APK==
 +
The game is stored on your phone in an ''Android Package'' file with an <tt>.apk</tt> extension. Downloading the APK from third-party websites isn't recommended, since they may contain malware or be outdated. You can take it directly from your device if you have root access, located at <tt>/data/app/com.chucklefish.stardewvalley-1/base.apk</tt>.
 +
 
 +
==SMAPI / Content Patcher mods==
 +
These aren't available on Android yet. See [https://github.com/Pathoschild/SMAPI/issues/632 ''SMAPI on other platforms''] for more info.
 +
 
 +
==XNB mods==
 +
# Install an unzip program like [https://www.7-zip.org/download.html 7-zip].
 
# Install JDK 8.
 
# Install JDK 8.
# Install Android Studio, make sure to install build-tools.
+
# Install Android Studio (make sure to install build-tools).
 
# Install APK Signer Tool (v2).
 
# Install APK Signer Tool (v2).
# Extract the Stardew Valley apk to your computer with zip program.
+
# Unzip the Stardew Valley APK to your computer.
# Replace the Vanilla XNBs (found in <code>./assets/Content/</code>) with the Modded XNBs.
+
# Replace the vanilla XNBs (found in <tt>./assets/Content/</tt>) with the modded XNBs.
# Archive the contents of the Stardew Valley apk with your chosen zip program (Make sure to not archive the folder containing the files, but the files themselves, so the file structure is <code>com.yourchosenapk.name.apk\different files and folders here</code>), rename from .zip to .apk.
+
# Re-zip the contents of the Stardew Valley APK. Make sure not to include the container folder.
# Open APK Signer Tool (v2)
+
# Change the file extension from <tt>.zip</tt> to <tt>.apk</tt>.
# Fill out all fields in Keyfile Generator page. (Fill as you wish, these aren't important as long as they are filled).
+
# Open APK Signer Tool (v2).
# Click Align & Sign tab. Browse for the modded .apk
+
# Fill out all fields on the Keyfile Generator page (doesn't matter what you enter).
# Select key, and fill out appropriate fields
+
# On the Align & Sign tab, select the modded APK file.
# Click Align and Sign
+
# Select key and fill out the appropriate fields.
# Wait a few moments
+
# Click Align and Sign.
# Move apk to device and install
+
# Wait a few moments.
 +
# Move the APK to the device and install.
  
==Audio Mods: How To==
+
==Audio mods==
# Download both <code>unxwb</code> (Link TBU, program created by Luigi Auriemma), and <code>XWBTool</code> (Link TBU, found on Microsoft's GitHub) and extract both of them to your working directory.
+
# Download [https://github.com/mariodon/unxwb/releases unxwb] and [https://github.com/Microsoft/DirectXTK/releases XWBTool].
# Copy over the .obb from your phone's internal storage to your working directory. The OBB can be found at <code>Internal Storage/Android/obb/main.2.com.chucklefish.stardewvalley.obb</code>
+
# Unzip both to your working directory.
# To unpack simply run <code>unxwb main.2.com.chucklefish.stardewvalley.obb</code> in Command Prompt which should output 87 files named <code>00000000.wav etc..</code>. It is highly recommended for cleanliness to move the unpacked .wav files to a separate folder.
+
# Copy the <tt>.obb</tt> file from your phone's internal storage (located at <tt>Internal Storage/Android/obb/main.2.com.chucklefish.stardewvalley.obb</tt>) to your working directory.
# Replace any of the files with audio of your choosing, however you '''MUST''' keep the file names the same.
+
# Run this command to unpack the file: <pre>unxwb main.2.com.chucklefish.stardewvalley.obb</pre> That will output 87 with names like <tt>00000000.wav</tt>.
# To repack, simply run <code>XWBTool "wherever you extracted and moved the .wavs to/*.wav" -o Music.xwb</code> (The output file '''must''' be called Music.xwb when repacking). Then rename <code>Music.xwb</code> to <code>main.2.com.chucklefish.stardewvalley.obb</code>.
+
# Move the unpacked <tt>.wav</tt> files to a separate folder to keep things organised.
# Move the now modified .obb back to <code>Internal Storage/Android/obb/main.2.com.chucklefish.stardewvalley.obb</code>.
+
# Replace any of the audio files as desired (but the names must remain the same).
 +
# Run this command to repack the file (replacing <tt>folderPath</tt> with the full path to the folder containing the <tt>.wav</tt> files): <pre>XWBTool "folderPath/*.wav" -o Music.xwb</pre> Note that the output file ''must'' be called <tt>Music.xwb</tt> when repacking.
 +
# Rename <tt>Music.xwb</tt> to <tt>main.2.com.chucklefish.stardewvalley.obb</tt>.
 +
# Move the modified <tt>.obb</tt> file back to your phone's internal storage (at <tt>Internal Storage/Android/obb/main.2.com.chucklefish.stardewvalley.obb</tt>).
 
# Enjoy your modified music!
 
# Enjoy your modified music!
  
Spreadsheet of all of the .wav files from the .obb mapped to their internal file names:
+
Here's [https://docs.google.com/spreadsheets/d/1K3S8YDS4Tfe_LPtyXA9LaVM8edxvDFkwfNl-ql1kFGM a spreadsheet of unpacked <tt>.wav</tt> file names].
https://docs.google.com/spreadsheets/d/1K3S8YDS4Tfe_LPtyXA9LaVM8edxvDFkwfNl-ql1kFGM/edit?usp=drivesdk
+
 
 
[[Category:Modding]]
 
[[Category:Modding]]

Revision as of 15:06, 10 April 2019

Modding:Index

This page explains how to use mods on Android. Modding on Android is trickier than PC; you can't use SMAPI mods yet and they're more complex to install.

For help with mods on Linux/Mac/Windows, see the player's guide to mods.

Obtaining the APK

The game is stored on your phone in an Android Package file with an .apk extension. Downloading the APK from third-party websites isn't recommended, since they may contain malware or be outdated. You can take it directly from your device if you have root access, located at /data/app/com.chucklefish.stardewvalley-1/base.apk.

SMAPI / Content Patcher mods

These aren't available on Android yet. See SMAPI on other platforms for more info.

XNB mods

  1. Install an unzip program like 7-zip.
  2. Install JDK 8.
  3. Install Android Studio (make sure to install build-tools).
  4. Install APK Signer Tool (v2).
  5. Unzip the Stardew Valley APK to your computer.
  6. Replace the vanilla XNBs (found in ./assets/Content/) with the modded XNBs.
  7. Re-zip the contents of the Stardew Valley APK. Make sure not to include the container folder.
  8. Change the file extension from .zip to .apk.
  9. Open APK Signer Tool (v2).
  10. Fill out all fields on the Keyfile Generator page (doesn't matter what you enter).
  11. On the Align & Sign tab, select the modded APK file.
  12. Select key and fill out the appropriate fields.
  13. Click Align and Sign.
  14. Wait a few moments.
  15. Move the APK to the device and install.

Audio mods

  1. Download unxwb and XWBTool.
  2. Unzip both to your working directory.
  3. Copy the .obb file from your phone's internal storage (located at Internal Storage/Android/obb/main.2.com.chucklefish.stardewvalley.obb) to your working directory.
  4. Run this command to unpack the file:
    unxwb main.2.com.chucklefish.stardewvalley.obb
    That will output 87 with names like 00000000.wav.
  5. Move the unpacked .wav files to a separate folder to keep things organised.
  6. Replace any of the audio files as desired (but the names must remain the same).
  7. Run this command to repack the file (replacing folderPath with the full path to the folder containing the .wav files):
    XWBTool "folderPath/*.wav" -o Music.xwb
    Note that the output file must be called Music.xwb when repacking.
  8. Rename Music.xwb to main.2.com.chucklefish.stardewvalley.obb.
  9. Move the modified .obb file back to your phone's internal storage (at Internal Storage/Android/obb/main.2.com.chucklefish.stardewvalley.obb).
  10. Enjoy your modified music!

Here's a spreadsheet of unpacked .wav file names.