# D-1 — independent derivation: what a photo-vault app leaves on the phone

Method, then one section per app. Every claim below rests on a file in `derivation/raw/` or on a
command quoted in the text. Corpus SHA-256 (verified on the files used, `shasum -a 256`):

| id | bytes | sha256 |
|---|---|---|
| P1.jpg | 3152248 | d8204717839dca9dbc665eca8325a086538ee6da07520f723c07f9a469d40bed |
| P2.jpg | 7755747 | ea539465eebd218fa116a8ef50062ff413892e8fa98dd235e291e6e32a8a7d92 |
| P3.jpg | 2655678 | 3a222c0c819baca8506394d4d599bd28a0b9d6ce464f0351cec57e6b0deae4b2 |
| S1.png | 6144771 | d9f15e63e1268c6576aefcbc6d73d185b1e3c8a9956ae9bb2c28c1b9e78e7789 |
| V1.mp4 | 3028330 | 051df7e4320183ee19e7a245e8a8a8d936bc3587d3215069310562f4761e4317 |

Decoded dimensions: P1/P2 4080x3072, P3 2268x4032, S1 1080x2400, V1 1920x1080 H.264/AAC, 10 s.

## Method

One emulator, `VS2_VAULT_B`, serial `emulator-5620`, Android 14 (API 34), 1080x2400, `adb root` works.
One fresh `-wipe-data` boot per app, in this fixed order so the same baseline exists for every app:

1. **Plant the bait.** Push P1, P2, P3, S1 to `/sdcard/DCIM/Camera/` and V1 to `/sdcard/Movies/`,
   fire `MEDIA_SCANNER_SCAN_FILE` for each, and confirm each appears in MediaStore
   (`content query --uri content://media/external/images/media` and `.../video/media`). The five
   MediaStore rows and their ids are recorded as the gallery baseline. A full `sha256sum` of
   `/sdcard` is saved as the pre-install manifest (`raw/baseline_sdcard.txt`).
2. **Drive the app the way a person would.** Install the signed APK, launch it, complete onboarding,
   set the vault PIN (583719, or 5837 where the app allows only four digits), select all five files,
   hide them, take whatever "hide / encrypt / delete original" choice the app preselects, and return to
   the start screen. Screen reading is `uiautomator dump` + `input tap`; the screens that carry a
   verdict are dumped into `raw/<app>/ui-*.xml` and screenshots.
3. **Look for copies.** Four independent searches, because a copy can be renamed, re-encoded or held
   in an extension-less file:
   - *by bytes*: `sha256sum` of every regular file under `/storage/emulated/0` (the target of the
     `/sdcard` symlink — `find /sdcard` does not follow it), `/data/data/<pkg>`, `/data/user/0/<pkg>`,
     `/data/local/tmp` and `/storage/emulated/0/Android/{data,media}/<pkg>`, compared against the five
     corpus hashes;
   - *by decoded pixels*: every file whose name or magic bytes say image is decoded and its decoded
     RGB MD5 compared, so a re-muxed or metadata-stripped copy still matches;
   - *by near-identity*: 48x48 grayscale of every image is compared to the originals (mean absolute
     difference) to find resized/re-compressed variants, i.e. case (c);
   - *by video frame*: `ffmpeg` grabs frame 0.5 s of every video-ish file and compares it to V1's
     frame 0.5 s the same way.
4. **Who can read it.** The non-root question is answered three ways. (i) The cable reader: `adb
   unroot` and repeat the storage scan as uid 2000 `shell` — what a laptop without root sees. (ii) The
   other app, by path: the stock Files app (`com.google.android.documentsui`) is asked to list
   `/storage/emulated/0` and the vault folders, which shows what a normal app with storage access can
   browse; a dot-directory is hidden from it by default, which is recorded where it matters. (iii) The
   other app, through MediaProvider: `content read --uri content://media/external/file/<id>` as uid
   2000 returns the bytes of a file the media database still indexes. App-private trees are checked as
   uid 2000 (`ls`/`sha256sum` → `Permission denied`) to prove they are closed. The root question is
   answered from the same scans run as uid 0.
5. **The PIN.** After hiding, every file under `/data/data/<pkg>` is searched for the literal `583719`
   and for `5837`, then for hash forms: MD5/SHA-1/SHA-256 of `583719` and of `5837`, upper/lower
   hex and Base64, plus the same for the digits reversed. SQLite and shared-prefs files are read as
   text first, then `strings` over the whole tree.
6. **The gallery.** The pre-install MediaStore rows are re-queried by `_id`. A row that survives with
   its original `_data`/`relative_path` means the gallery still shows the picture; a row that is gone
   while the file is also gone means the app removed it from both. Each result is confirmed against
   the on-disk presence of the original path.
7. **Byte-level difference.** For every stored file that is not an exact copy, `cmp`-style
   comparison against the original gives the first differing offset, the number of differing bytes
   and the length of the common prefix (`scratch/sig.py`).

Files pulled off the phone land in `raw/<app>/`, with a `MANIFEST.txt` giving device path, size,
sha256, mode and owner for each.

## Environment fixes applied before app 1

`adb root`; package verifier and adb-install verification off; three animation scales set to 0 so
`input tap` lands on settled screens. No other device setting was changed.

## 1. com.netqin.ps (NQ Vault / "Vault", 6.8.12.80, vc 999, targetSdk 27)

