Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Task: fix the D2R mobile port (v2.3.0) that refuses to start
- ## Symptom
- Android app `com.xiaoboluo.d2r` (unofficial Diablo II: Resurrected port, versionName 2.3.0) shows a black screen with "The touch resources are incomplete or do not match this version of the app" (or "Game resources were not found"), then closes.
- Device: <FILL IN model + Android version>
- Game folder: `/storage/emulated/0/Download/S2X/D2R Mobile/`
- ## Facts already verified against the port's source — do not re-derive these
- - Before the game starts the app validates the imported pack and returns a negative code: `-2` data dir missing/empty/unreadable, `-3` modules, `-4` shaders, `-5` config, `-9` overlay missing, `-10` overlay invalid.
- - `android/overlay/overlay.manifest` must begin with exactly this line:
- `DM_OVERLAY_V1 335c64821b13956a524fef3ef2d20cfcacc8bfe420809df74a8cda9597a96210`
- Packs built by the 2.2.x toolchain carry `142c68d7...` there and are rejected with `boot: overlay rejected (2): manifest: source fingerprint mismatch`.
- - Everything below line 1 is `<sha256> <relative-path>`, sorted, ASCII, LF, one file per line. Those hashes are content hashes and stay valid, so **only line 1 may be edited**.
- - The app copies `android/` into private storage and **skips the import** when the pack's `android/pack_info.txt` is byte-identical to the imported copy. Changing the `MADE=` line is enough to force a re-import.
- - `android/pack_info.txt` must contain `PRODUCT=3.3.94012-r45` and `TARGET=android`.
- - The app needs "All files access" (`MANAGE_EXTERNAL_STORAGE`); without it `Download/` is unreadable and the data check fails.
- - The installed APK must actually be 2.3.0. If it is 2.2.4, the correct fix is to install the 2.3.0 APK, not to patch anything.
- ## Hard constraints
- - **Never uninstall the app or clear its data.** Saves live in app-private `files/save/` and are destroyed. If an uninstall is unavoidable, first create an empty file named `export` in `Download/S2X/D2R Mobile/`, launch the app once, and confirm `save-export/<timestamp>/` appeared.
- - Do not touch `data/` (the 18 `*.data` archives and `.build.config`).
- - Do not rewrite the manifest body, reorder lines, convert line endings, or add a BOM.
- - Do not rebuild the import pack unless the checks below prove it necessary.
- - Work only with the files listed here; do not download anything.
- ## Procedure
- 1. **Evidence first.** With the device connected:
- ```
- adb devices
- adb shell dumpsys package com.xiaoboluo.d2r | grep -E 'versionName|versionCode'
- adb logcat -c && adb shell am force-stop com.xiaoboluo.d2r
- adb shell monkey -p com.xiaoboluo.d2r 1
- adb logcat -d -s dm:V
- ```
- Report the last `boot:` lines verbatim. If adb is unavailable, stop and tell me what you need.
- 2. **Layout and case.** Exact strings required:
- ```
- Download/S2X/D2R Mobile/data/ -> 18 *.data + .build.config
- Download/S2X/D2R Mobile/android/ -> out/ shaders/ overlay/ derived.tsv pack_info.txt
- ```
- No `S2X/S2X` nesting, no `Data`/`Android` capitalisation (that is the old 2.2 layout). Fix by moving, never by copying the 5 GB.
- 3. **Permission.** `adb shell appops get com.xiaoboluo.d2r MANAGE_EXTERNAL_STORAGE` must report `allow`. If not, open Settings → Apps → D2R → Special app access → All files access.
- 4. **Manifest header.** Check the first line of every `overlay.manifest` under `android/` (`overlay/` and `overlay_variants/*/`). If it is not the `335c...` hash, patch line 1 only, byte-exact, keeping LF:
- ```
- python3 - <<'PY'
- from pathlib import Path
- want = b"DM_OVERLAY_V1 335c64821b13956a524fef3ef2d20cfcacc8bfe420809df74a8cda9597a96210"
- for p in Path(".").rglob("overlay.manifest"):
- b = p.read_bytes()
- first, nl, rest = b.partition(b"\n")
- if first.startswith(b"DM_OVERLAY_V1 ") and first != want:
- p.write_bytes(want + nl + rest); print("patched", p)
- PY
- ```
- Then `head -1 overlay/overlay.manifest` must print the `335c...` line.
- 5. **Force re-import.** Change `MADE=` in `android/pack_info.txt` to any new value, leaving `PRODUCT=` and `TARGET=` untouched.
- 6. **Relaunch** and let the import progress screen finish, then read the log again. Success looks like:
- ```
- boot: overlay verified source=335c64821b13956a524fef3ef2d20cfcacc8bfe420809df74a8cda9597a96210
- Device ... api=1.3.x
- ```
- and the game reaches the main menu.
- ## If it still fails, interpret and continue
- - `payload: digest mismatch: <file>` — that file differs from the manifest. Check its size against the manifest entry; a truncated copy or a different build is the cause. Re-copy that file, or rebuild the pack.
- - `touch art: missing or invalid: <file>` — the pack lacks the 34 required touch art files. It must be rebuilt: `python3 dm/tools/d2rm_android.py <Update dir> out` from the `v2.3.0` tag.
- - `-2` again — `data/` is still invisible: recheck every path component's case and the All-files-access permission.
- - `boot: missing <path>` — the import did not run: confirm `pack_info.txt` actually differs from the imported copy and that the app was fully closed before relaunching.
- - Black screen but the log shows `overlay verified` — a graphics problem, not this one. Disable Moto Gametime / any game dashboard overlay and report the `Device ... api=` line.
- ## Report back
- - the exact `boot:` lines before and after
- - which check failed and what you changed
- - whether saves are intact (never test that by uninstalling)
Advertisement
Add Comment
Please, Sign In to add comment