Android Client: Save Data Extraction Guide¶
This guide explains how to extract save data from the Android offline version of "KRFN" (v3.7.0). The extracted data can be imported into the Sparkle Fantasia custom server to migrate your characters (although some data like rooms, items, and weapons might be missing, character levels and basic progression can be restored).
Warning
To perform this extraction, you must meet one of the following requirements:
- A rooted Android device
- A BlueStacks emulator on Windows
- A device from specific manufacturers (Xiaomi/ASUS) supporting complete application backup
- A device vulnerable to CVE-2024-0044 (Android 12.0 - 14.0 with security patches older than March 2024)
If you do not meet any of these requirements, you will not be able to extract the save data automatically. In such cases, you will need to manually record your character statuses (e.g., via screenshots) and enter them manually.
Prerequisites: Setting up ADB (Android Debug Bridge)¶
Most extraction methods require ADB to connect to your Android device or emulator. Skip this step if you already have ADB installed.
- Download SDK Platform-Tools for Windows from Android Developers.
- Extract the downloaded archive to a convenient folder (e.g.,
C:\android-platform-tools). - Add the extracted path to your system's Environment Variables (
PATH). - Verify the installation by opening Command Prompt (
cmd) or PowerShell and running: If it printsAndroid Debug Bridge version 1.0.XX, the setup is successful.
Method A: BlueStacks Emulator (Automated Dumper)¶
If you are using the BlueStacks emulator, you can use a specialized tool to dump your offline save data automatically.
- Launch the BlueStacks emulator containing KRFN v3.7.0 (ensure the offline data has been created inside the app).
- Open BlueStacks Settings -> Advanced.
- Toggle the Android Debug Bridge (ADB) option to ON and save the changes.
- Restart the BlueStacks emulator.
- After restarting, open Settings -> Advanced again to locate the ADB port number (e.g.,
55713). Keep this settings window open. - Download the automated dumping tool:
krr_offlinedata_dumper.zipfrom Google Drive.- Note: The zip archive password is
password.
- Note: The zip archive password is
- Extract the archive and run
krr_offlinedata_dumper.exe. (Allow any Windows security prompts if they appear). - A console window will open. Enter the ADB port number displayed in your BlueStacks Settings (e.g.,
55713) and press Enter. - Once the process completes, a file named
out.jsonwill be generated in the same directory. - Open
out.jsonwith a text editor (like Notepad) to verify it contains your save data.
Method B: Rooted Android Device (Manual Extraction)¶
For rooted Android devices, you must manually extract the database and encryption key from the system storage and decrypt them using a Python script.
- Install a root-enabled file explorer on your device (e.g., Solid Explorer).
- Copy the database encryption key file:
- Source:
/data/data/com.aniplex.kirarafantasia/files/key.d - Destination:
/sdcard/(or any easily accessible location on your internal storage)
- Source:
- Copy the database file itself:
- Source:
/sdcard/Android/data/com.aniplex.kirarafantasia/files/o.d(Note: depending on the version/environment, it might also be located in/data/data/com.aniplex.kirarafantasia/files/o.d) - Destination:
/sdcard/
- Source:
- Transfer both
key.dando.dfrom your Android device to your PC. - Create a Python script in the same directory as the transferred files. Use the script below to decrypt the save data.
- Note: Ensure you have Python installed, along with the
pycryptodomeandmsgpacklibraries (pip install pycryptodome msgpack).
- Note: Ensure you have Python installed, along with the
import json
import codecs
import msgpack
from Crypto.Cipher import AES
from Crypto.Util.Padding import unpad
# ファイルからデータを読み込む
o_d = open("o.d", "rb").read()
key = open("key.d", "rb").read()
# 最初の16バイトはAESの初期化ベクトル(IV)
iv = bytearray(o_d[:16])
enc_body = o_d[16:]
# AES-CBCモードで復号化する
decipher = AES.new(key, AES.MODE_CBC, iv)
dec_bytes_no_pad = decipher.decrypt(enc_body)
dec_bytes = unpad(dec_bytes_no_pad, block_size=AES.block_size)
# MessagePack形式をアンパックしてJSONに変換
save_data = msgpack.unpackb(dec_bytes)
save_data_json = json.dumps(save_data, indent=2)
out = codecs.decode(save_data_json, "unicode-escape")
# 出力ファイルに書き込む
with open("./out.json", "w", encoding="utf8") as f:
f.write(out)
- Run the script. A file named
out.jsonwill be generated. Open and verify that it contains user data fields.
Method C: Built-in Backup & Restore (No Root - Supported Devices Only)¶
Certain Android manufacturers allow complete application data backups (including the normally inaccessible /data/data directory) without requiring root access.
Supported Manufacturers (Known to support complete data backup):
- Xiaomi: Using "Local Backup"
- ASUS: Using "ASUS Data Transfer"
Unsupported Manufacturers (Known to only back up empty app metadata):
- Oppo / Sony / Google
Extraction Steps (Example for Xiaomi)¶
- Go to Settings -> My Device -> Back up and restore.
- Select Mobile device.
- Select only the KRFN app.
- Run the backup. Once completed, navigate to
MIUI/Backup/AllBackup/on your device's internal storage and find the generated.bakfile. - Transfer this
.bakfile to your computer. - Rename the
.bakfile or open it as a.ziparchive (you may need a standard archive extraction tool). - Extract the archive and locate
key.dando.dinside the app folder structure. - Decrypt the files using the Python script provided in Method B.
Method D: CVE-2024-0044 Vulnerability Exploit (No Root - Android 12.0 to 14.0)¶
If your device is running Android 12.0 to 14.0 (with a security patch level older than March 2024), you may be able to exploit the CVE-2024-0044 vulnerability to elevate privileges and extract the encrypted files without root access.
Note
This requires basic knowledge of Linux shell commands and Android debugging.
- Vulnerability Details: CVE-2024-0044 allows an attacker with ADB access to read files in the private data directories of other apps due to improper permission checks in the shell command environment.
- Reference Article: Extracting App Data using CVE-2024-0044
- PoC Bypass: If standard methods fail, you can try this proof-of-concept repository: canyie/CVE-2024-0044
While direct file copying might fail due to access blocks, you can pipe the file stream outputs to your shared storage (/sdcard/) like this:
# CVE-2024-0044の特権昇格を利用してプライベート領域からファイルをパイプで書き出す例
cat /data/data/com.aniplex.kirarafantasia/files/key.d > /sdcard/key.d
(Note: Tested on Oppo Reno 5A and did not work; success varies depending on the device security patch level and manufacturer modifications).
Importing Save Data into Sparkle Fantasia¶
Once you have successfully generated your out.json file, you can import it into the custom server:
- Visit the Sparkle Fantasia Import Portal: Sparkle Fantasia Offline Import.
- Upload your
out.jsonfile. - The server will issue a Transfer Code and a Password.
- Launch your custom game client and use these credentials to transfer your character data.
Important
- This import feature is strictly designed for offline save data extracted from the official v3.7.0 client. It does not support importing server-side online save states.
- Current Status: The self-service import page might currently be experiencing issues. If the import fails, please contact the administrator via Direct Message (DM) for manual import assistance.