APK `latest.apk`, sha256 `bc0eeb69…fea7d`, matches `apk.json`. Installed clean, PIN 583719 (six digits
accepted), four photos and the video hidden through Photos → + → Camera → select 4 → Import, then
Videos → Movies → V1.mp4 → Import. Note: the emulator's `-wipe-data` process was killed by a host
timeout after the last import; the device was restarted **without** `-wipe-data`, so the state below
is the same session continued, and the four image imports plus the one video import had all finished
(the video file exists with its full 3028330 bytes and its index row).

### (a) readable without root — YES, one fixed XOR away

The app moves the media **into shared external storage**, not into its own directory:

```
/storage/emulated/0/SystemAndroid/Data/MTU3MDYzNTk1MQ==/.image/1795722738686.bin  6144771
/storage/emulated/0/SystemAndroid/Data/MTU3MDYzNTk1MQ==/.image/1795722738703.bin  3152248
/storage/emulated/0/SystemAndroid/Data/MTU3MDYzNTk1MQ==/.image/1795722738714.bin  2655678
/storage/emulated/0/SystemAndroid/Data/MTU3MDYzNTk1MQ==/.image/1795722738727.bin  7755747
/storage/emulated/0/SystemAndroid/Data/MTU3MDYzNTk1MQ==/.video/1795722824813.mp4  3028330
```

Proven three ways, all without root (`adb unroot`, `adb shell id -u` = 2000):

1. `sha256sum` over those five paths as uid 2000 returns them, and `adb pull` of
   `…/.image/1795722738703.bin` succeeded (3152248 bytes, sha256 `7425349a…69fb`, identical to the
   device-side hash).
2. They are indexed in MediaProvider's `file` table, so an app does not need a path at all:
   `content read --uri content://media/external/file/1000000019` returned 3152248 bytes as uid 2000.
3. The stock Files app (`com.google.android.documentsui`) lists `SystemAndroid` → `Data` →
   `MTU3MDYzNTk1MQ==` and the index DB beside them (`raw/com.netqin.ps/shot-files-*.png`). It shows
   "No items" one level deeper only because the media sits in dot-directories (`.image`, `.video`),
   which DocumentsUI hides by default; the `adb shell` listing above shows them.

The obfuscation is one fixed byte operation, not encryption: **the first 128 bytes are XORed with
0xAF, the other N−128 bytes are untouched**. Measured with `cmp -l` and a per-file XOR reconstruction:

| stored file | original | bytes | differing bytes | where | restored sha256 == original |
|---|---|---|---|---|---|
| 1795722738703.bin | P1.jpg | 3152248 | 128 | offsets 0–127 only | yes |
| 1795722738727.bin | P2.jpg | 7755747 | 128 | offsets 0–127 only | yes |
| 1795722738714.bin | P3.jpg | 2655678 | 128 | offsets 0–127 only | yes |
| 1795722738686.bin | S1.png | 6144771 | 128 | offsets 0–127 only | yes |
| 1795722824813.mp4 | V1.mp4 | 3028330 | 128 | offsets 0–127 only | yes |

The XOR key is the same 128-byte constant `af af af … af` for all five files, and re-XORing the first
128 bytes reproduces the corpus file byte for byte (`restored_*` in `raw/com.netqin.ps/vault/`,
sha256 compared against `corpus.json`). So the "hidden" file is a readable copy missing nothing but
128 masked bytes: **0 bytes of the actual payload are lost or re-encoded**.

A second readable artefact is on the same shared storage:
`/storage/emulated/0/SystemAndroid/Data/322w465ay423xy11` (40960 bytes, SQLite). Its `hideimagevideo`
table stores, per hidden item, the **original path and file name**:

```
1|1570635951|/storage/emulated/0/DCIM/Camera/S1.png|S1.png|…/.image/1795722738686.png|…|1080 x 2400|png|image
2|1570635951|/storage/emulated/0/DCIM/Camera/P1.jpg|P1.jpg|…/.image/1795722738703.jpg|…|4080 x 3072|jpg|image
5|1570635951|/storage/emulated/0/Movies/V1.mp4|V1.mp4|…/.video/1795722824813.mp4|…|mp4|video
```
(`raw/com.netqin.ps/vault/index.db`, pulled with `adb pull`, read with `sqlite3`.)

### (b) in the app's own storage, root only — only previews, no media

`/data/data/com.netqin.ps` (mode 700, owner u0_a192) was pulled whole (175 files, 7.2 MB). No file
there has the size or the hash of any corpus file, and no file's first 128 bytes XORed with 0xAF
start with a JPEG/PNG/MP4 signature. The media itself is not in app-private storage at all; it is in
(a). What *is* app-private is listed under (c).

### (c) smaller preview image — YES, in the app's cache

`/data/data/com.netqin.ps/files/Cache/*.0` holds downscaled copies, two per photo, that the app made
when importing (paths relative to `raw/com.netqin.ps/data/com.netqin.ps/`):

| cache file | bytes | dimensions | matches | MAD vs original rescaled |
|---|---|---|---|---|
| 3ce66b84e34838bd7a76acd98819ecd7.0 | 113712 | 255x192 | P1.jpg | 13.79/255 |
| e4c521e90a7b466fa8af0d6a0755aa10.0 | 113712 | 255x192 | P1.jpg | 13.79/255 |
| a4ae5871416165dd215789f9b11a8577.0 | 100131 | 255x192 | P2.jpg | 8.28/255 |
| f0b14066f3cc0efe0eb5f71ce39114db.0 | 100131 | 255x192 | P2.jpg | 8.28/255 |
| 566668a23708aa02d053e2df585a320f.0 | 62918 | 142x252 | P3.jpg | 6.91/255 |
| 7821999bdee54daf211135de6dd614e3.0 | 62918 | 142x252 | P3.jpg | 6.91/255 |
| 29f6cb52dc764e46a68ff9b3d41a03ad.0 | 380208 | 270x600 | S1.png | 12.36/255 |
| d644dec404568a517c832b6336f48161.0 | 380208 | 270x600 | S1.png | 12.36/255 |

