Skip to content

Instantly share code, notes, and snippets.

@pexcn
Last active March 2, 2025 07:44
Show Gist options
  • Save pexcn/3681fb0cbae1f48d2b4c5357f5c564b1 to your computer and use it in GitHub Desktop.
Save pexcn/3681fb0cbae1f48d2b4c5357f5c564b1 to your computer and use it in GitHub Desktop.
Inject SESSDATA into BBLL.

Inject SESSDATA into BBLL

Make BBLL debuggable

# disassemble apk
apktool d -o BBLL BBLL-official.apk

# edit AndroidManifest.xml
# add `android:debuggable="true"` into application node

# reassemble apk
apktool b -o BBLL.apk BBLL

# sign apk
zipalign -P 16 -f -v 4 BBLL.apk BBLL-zipalign.apk
apksigner sign --ks release.keystore --out BBLL-zipalign-signed.apk BBLL-zipalign.apk

# install apk
adb install BBLL-zipalign-signed.apk

Inject SESSDATA

# login your account via qrcode

# dump CookiePersistence.xml
adb shell "run-as com.xx.blbl cp /data/data/com.xx.blbl/shared_prefs/CookiePersistence.xml /sdcard/"
adb pull /sdcard/CookiePersistence.xml

# get the value of SESSDATA from CookiePersistence.xml

# decode SESSDATA
java -jar SerializationDumper-v1.14.jar <SESSDATA_VALUE> > SESSDATA.txt

# update the Value and Length of SESSDATA in SESSDATA.txt
# note that both plain and hex values ​​need to be updated
# 1. get hex of Length
printf '%x\n' <NEW_LENGTH_PLAIN_VALUE>
# 2. get hex of SESSDATA
echo -n <NEW_SESSDATA_PLAIN_VALUE> | xxd -p -c 10000

# encode SESSDATA
java -jar SerializationDumper-v1.14.jar -b SESSDATA.txt SESSDATA.bin

# obtain the new SESSDATA, and update CookiePersistence.xml
xxd -p -c 10000 SESSDATA.bin

# inject into BBLL
adb shell am force-stop com.xx.blbl
adb push CookiePersistence.xml /sdcard/
adb shell "run-as com.xx.blbl cp /sdcard/CookiePersistence.xml /data/data/com.xx.blbl/shared_prefs/CookiePersistence.xml"

Command notes

# get android sdkmanager
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip commandlinetools-linux-11076708_latest.zip
PATH=/opt/cmdline-tools/bin:$PATH

# get android build-tools
yes | sdkmanager --sdk_root=/opt/android-sdk --licenses
sdkmanager --sdk_root=/opt/android-sdk --install "build-tools;35.0.0"
PATH=/vscode/opt/android-sdk/build-tools/35.0.0:$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment