Here's how you can have multiple versions of beat saber at the same time by having different package names.
Unfortunately, BMBF is hardcoded to use original BeatSaber package id, so it's not possible to have completely unmodded version with BMBF modded version.
If BMBF starts using this method, it would be possible to have unmodded beat saber from oculus store with multiplayer support and modded BMBF version.
I made this because BMBF modded version used to crash time to time, and I prefer to have choice between stable game and custom songs.
You'd need apktool, zipalign, apksigner – I'm on mac, so I've installed apktool from brew and used Docker for other tools: fopina/dedroid.
Grab the APK
If you don't have APK already, you can pull it from device with adb:
adb pull $(adb shell pm path com.beatgames.beatsaber | cut -d: -f2) BeatSaber.apk
Extract
apktool d BeatSaber.apk -o BeatXaber
APK would be extracted to BeatXaber directory
Patch: Rename
- Edit
apktool.yaml: replacerenameManifestPackage: nullwithrenameManifestPackage: com.beatgames.beatxaber - Edit
AndroidManifest.xml: replaceandroid:label="Beat Saber"withandroid:label="Beat Xaber" - Rename
smali/com/beatgames/beatsabertosmali/com/beatgames/beatxaber - Change Saber to Xaber in
res/values/strings.xml(app_name) - Replace all occurencies of
com/beatgames/beatsaberwithcom/beatgames/beatxaberinsmali/com/beatgames/beatxaber - Replace
com.beatgames.beatsaberwithcom.beatgames.beatxaberinsmali/com/beatgames/beatxaber/BuildConfig.smali(APPLICATION_ID)
Patch: Resource ID hack
Renaming everything wasn't enough – for some reason resource lookup was broken: game was crashing with android.content.res.Resources$NotFoundException: String resource ID #0x0 on start, so I had to patch it out:
Open file smali/com/unity3d/player/UnityPlayer.smali, find UnityPlayer;->GetGlViewContentDescription:
remove invoke-direct and move-result-object p1 and replace it with const-string p1, "Game view":
- invoke-direct {p0, p1}, Lcom/unity3d/player/UnityPlayer;->GetGlViewContentDescription(Landroid/content/Context;)Ljava/lang/String;
- move-result-object p1
+ const-string p1, "Game view"Build
# build apk
apktool b BeatXaber -o BeatXaber-unaligned.apk
# docker run --rm -v $PWD:/work -it fopina/dedroid bash # if you prefer docker too
# generate signing key
keytool -genkeypair -v -keystore ./BeatXaber.keystore \
-alias BeatXaber -keyalg RSA -keysize 2048 \
-validity 10000 -dname "CN=BeatXaber, OU=BeatXaber, O=BeatXaber, L=BeatXaber, ST=BeatXaber, C=US" \
-storepass password -keypass password
# align
zipalign -p -f -v 4 BeatXaber-unaligned.apk BeatXaber.apk
# sign
apksigner sign --ks ./BeatXaber.keystore --ks-key-alias BeatXaber --ks-pass pass:password BeatXaber.apk
Install
adb install -r -d BeatXaber.apk (SideQuest sideloading might work too)
App Beat Xaber should now appear in unknown sources
Managing saves/DLCs
saves can be copied from/to /sdcard/Android/data/com.beatgames.beatsaber and /sdcard/Android/data/com.beatgames.beatxaber
DLCs for patched version are loaded from /sdcard/Android/obb/com.beatgames.beatxaber
@stek29 this process doesn't appear to work anymore, it starts to load and then crashes after the loading splash screen