They are visually identical to the originals at reduced size (a 1:16 reduction for the 4080x3072
photos, 1:4 for the 1080x2400 screenshot); MAD 7–14/255 is the difference a different resampling
filter explains, and the label "VAULT TEST S1 / 2026-11-26" is legible in the 270x600 copy
(`raw/com.netqin.ps/shot-*.png` not needed — the file itself was opened and rendered). No preview of
V1 exists. These are app-private (root-only), not on shared storage; the index DB's
`file_bitmap_values` column is a 1-byte placeholder, not a thumbnail.

### PIN — YES, stored in a form that gives the PIN back

`/data/data/com.netqin.ps/databases/contactsDB`, table `private_password`, single row:
`password = 1570635951`. That number is **Java's `String.hashCode("583719")`** (`31×h+c` over the
digits, signed 32-bit). Verified both directions: `hashCode("583719") = 1570635951`, and brute-forcing
all 1 000 000 six-digit strings for that hashCode returns exactly one candidate, `583719`. The same
number is the folder name in (a) and the `password_id` of every index row.

Confirmed as the real credential, not a coincidence: cold-starting the app and entering 1537 gives
"Wrong password, please try again" (`raw/com.netqin.ps/ui-lock-wrong.xml`). Nothing else on the device
holds the PIN: a root-wide `grep -a -r "583719" /data /storage/emulated/0` returns only two Google
Play Services config blobs whose random ids happen to contain the digit string.

### Gallery — NO

Before hiding, MediaStore had images `_id` 1000000019–1000000022 and video `_id` 1000000023 for the
five files. After hiding, `content query --uri content://media/external/images/media` and
`.../video/media` both return "No result found", and the originals are gone from
`/storage/emulated/0/DCIM/Camera` and `/Movies` (both directories empty). The five old rows now appear
in the `file` table as `.bin`/`.mp4` entries pointing into `SystemAndroid`. A gallery reads the images
and video tables, so the hidden photo is not visible in the phone's gallery.

### Verdict, com.netqin.ps

| question | verdict | one line |
|---|---|---|
| (a) readable without root | **YES** | full-size copy in `/sdcard/SystemAndroid/…`, first 128 bytes XOR 0xAF, rest byte-identical |
| (b) root-only copy in app storage | **previews only** | media is not app-private; two small thumbnails per photo are |
| (c) smaller preview | **YES** | 255x192 / 142x252 / 270x600 JPEGs in `files/Cache/*.0` |
| PIN recoverable | **YES** | `contactsDB.private_password.password` = Java hashCode of the PIN, brute-forced back in one pass |
| still in gallery | **NO** | MediaStore image/video rows deleted with the originals |

## 2. com.hld.anzenbokusucal (Sgallery, "Calculator", 11.1.0, vc 810, targetSdk 35)

APK: `install-multiple` of the three files in `latest.xapk.d/`, each sha256 matching `apk.json`
(`e8c7c0db…`, `b676cefd…`, `19002815…`). `apksigner` could not run (no Java Runtime on this Mac), so the
signer check is the study's own `apk.json` entry (`signer_confirmed: true`), not a fresh one.

Onboarding: the launcher is a calculator. Typing `583719` and `=` sets the PIN, a second time
confirms it, then a security question ("Where's my birthplace?" → `prague`), then the app's own
"apply write permission" dialog, which opens the Android *All files access* screen; the toggle was
switched on (`appops get … MANAGE_EXTERNAL_STORAGE` → `allow`). The recovery-email screen was left
empty (it cannot be skipped, `keyevent 4` backs out to the vault). Ads were killed with
`svc wifi disable` + `svc data disable` because an AppLovin fullscreen ad blocked the UI.

