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: null
withrenameManifestPackage: com.beatgames.beatxaber
- Edit
AndroidManifest.xml
: replaceandroid:label="Beat Saber"
withandroid:label="Beat Xaber"
- Rename
smali/com/beatgames/beatsaber
tosmali/com/beatgames/beatxaber
- Change Saber to Xaber in
res/values/strings.xml
(app_name
) - Replace all occurencies of
com/beatgames/beatsaber
withcom/beatgames/beatxaber
insmali/com/beatgames/beatxaber
- Replace
com.beatgames.beatsaber
withcom.beatgames.beatxaber
insmali/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
I always have this issue with Beat Saber when changing the package name where it crashes after a few minutes (around 5 minutes). This has been happening since I started installing duplicate beat saber copies in my Quest (since v1.13). The original game (BMBF-modded) is working fine. Do you also encounter this?