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

From Stardew Valley Wiki
Jump to navigation Jump to search
(group XNB sections, add note about XNB mods not being recommended, minor changes)
Line 5: Line 5:
 
For help with mods on Linux/Mac/Windows, see the [https://stardewvalleywiki.com/Modding:Player_Guide player's guide to mods].
 
For help with mods on Linux/Mac/Windows, see the [https://stardewvalleywiki.com/Modding:Player_Guide player's guide to mods].
  
==Obtain the APK==
+
==SMAPI mods & content packs==
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 it'll often be outdated or contain malware.
+
These are available using unofficial versions of SMAPI. See [https://github.com/Pathoschild/SMAPI/issues/632 ''SMAPI on other platforms''] for more info.
 +
 
 +
==XNB mods==
 +
[[Modding:Using XNB mods|XNB mods aren't recommended]] and often break when the game updates. If you're sure you want to use them, here's how.
 +
 
 +
===Obtain the APK===
 +
First you'll need the APK (''Android Package'') file for your game, which contains the game files. Downloading the APK from third-party websites isn't recommended, since it'll often be outdated or contain malware.
  
 
There are two ways to access the APK file:
 
There are two ways to access the APK file:
Line 13: Line 19:
 
* Otherwise install [https://play.google.com/store/apps/details?id=com.ext.ui APK Extractor] and run it. The APK will be extracted to <tt>ExtractedApks/Stardew Valley_com.chucklefish.stardewvalley.apk</tt> on your device.
 
* Otherwise install [https://play.google.com/store/apps/details?id=com.ext.ui APK Extractor] and run it. The APK will be extracted to <tt>ExtractedApks/Stardew Valley_com.chucklefish.stardewvalley.apk</tt> on your device.
  
==SMAPI / Content Patcher mods==
+
===Install an XNB mod===
These are available using unofficial experimental versions of SMAPI. See [https://github.com/Pathoschild/SMAPI/issues/632 ''SMAPI on other platforms''] for more info.
+
; Option A&#58; MT Manager app on your phone
  
==XNB mods==
+
:# Copy the XNB files you want to install into a new folder on your device.
===Option A: MT Manager app on your phone===
+
:# Install and open [https://play.google.com/store/apps/details?id=bin.mt.plus MT Manager] on your phone.
# Copy the XNB files you want to install into a new folder on your device.
+
:# On the left side of the screen:
# Install and open [https://play.google.com/store/apps/details?id=bin.mt.plus MT Manager] on your phone.
+
:## Find [[#Obtain the APK|the Stardew Valley APK]].
# On the left side of the screen:
+
:## Tap it.
## Find [[#Obtain the APK|the Stardew Valley APK]].
+
:## Select 'view'. This should open a folder containing the game's asset files.
## Tap it.
+
:# On the right side of the screen:
## Select 'view'. This should open a folder containing the game's asset files.
+
:## Find the folder containing XNB mods (from step 1).
# On the right side of the screen:
+
:## Make sure the corresponding folder is open on the left side of the screen (e.g. the <tt>Portraits</tt> folder if you're installing portrait mods).
## Find the folder containing XNB mods (from step 1).
+
:## Select the files to copy. (To select all, tap the '''<tt>⋮</tt>''' menu and choose 'select all'.)
## Make sure the corresponding folder is open on the left side of the screen (e.g. the <tt>Portraits</tt> folder if you're installing portrait mods).
+
:## Long tap the selected files, and choose the copy option.
## Select the files to copy. (To select all, tap the '''<tt>⋮</tt>''' menu and choose 'select all'.)
+
:## A menu should appear. Change the 'level' option to Storage, and the 'update mode' to Replace All. Tap OK to copy the files.
## Long tap the selected files, and choose the copy option.
+
:# On the left side of the screen:
## A menu should appear. Change the 'level' option to Storage, and the 'update mode' to Replace All. Tap OK to copy the files.
+
:## Return to the folder containing the <tt>.apk</tt> file.
# On the left side of the screen:
+
:## Tap on the Stardew Valley APK file, choose 'Function', then 'APK Sign'.
## Return to the folder containing the <tt>.apk</tt> file.
+
:## Tap the '''new''' APK file that generates and choose 'Install'.
## Tap on the Stardew Valley APK file, choose 'Function', then 'APK Sign'.
+
 
## Tap the '''new''' APK file that generates and choose 'Install'.
+
; Option B&#58; Android Studio on your computer
  
===Option B: Android Studio on your computer===
+
:# Install an unzip program like [https://www.7-zip.org/download.html 7-zip].
# 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).
+
:# Unzip [[#Obtain the APK|the Stardew Valley APK]] to your computer.
# Unzip [[#Obtain the APK|the Stardew Valley APK]] to your computer.
+
:# Replace the vanilla XNBs (found in <tt>./assets/Content/</tt>) with the modded XNBs.
# Replace the vanilla XNBs (found in <tt>./assets/Content/</tt>) with the modded XNBs.
+
:# Re-zip the contents of the Stardew Valley APK. Make sure not to include the container folder.
# Re-zip the contents of the Stardew Valley APK. Make sure not to include the container folder.
+
:# Change the file extension from <tt>.zip</tt> to <tt>.apk</tt>.
# Change the file extension from <tt>.zip</tt> to <tt>.apk</tt>.
+
:# Open APK Signer Tool (v2).
# Open APK Signer Tool (v2).
+
:# Fill out all fields on the Keyfile Generator page (doesn't matter what you enter).
# Fill out all fields on the Keyfile Generator page (doesn't matter what you enter).
+
:# On the Align & Sign tab, select the modded APK file.
# On the Align & Sign tab, select the modded APK file.
+
:# Select key and fill out the appropriate fields.
# Select key and fill out the appropriate fields.
+
:# Click Align and Sign.
# Click Align and Sign.
+
:# Wait a few moments.
# Wait a few moments.
+
:# Move the APK to the device and install.
# Move the APK to the device and install.
 
  
==Audio mods==
+
===Install an audio mod===
 
# Download [https://github.com/mariodon/unxwb/releases unxwb] and [https://github.com/Microsoft/DirectXTK/releases XWBTool].
 
# Download [https://github.com/mariodon/unxwb/releases unxwb] and [https://github.com/Microsoft/DirectXTK/releases XWBTool].
 
# Unzip both to your working directory.
 
# Unzip both to your working directory.

Revision as of 05:33, 24 July 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.

SMAPI mods & content packs

These are available using unofficial versions of SMAPI. See SMAPI on other platforms for more info.

XNB mods

XNB mods aren't recommended and often break when the game updates. If you're sure you want to use them, here's how.

Obtain the APK

First you'll need the APK (Android Package) file for your game, which contains the game files. Downloading the APK from third-party websites isn't recommended, since it'll often be outdated or contain malware.

There are two ways to access the APK file:

  • If you have root access, it's located at /data/app/com.chucklefish.stardewvalley-1/base.apk.
  • Otherwise install APK Extractor and run it. The APK will be extracted to ExtractedApks/Stardew Valley_com.chucklefish.stardewvalley.apk on your device.

Install an XNB mod

Option A: MT Manager app on your phone
  1. Copy the XNB files you want to install into a new folder on your device.
  2. Install and open MT Manager on your phone.
  3. On the left side of the screen:
    1. Find the Stardew Valley APK.
    2. Tap it.
    3. Select 'view'. This should open a folder containing the game's asset files.
  4. On the right side of the screen:
    1. Find the folder containing XNB mods (from step 1).
    2. Make sure the corresponding folder is open on the left side of the screen (e.g. the Portraits folder if you're installing portrait mods).
    3. Select the files to copy. (To select all, tap the menu and choose 'select all'.)
    4. Long tap the selected files, and choose the copy option.
    5. A menu should appear. Change the 'level' option to Storage, and the 'update mode' to Replace All. Tap OK to copy the files.
  5. On the left side of the screen:
    1. Return to the folder containing the .apk file.
    2. Tap on the Stardew Valley APK file, choose 'Function', then 'APK Sign'.
    3. Tap the new APK file that generates and choose 'Install'.
Option B: Android Studio on your computer
  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.

Install an audio mod

  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 should output 87 files 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.