Four photos were hidden with the **Encryption** mode (the dialog's preselected option) and the video
likewise. Then, to answer the mode question the same app raises, one extra copy of P1 was planted as
`DCIM/Camera/X1.jpg` and hidden with the **Hidden** mode.

### (a) readable without root — depends on the mode the user picks; default mode: NO

The app again uses shared storage, `/storage/emulated/0/.privacy_safe/`, and two modes write two
different things there.

**Encryption mode (preselected, used for all five corpus items):** ciphertext, not readable.

```
/storage/emulated/0/.privacy_safe/picture/e-35a0bded-…-d714c4b9e214+a   2655680   (P3.jpg 2655678)
/storage/emulated/0/.privacy_safe/picture/e-6ca31dbd-…-5b5b576b28d9+a   3152256   (P1.jpg 3152248)
/storage/emulated/0/.privacy_safe/picture/e-903981b1-…-f77a8b0090fd+b   6144784   (S1.png 6144771)
/storage/emulated/0/.privacy_safe/picture/e-fccd692b-…-d88505b81e3b+a   7755760   (P2.jpg 7755747)
/storage/emulated/0/.privacy_safe/video/e-74a57474-…-9d68c691a32d+l     3028336   (V1.mp4 3028330)
/storage/emulated/0/.privacy_safe/db/privacy_safe.db{,‑shm,‑wal}         4096 / 32768 / 523272
/storage/emulated/0/.privacy_safe/_Files in this directory are very important Please do not delete!  0
```

Evidence it is ciphertext and not a disguise: every file size is the original rounded up to a
multiple of 16 (padding +2 to +13 bytes), Shannon entropy of the 3 MB P1 file is **8.000** over all
256 byte values, and all **197 016 of 197 016** 16-byte blocks are distinct — no ECB, no repeated
header, no JPEG/PNG/MP4 magic at offset 0. The `.db` is SQLCipher (`sqlite3` reports "file is not a
database"). As uid 2000 (`adb unroot`) the five files are readable but return ciphertext only;
their sha256 values are in `raw/com.hld.anzenbokusucal/MANIFEST.txt` and none matches a corpus hash.

**Hidden mode (the other radio button, not preselected):** a byte-identical copy, readable.

```
/storage/emulated/0/.privacy_safe/picture/h-b9f68687-3674-4f0c-b8e8-7f72e7af1012+a   3152248
```
sha256 `d8204717839dca9dbc665eca8325a086538ee6da07520f723c07f9a469d40bed` — **exactly P1.jpg**,
first bytes `ff d8 ff e1 99 f5 45 78 69 66` (JPEG + Exif). Readable as uid 2000 with the same hash,
i.e. by a computer over the cable without root, and by any app with All-files access. 0 bytes differ.

MediaProvider does not index the individual files (dot-directory), only the directory rows
(`file` `_id` 1000000024/25/31/36 for `.privacy_safe`, `db`, `picture`, `video`).

### (b) in the app's own storage, root only — key material, no media

`/data/data/com.hld.anzenbokusucal` (mode 700) holds no media and no corpus bytes; its 12 MB were
pulled whole and classified file by file (`match.py`): the only images are the thumbnails under (c)
and ad creatives. What is app-private is the key material: `shared_prefs/share_privacy_safe.xml`,
whose keys are themselves hex digests and whose values are 16- and 32-byte hex blobs, e.g.
`57DFEA9AEC99CD87013E3862B9DE5B7D = 6B12804AD47A53E4ACE96D991EB7A424`. I tried those blobs, and
MD5/SHA-1/SHA-256 of the PIN and of the security answer, as AES-128/256 keys in CBC (zero IV, file
IV, first/last block) and ECB against the P1 file: no candidate produced JPEG or PNG magic. So root
gives you the ciphertext and the key store, not a directly readable photo; the key is wrapped, and
the wrapper is not the PIN in any naive form.

### (c) smaller preview image — YES

`/data/data/com.hld.anzenbokusucal/cache/image_manager_disk_cache/` (Glide's disk cache) holds
square previews of every hidden item, written while the vault was open:

| cache file | bytes | dims | matches | MAD vs centre-cropped original |
|---|---|---|---|---|
| 215375e413531396dd1eca9676398128234e07d054ae8d476124f8643e1179f9.0 | 52628 | 358x358 | P1.jpg | 11.03/255 |
| 9b9f52ea1c50f7e593d05083ade838d63adf82ef6f523b15d3740be2e947201a.0 | 42976 | 358x358 | P2.jpg | 7.09/255 |
| c8c1ee36a99b6d1152a8065741e6fc948ee8dc04ac367e9a028e93dcb68d5c32.0 | 44675 | 358x358 | S1.png | 8.77/255 |
| f25ce9afef07c3e14118c0f18e8d2d8f6aac51cc5809d528502527a70fa68528.0 | 22104 | 502x362 | a frame of V1.mp4 | 23.59/48x48 (best of all cached images) |
| 080b1b33…, 16b57e01…, 3e4e8f86…, a69b38cf…, d2875628…, 8b0207e1… | 3.6–61 KB | 131x131 / 358x358 / 502x362 | smaller duplicates | |

The P1 preview was rendered and is the same bus at the same crop (`raw/com.hld.anzenbokusucal/thumb_P1.jpg.png`), so this is
a real preview, not a coincidence of colours. These are app-private (root-only) JPEGs, and they were
made regardless of the encryption mode: the encrypted set is visually recoverable as 358-pixel
previews.

### PIN — not found in a recoverable form

Searched every file of the pulled app tree (191 files, 12 MB) for `583719`, `5837`, the reversed
digits, and MD5/SHA-1/SHA-256 of the PIN and of its first four digits in hex (both cases) and Base64:
one hit, `files/al/ad-templates_539_index-legacy.js:947409`, which is a CSS coordinate string
(`…2.22503 20.8625…`), not the PIN. The security answer `prague` is not in the tree either. The only
place a PIN verifier can live is the SQLCipher `privacy_safe.db` or the obfuscated prefs, and a wrong
PIN does not unlock the vault (`111111` + `=` leaves the calculator on screen, no vault). There is,
however, a documented in-app recovery path: the app's own "Important Tips" dialog says that entering
`11223344` in the calculator and pressing `=` opens password recovery through the security question.

### Gallery — NO

`content query` on `media/external/images/media` and `media/external/video/media` both return
"No result found" after hiding, and `/storage/emulated/0/DCIM/Camera` and `/Movies` are empty. The
originals are deleted, not merely hidden.

### Verdict, com.hld.anzenbokusucal

| question | verdict | one line |
|---|---|---|
| (a) readable without root | **NO in Encryption mode, YES in Hidden mode** | encrypted copies (entropy 8.0, +2…+13 B padding) vs a byte-identical `h-…` file when "Hidden" is chosen |
| (b) root-only copy in app storage | **key material only** | no media in `/data/data`; prefs hold wrapped hex blobs; no naive PIN/answer key opens the file |
| (c) smaller preview | **YES** | 358x358 and 502x362 JPEGs in `cache/image_manager_disk_cache/` |
| PIN recoverable | **NO from files** | no plaintext, no md5/sha/javaHash form; wrong PIN rejected; app offers `11223344` recovery by design |
| still in gallery | **NO** | MediaStore image/video rows gone, originals deleted |

## 3. com.fourchars.lmpfree (LockMyPix, 6.1.5.8 Gemini, vc 9000461, targetSdk 36)

Splits `com.fourchars.lmpfree.apk` + `config.arm64_v8a.apk` + `config.xxhdpi.apk`, sha256 all matching
`apk.json`. Onboarding: create PIN `583719` on the in-app keypad, confirm, skip the e-mail recovery
(the "I want to skip the password recovery" button), skip the intro, cancel the (network-less)
purchase sheet, grant All-files access, then Photos tab → Camera → select all → Import (Standard) →
"hide the protected files from the public gallery" (the preselected answer) → NEXT; the same for
Videos → Movies → V1.mp4. The app also disables the soft keyboard path, so all input was `uiautomator`
taps.

### (a) readable without root — encrypted, but everything needed to attack it is readable

Layout, all on shared storage under `/storage/emulated/0/.LockMyPix/`, all mode 660 and readable as
uid 2000 (`adb unroot`; hashes below taken as uid 2000):

```
.ini.keyfile.ctr                    16 bytes   52b7c2d7f8cafc6c6307ba38b3aeba72
.encrypt/blgDEd2e06DhnU2t19xxww.6zu 3152248    (= P1.jpg size, no padding, no header)
.encrypt/_m-bdlJ7yhwyAoppJ7pDHg.6zu 7755747    (= P2.jpg)
.encrypt/xdx_mzmdft4b2Vic9MlvOw.6zu 2655678    (= P3.jpg)
.encrypt/bEjkeRzIoJ_nlg3fyOUwIw.p5o 6144771    (= S1.png)
.encrypt/ECzc4JGppm300v1hOBrolw.vp3 3028330    (= V1.mp4)
.encrypt_prev/<same names>          17595 … 69943   (previews, see (c))
.prev/<same names>                  identical sizes to .encrypt_prev
.prev_hd/.nomedia                   0
.tmp                                0
db/sort.db                          36864   plain SQLite
db/flc.db, db/.tiger.db             32768 / 16384   SQLCipher ("file is not a database")
```

Every ciphertext is exactly the size of its plaintext — a stream cipher, no padding, no header. The
APK's `classes*.dex` strings name the primitive: `AES/CTR/NoPadding` next to `KEYFILE_CTR`,
`AES/CBC/PKCS7Padding` next to `KEYFILE_ECB`.

Four measured facts about the stream:

1. **The keystream is the same for every file.** XOR of `blgDE…6zu` with P1.jpg gives a 3 152 248-byte
   keystream; the first 64 bytes of the same XOR for P2 are identical; XORing `xdx…6zu` with that
   keystream returns P3.jpg **byte for byte** (`d == P3`), and `bEjke…p5o` returns the PNG signature
   `89 50 4e 47 0d 0a 1a 0a`. There is no per-file IV.
2. The keystream is not periodic at 16, 256, 1024, 4096, 8192, 65 536 or 1 048 576 bytes, so it is a
   real cipher stream, not a repeated XOR pad.
3. The 16-byte key file is stored in the same public directory, unprotected. I could **not** finish the
   decryption from the key file alone: AES-CTR with that key over counters 0–65 535 in 128-bit
   big-endian, little-endian, and 64-bit low/high layouts, plus ECB-of-zero probes and MD5/SHA-256
   derivations mixing the PIN, produced no match to the first keystream block
   `1ed8a1bc b5b3ac05 1b44d556 c7cbd406`. So the file is likely a wrapped key, and the real AES key and
   its counter are elsewhere (the SQLCipher `flc.db` or the Android Keystore). What is proven is the
   weaker but sufficient statement: **a single known plaintext (any file whose content the attacker
   knows, e.g. one they hide themselves) yields the keystream and decrypts every other vault file of
   that device**, because the stream does not change per file. The previews under (c) were recovered
   exactly this way.
4. `db/sort.db` is plaintext on shared storage and maps each obfuscated name to the **original folder**:
   `blgDEd2e06DhnU2t19xxww.6zu | storage/emulated/0/DCIM/Camera/`,
   `ECzc4JGppm300v1hOBrolw.vp3 | storage/emulated/0/Movies/`.

### (b) in the app's own storage, root only — nothing but encrypted preferences

`/data/data/com.fourchars.lmpfree` (8.9 MB pulled, 125 files) holds no media and no corpus bytes. The
only image in it is an ad creative. The PIN lives in `shared_prefs/secret_shared_prefs.xml`, an
`androidx.security.crypto` EncryptedSharedPreferences store: its keys are AES-SIV ciphertext and the
file carries a Tink keyset (`__androidx_security_crypto_encrypted_prefs_key_keyset__`, master key in
the Android Keystore). Nothing in the tree is a photo; root gives you the wrapped PIN store, not the
PIN.

### (c) smaller preview image — YES, and I decrypted them

`/storage/emulated/0/.LockMyPix/.encrypt_prev/` holds one preview per hidden item, encrypted with the
same stream. XOR with the keystream recovered from P1 turns all five into valid JFIF files
(`raw/com.fourchars.lmpfree/dec_thumb_*`):

| file | bytes | decoded size | original |
|---|---|---|---|
| blgDEd2e06DhnU2t19xxww.6zu | 69943 | 520x391 | P1.jpg (4080x3072) |
| _m-bdlJ7yhwyAoppJ7pDHg.6zu | 59856 | 520x391 | P2.jpg (4080x3072) |
| xdx_mzmdft4b2Vic9MlvOw.6zu | 39080 | 292x520 | P3.jpg (2268x4032) |
| bEjkeRzIoJ_nlg3fyOUwIw.p5o | 24130 | 234x520 | S1.png (1080x2400) |
| ECzc4JGppm300v1hOBrolw.6zu | 17595 | 720x405 | V1.mp4 (1920x1080) |

The 520x391 P1 preview was opened and is the same bus at the same crop. `.prev/` holds a second copy of the same five previews under the same names and sizes, encrypted
differently (the CTR keystream does not open it); app-private storage holds none.

### PIN — not recoverable from files

The PIN is nowhere in plain or hashed form: `pin.py` over all 125 app-private files plus every
shared-storage vault file gives one hit, inside an advertising JS template
(`files/al/ad-templates_538_…index-legacy.js`, a CSS coordinate string), not the PIN. A wrong PIN
(`111111`) does not unlock the vault; the lock screen stays up and shows a "Password recovery" banner.

### Gallery — NO

`content query` on the images and video collections returns "No result found" after hiding, and
`/storage/emulated/0/DCIM/Camera` and `/Movies` are empty. The app asked whether to "completely hide"
or "also remain visible in the normal gallery"; the default was completely hide, and that is what it did.

### Verdict, com.fourchars.lmpfree

| question | verdict | one line |
|---|---|---|
| (a) readable without root | **NO plaintext; YES with one known plaintext** | AES-CTR ciphertext, no padding; fixed keystream for all files, key file and plaintext DB index on `/sdcard` |
| (b) root-only copy in app storage | **no media** | only EncryptedSharedPreferences; media never enters `/data/data` |
| (c) smaller preview | **YES** | 520x391 / 292x520 / 234x520 / 720x405 previews in `.encrypt_prev`, decrypted in this run |
| PIN recoverable | **NO from files** | androidx EncryptedSharedPreferences with Keystore-wrapped keyset |
| still in gallery | **NO** | rows removed, originals deleted |

## 4. com.softin.gallery ("Secret Photo Album", 1.1.33, vc 53, targetSdk 36)

Four splits (base + arm64_v8a + en + xxhdpi), sha256 matching `apk.json`. Onboarding: skip the intro,
"Set Album Password" → Password Length → **6-digit** → `583719` twice, create the Default Album, add
photos/videos, Select all (5), Import, then "Imported 5 files, Delete from local album?" → Delete
(the app marks this the default) and the MediaProvider confirmation → Allow. The launcher is a normal
gallery-looking app, not a calculator.

### (a) readable without root — NO

Nothing of the corpus is left on shared storage: a full root `sha256sum` walk of
`/storage/emulated/0` finds no corpus hash, `/storage/emulated/0/DCIM/Camera` and `/Movies` are empty,
no new directory appeared next to `Alarms`, `DCIM`, … and `Android/data/com.softin.gallery` holds only
an ad SDK's `mb/` cache. The only media-typed leftovers on `/sdcard` are the two `.thumbnails` caches
that existed before the test (36-byte `.database_uuid` files only).

### (b) in the app's own storage, root only — YES, full-size, decodable

The five files move into `/data/data/com.softin.gallery/files/` under a numeric name with the
original extension, mode 600, owner u0_a192:

```
17957249268844026002892786759800.jpg  3152248   P1.jpg
17957249272651463755066569572864.jpg  7755747   P2.jpg
17957249274777360854622548760088.jpg  2655678   P3.jpg
17957249275671033879978003217047.png  6144771   S1.png   (sha256 identical to the original)
17957249276073040454580384163548.mp4  3028330   V1.mp4
```

As uid 2000 all five are `Permission denied`; as root they pull cleanly. Byte comparison (`cmp -l` plus
a per-file XOR/offset pass) shows the stored file is the original with **metadata bytes set to zero**
and nothing else touched:

| stored | original | differing bytes | offsets | what was zeroed |
|---|---|---|---|---|
| 17957249268844…jpg | P1.jpg | 38 | 998–1211 | bytes inside the EXIF APP1 block, 1–10 per run, all written as 0x00 |
| 17957249272651…jpg | P2.jpg | 39 | 998–1211 | same |
| 17957249274777…jpg | P3.jpg | 40 | 974–1199 | same |
| 17957249275671…png | S1.png | 0 | — | exact copy |
| 17957249276073….mp4 | V1.mp4 | 16 | 12189–12217 | the `loci` (location) box payload, four runs of 4–5 bytes |

All three JPEGs still decode at the original dimensions (4080x3072, 4080x3072, 2268x4032) and
`match.py` reports **SAME PIXELS** as P1/P2/P3 — the metadata scrub does not touch the image data.
The Room database `databases/app-db` (plain SQLite, not encrypted) keeps the mapping and the original
locations: `afiles` row 1 = `P1.jpg | file:///data/user/0/com.softin.gallery/files/17957249268844….jpg |
/storage/emulated/0/DCIM/Camera/P1.jpg`, and likewise for the other four.

### (c) smaller preview image — YES

`/data/data/com.softin.gallery/cache/image_manager_disk_cache/` (Glide) keeps two 268x231 copies per
photo while the album is open; 34 580 B (P1), 24 906 B (P2), 21 933 B (S1), plus `cache/*.png` app
assets. The 268x231 file for P1 was rendered and is the same bus scene
(`raw/com.softin.gallery/thumb_P1_268.png`); it is fitted, not cropped, so its MAD against a cover-crop is large
(56/255) while the picture is identical by eye. These are app-private, root-only.

### PIN — not recoverable

`pin.py` over all 139 app-private files finds only the advertising-JS false positive. What the app
keeps is an opaque marker in `shared_prefs/config.xml`:

```
<int name="album_user_key_length" value="6"/>
<string name="key">3DEFF82E946E7AF83D9EB2BFCBD5E3E389A4E7A95B0228C6AB11586CBAF6647A3A47542CD03DB4156E76275D45C3C8239D870B92</string>
```

50 bytes of hex, not equal to MD5/SHA-1/SHA-256 of `583719` in any case, and not containing one. A
wrong PIN gives "Password Incorrect" and leaves the keypad on screen, with a "Forgot password?" button
beside it.

### Gallery — NO

MediaStore's image and video collections both return "No result found", the originals are gone from
`/sdcard`, and the app enforced the deletion through MediaProvider's own confirmation dialog
("Allow Secret Photo Album to delete 5 items?").

### Verdict, com.softin.gallery

| question | verdict | one line |
|---|---|---|
| (a) readable without root | **NO** | nothing of the corpus on shared storage |
| (b) root-only copy in app storage | **YES** | full-size files in `/data/data/…/files/`, EXIF and MP4 location bytes zeroed, image data untouched |
| (c) smaller preview | **YES** | 268x231 Glide thumbnails in app cache |
| PIN recoverable | **NO** | only a 50-byte opaque `key`; wrong PIN rejected |
| still in gallery | **NO** | rows deleted through MediaProvider, originals removed |

## 5. com.calculator.lock.hide.photo.video ("Calculator Lock", 1.180, vc 180, targetSdk 36)

Three splits (base + arm64_v8a + xhdpi), sha256 matching `apk.json`. Onboarding: consent, language
English, "Create New Password" — the app only accepts **4 digits**, so `5837` was used (the first four
of 583719) and confirmed, the security question skipped ("Skip", counter `COUNT_SKIP_SECURE_QUESTION`
= 2), through the intro, and into the vault. The launcher is a calculator; the vault opens by typing
the PIN followed by `=`. Photos → Gallery → tap 4 → HIDE (4); Videos → Gallery → tap → HIDE (1).

### (a) readable without root — YES, and this is the worst case of the five

The app **moves the files into shared storage unchanged**, under a dot-directory, keeping the original
name as a suffix. Nothing is encrypted, nothing is re-encoded:

```
/storage/emulated/0/Pictures/.Calculator_Lock/Photos/0_P3.jpg   2655678
/storage/emulated/0/Pictures/.Calculator_Lock/Photos/1_S1.png   6144771
/storage/emulated/0/Pictures/.Calculator_Lock/Photos/2_P1.jpg   3152248
/storage/emulated/0/Pictures/.Calculator_Lock/Photos/3_P2.jpg   7755747
/storage/emulated/0/Pictures/.Calculator_Lock/Videos/4_V1.mp4   3028330
```

All five sha256 values equal the corpus (`3a222c0c…`, `d9f15e63…`, `d8204717…`, `ea539465…`,
`051df7e4…`), i.e. **0 bytes differ** on all five, and the file names still contain the original ones.
As uid 2000 (`adb unroot`) all five hash identically and `adb pull` of `2_P1.jpg` returns the exact
3152248 bytes; mtimes were preserved from the originals. The files are mode 660, readable by any app
with All-files access, and MediaProvider still holds their rows (`file` `_id` 1000000019–1000000023,
`mime_type` image/jpeg, image/png, video/mp4, `is_pending=0`, `is_trashed=0`,
`relative_path=Pictures/.Calculator_Lock/Photos/`).

### (b) in the app's own storage, root only — nothing relevant

`/data/data/com.calculator.lock.hide.photo.video` (123 files, 7.2 MB) holds no media copy; the media
never enters app-private storage. App-private here holds only the PIN (see below) and the Glide cache.

### (c) smaller preview image — YES

`cache/image_manager_disk_cache/` holds two sizes per item: 348x348 and 220x220 JPEGs
(92511a4c… = 348x348 of P1, 42 KB; ec5e30b4… = 220x220 of P1, 25 KB; f04e4227… / 7c89242d… for P2;
f2a1b799… / 3e6dd1fc… for S1). The 348x348 P1 preview was rendered and shows the same bus. App-private,
root-only.

### PIN — YES, in plain text

`/data/data/com.calculator.lock.hide.photo.video/shared_prefs/com.calculator.lock.hide.photo.video_preferences.xml`:

```xml
<boolean name="SET_PASSWORD" value="true" />
<string name="PASSWORD">5837</string>
<int name="COUNT_SKIP_SECURE_QUESTION" value="2" />
```

No hashing, no obfuscation, no keystore. The app also prints its own recovery code on the intro screen:
"Type '11223344=' when you forgot password".

### Gallery — NO, but the media is still one directory listing away

`content query` on `media/external/images/media` and `.../video/media` returns "No result found" —
MediaProvider hides everything under a dot-directory from the media views, so the phone's gallery does
not show the photo. The rows themselves survive in the `file` table with their real mime types and a
non-hidden, non-pending state, and the files are plainly readable at their paths.

### Verdict, com.calculator.lock.hide.photo.video

| question | verdict | one line |
|---|---|---|
| (a) readable without root | **YES** | `/sdcard/Pictures/.Calculator_Lock/` holds all five files byte-identical to the originals |
| (b) root-only copy in app storage | **no media** | only the PIN and thumbnails are app-private |
| (c) smaller preview | **YES** | 348x348 and 220x220 Glide thumbnails |
| PIN recoverable | **YES** | `PASSWORD` in `shared_prefs`, plain text |
| still in gallery | **NO** | hidden by the dot-directory, not by deletion |

## Summary across the five apps

| app | (a) readable without root | (b) app-private, root only | (c) smaller preview | PIN in recoverable form | still in the gallery |
|---|---|---|---|---|---|
| com.netqin.ps | **yes, one XOR away** — full-size copy in `/sdcard/SystemAndroid/Data/<id>/` (`.image/`, `.video/`); first 128 B XOR 0xAF, rest identical | no media; only the thumbnails | **yes** — 255x192 / 142x252 / 270x600 in `files/Cache` | **yes** — `contactsDB.private_password.password` = Java `hashCode("583719")` = 1570635951, brute-forced back uniquely | no |
| com.hld.anzenbokusucal | **no** in the default Encryption mode (AES-CTR, entropy 8.0); **yes, byte-identical** in the "Hidden" mode (`h-…` file) | key material only (wrapped hex blobs in `share_privacy_safe.xml`) | **yes** — 358x358, 502x362 in `cache/image_manager_disk_cache` | no (no plaintext, no md5/sha1/sha256/javaHash form; wrong PIN rejected) | no |
| com.fourchars.lmpfree | **no plaintext**; AES-CTR, but the keystream is identical for every file and `.ini.keyfile.ctr` sits beside the data — one known plaintext opens the set | no media; PIN in androidx EncryptedSharedPreferences | **yes** — 520x391 / 292x520 / 234x520 / 720x405 in `.encrypt_prev`, decrypted in this run | no (Keystore-wrapped) | no |
| com.softin.gallery | **no** | **yes** — full-size files in `/data/data/…/files/`, EXIF (38–40 B) and the MP4 `loci` box (16 B) zeroed, image data untouched | **yes** — 268x231 Glide cache | no (50-byte opaque `key`; wrong PIN rejected) | no |
| com.calculator.lock.hide.photo.video | **yes, byte-identical** — `/sdcard/Pictures/.Calculator_Lock/`, original names kept as suffixes | no media | **yes** — 348x348 and 220x220 Glide cache | **yes** — `<string name="PASSWORD">5837</string>` in `shared_prefs`, plain text | no |

### What the five answers add up to

- **A readable copy of what was hidden survives in every one of the five apps.** Three leave it in
  full size on shared storage: com.calculator.lock.hide.photo.video leaves the file untouched with its
  original name inside it, com.netqin.ps leaves it with only its first 128 bytes masked by a constant
  XOR, and com.hld.anzenbokusucal leaves it untouched whenever the user picks "Hidden" instead of the
  preselected "Encryption". A fourth, com.fourchars.lmpfree, encrypts properly but with one stream for
  all files and the key file in the same public folder, so a single known plaintext recovers the rest;
  its previews were decrypted that way in this run. Only com.softin.gallery keeps everything in
  app-private storage, and there the photo is still a full-size, decodable file — just behind root.
- **The "smaller preview" case is universal**: all five keep a downscaled JPEG of the hidden photo
  (220x220 to 720x405), in the app's own cache in four apps and in `.encrypt_prev` on shared storage in
  the fifth. For com.fourchars.lmpfree those previews are cryptographically protected only by the same
  fixed keystream that the full files use.
- **The unlock PIN is recoverable in two of five**: plain text in com.calculator.lock.hide.photo.video,
  and a Java `String.hashCode` in com.netqin.ps — a 32-bit value that a one-million-entry table
  inverts instantly. The other three keep it behind a keystore-wrapped store or an opaque blob.
- **The gallery question is consistently "no"**, and every app achieves it by deletion plus a
  MediaStore update, not by hiding the row: the image and video collections are empty in all five
  cases, while in com.calculator.lock.hide.photo.video the `file` rows survive with real mime types and
  the originals sit in a dot-directory whose name contains `Calculator_Lock`.

### Raw material

`raw/<pkg>/` holds, per app: `scan-post.txt` (every file under `/storage/emulated/0`, `/data/data/<pkg>`,
`/data/user/0/<pkg>` and `/data/local/tmp` with size, mode, owner, mtime and sha256), `MANIFEST.txt`,
the pulled vault tree (`vault/`), the pulled app-private tree (`data/`), UI dumps and screenshots.
`raw/baseline_sdcard.txt` is the pre-install state of the storage volume for the last boot.
The comparison scripts are `scratch/sig.py`, `scratch/match.py`, `scratch/pin.py`, `scratch/scan.sh`.

VERDICT: DONE
