Guest User

Untitled

a guest
Nov 6th, 2026
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.42 KB | Gaming | 0 0
  1. # Task: fix the D2R mobile port (v2.3.0) that refuses to start
  2.  
  3. ## Symptom
  4. 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.
  5.  
  6. Device: <FILL IN model + Android version>
  7. Game folder: `/storage/emulated/0/Download/S2X/D2R Mobile/`
  8.  
  9. ## Facts already verified against the port's source — do not re-derive these
  10. - 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.
  11. - `android/overlay/overlay.manifest` must begin with exactly this line:
  12. `DM_OVERLAY_V1 335c64821b13956a524fef3ef2d20cfcacc8bfe420809df74a8cda9597a96210`
  13. Packs built by the 2.2.x toolchain carry `142c68d7...` there and are rejected with `boot: overlay rejected (2): manifest: source fingerprint mismatch`.
  14. - 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**.
  15. - 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.
  16. - `android/pack_info.txt` must contain `PRODUCT=3.3.94012-r45` and `TARGET=android`.
  17. - The app needs "All files access" (`MANAGE_EXTERNAL_STORAGE`); without it `Download/` is unreadable and the data check fails.
  18. - 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.
  19.  
  20. ## Hard constraints
  21. - **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.
  22. - Do not touch `data/` (the 18 `*.data` archives and `.build.config`).
  23. - Do not rewrite the manifest body, reorder lines, convert line endings, or add a BOM.
  24. - Do not rebuild the import pack unless the checks below prove it necessary.
  25. - Work only with the files listed here; do not download anything.
  26.  
  27. ## Procedure
  28. 1. **Evidence first.** With the device connected:
  29. ```
  30. adb devices
  31. adb shell dumpsys package com.xiaoboluo.d2r | grep -E 'versionName|versionCode'
  32. adb logcat -c && adb shell am force-stop com.xiaoboluo.d2r
  33. adb shell monkey -p com.xiaoboluo.d2r 1
  34. adb logcat -d -s dm:V
  35. ```
  36. Report the last `boot:` lines verbatim. If adb is unavailable, stop and tell me what you need.
  37. 2. **Layout and case.** Exact strings required:
  38. ```
  39. Download/S2X/D2R Mobile/data/ -> 18 *.data + .build.config
  40. Download/S2X/D2R Mobile/android/ -> out/ shaders/ overlay/ derived.tsv pack_info.txt
  41. ```
  42. No `S2X/S2X` nesting, no `Data`/`Android` capitalisation (that is the old 2.2 layout). Fix by moving, never by copying the 5 GB.
  43. 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.
  44. 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:
  45. ```
  46. python3 - <<'PY'
  47. from pathlib import Path
  48. want = b"DM_OVERLAY_V1 335c64821b13956a524fef3ef2d20cfcacc8bfe420809df74a8cda9597a96210"
  49. for p in Path(".").rglob("overlay.manifest"):
  50. b = p.read_bytes()
  51. first, nl, rest = b.partition(b"\n")
  52. if first.startswith(b"DM_OVERLAY_V1 ") and first != want:
  53. p.write_bytes(want + nl + rest); print("patched", p)
  54. PY
  55. ```
  56. Then `head -1 overlay/overlay.manifest` must print the `335c...` line.
  57. 5. **Force re-import.** Change `MADE=` in `android/pack_info.txt` to any new value, leaving `PRODUCT=` and `TARGET=` untouched.
  58. 6. **Relaunch** and let the import progress screen finish, then read the log again. Success looks like:
  59. ```
  60. boot: overlay verified source=335c64821b13956a524fef3ef2d20cfcacc8bfe420809df74a8cda9597a96210
  61. Device ... api=1.3.x
  62. ```
  63. and the game reaches the main menu.
  64.  
  65. ## If it still fails, interpret and continue
  66. - `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.
  67. - `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.
  68. - `-2` again — `data/` is still invisible: recheck every path component's case and the All-files-access permission.
  69. - `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.
  70. - 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.
  71.  
  72. ## Report back
  73. - the exact `boot:` lines before and after
  74. - which check failed and what you changed
  75. - whether saves are intact (never test that by uninstalling)
  76.  
Advertisement
Add Comment
Please, Sign In to add comment