split decision: one app spread over a base apk and a feature split

huntress ctf 2026, day 26 · mobile android · all three modes

tools used: android apk toolkit and timed-attempt pipeline.

"reassemble evidence distributed across base and configuration splits." the artifact was an .apks bundle: a zip holding base.apk and feature.apk, the shape an app takes when it is installed as split apks (adb install-multiple takes such a set). the single kept the old split puzzle in the base apk with one of its parts left empty, and put the missing part in the feature split. the time trial and one mastery set were computed-code puzzles whose dalvik code opens the feature split at run time and reads sixteen bytes from it.

the key insight: a bundle is one app. the apk that carries the code is the app, every other apk is a split that android installs beside it and lists in ApplicationInfo.splitSourceDirs, and anything the code reads from a split is part of the answer. our toolkit treated each apk as a whole app, so the first reading of the single and of the time trial saw half of the evidence.

challenge shape

single         1 field    the answer code of a split puzzle whose parts
                          are spread over base.apk and feature.apk
time trial     1 field    the answer code of a computed-code bundle that
                          reads a split's asset
mastery       10 fields   one code per set: nine single computed-code apks
                          and one bundle like the time trial's

artifact anatomy

the single's bundle is two stored zip members, base.apk and feature.apk. the base apk has a manifest, a classes.dex of a few kib, a signature and the puzzle file:

{"schema": "<puzzle schema v1>", "day": 26, "codec": "split",
 "data": "", "parts": ["", "<part>", "<part>"], "order": [<3 indices>]}

the feature apk has no dex. its manifest declares split="<name>" on the root element and hasCode="false" on the application, which is what makes it a split rather than an app, and its assets hold one more json:

{"codec": "split", "day": 26, "feature": "<split name>",
 "part": "<part>", "part_index": <index>}

part_index names the empty slot of the base's parts. filled, the three parts join by order like any day-5 split puzzle into ANS- and sixteen uppercase hex digits.

the time trial's bundle has the same two apks with different contents. the base's puzzle file says schema v2, codec analysis and a build id, and nothing else; its dex (about 6.3 kib) computes the code. the feature apk carries a sixteen-byte assets/huntress_feature.bin instead of a json. the call graph, method-name suffixes left out:

Release.code(ctx)          keeps ctx in a static, then "ANS-" + 16 hex
                           nibbles of Util.finPart(Mix.f1(token())) ^ K
Release.token()            Core.mergeBase(Guard.scanMerge(Core.mixSplit(C)))
Guard.scanMerge(x)         two Probe.s3 searches over constants, packed
                           by SplitDecision.splitIndex(a, b) = a << 4 | b,
                           folded into x with 64-bit multiplies and xors
Core.mergeBase(x)          b = Assets.readSplit("huntress_feature.bin");
                           hi = b[0..7], lo = b[8..15] as big-endian longs;
                           x ^= hi, rotate, multiply, x += lo, ...
Assets.readSplit(name)     for each path in
                             ctx.getApplicationInfo().splitSourceDirs:
                             zip = new ZipFile(path)
                             entry = zip.getEntry("assets/" + name)
                             if entry: read 16 bytes, return them
                           throw FileNotFoundException

so the answer depends on bytes that exist only in the split, reached through the installed split's path and the platform zip reader rather than through the asset manager.

extraction method

for the single, the apk toolkit now puts every apk's members of a bundle in view under the apk's name, finds the puzzle in the base and any feature json beside it, and fills each empty slot before the join:

filled = list(puzzle["parts"])
for rel in sorted(files):
    if not FEATURE_JSON.search(rel):
        continue
    for row in rows_of(json.loads(files[rel])):
        at = row.get("part_index")            # or one of its synonyms
        if "part" not in row or at is None:
            continue
        while len(filled) <= at:
            filled.append("")                 # an index past the list appends
        if filled[at] in ("", None):
            filled[at] = str(row["part"])     # never overwrite a base part

the filled puzzle then goes through the split codec unchanged: both index readings of order, the answer-shape check, the chain fallback. by hand, with the standard library (the bundle's two apks are stored members):

import io, json, zipfile

bundle = zipfile.ZipFile("split_decision.apks")
base = zipfile.ZipFile(io.BytesIO(bundle.read("base.apk")))
feature = zipfile.ZipFile(io.BytesIO(bundle.read("feature.apk")))
puzzle = json.loads(base.read("assets/huntress_puzzle.json"))
extra = json.loads(feature.read("assets/huntress_feature.json"))
parts = list(puzzle["parts"])
parts[extra["part_index"]] = extra["part"]
placed = [part for _, part in sorted(zip(puzzle["order"], parts))]
print("".join(placed))                 # part i sits at position order[i]

for the timed modes the dalvik interpreter we wrote for day 23 runs the answer method. on day 26 it learned the bundle. the set's apks are told apart by content: an apk with a dex is the app (base.apk when several have code), and an apk with a manifest and no dex is a split, keyed by the device path android would give it, /data/app/<package>/<name>. the context's application info carries those paths, and a ZipFile opened on one of them reads that split's members:

if name == "getApplicationInfo":
    return Named("appinfo", vm.package, {
        "sourceDir": vm.apk_path,
        "publicSourceDir": vm.apk_path,
        "packageName": vm.package,
        "splitSourceDirs": Array("[Ljava/lang/String;", sorted(vm.splits)),
        "splitPublicSourceDirs": Array("[Ljava/lang/String;", sorted(vm.splits)),
    })

# java.util.zip.ZipFile.<init>(String path)
if path in vm.splits:
    return Named("zip", path, vm.splits[path])   # the split's members
if path != vm.apk_path:
    raise ValueError(f"ZipFile({path!r}): only the app's own apk and its splits "
                     f"{sorted(vm.splits)} are read")

getEntry, getInputStream and getSize read from whichever member map the zip object carries, so readSplit finds its entry in the feature split, returns the sixteen bytes, and the rest of the computation is day 23's arithmetic.

validation and answer formatting

the result must match the question's own pattern, ANS- and exactly sixteen uppercase hex digits. for the single, a feature part never overwrites a part the base already has, and a filled puzzle that joins to no answer-shaped string still fails rather than returning a near miss. for the computed sets the string is the one the app's own loop builds, sixty bits down to zero in steps of four. the codes are submitted as computed: ANS-7E37D134754DEA01 for the single, ANS-32D0C9401EF0A2AC for the time trial and ANS-212F2BF216EC4E1C, ANS-73C001352CE13865, ANS-70FA830E7174DB0E and seven more for the mastery's ten sets.

failed approaches and pivots

the first reading of the single joined the parts it had and failed: two of three parts in either index reading cannot make sixteen hex digits. a puzzle with an empty part is a puzzle that says where to look next, and in a bundle the next place is the other apk.

the time trial's first run stopped with the interpreter's error for a field it did not emulate: splitSourceDirs of the application info record. the record held the base apk's path and the package name and nothing else, and ZipFile opened only the base apk. both had to change together, and the error named the field but not the framework call that built the record, so the fix began by finding that call in the interpreter's source. a missing field of an emulated record now names the call that built it and the keys it has.

automation across modes

the mastery's ten sets were nine single computed-code apks, labelled with days of the event from 2 to 24, and one bundle like the time trial's. a set with one apk is that apk, a set with several is a bundle; the interpreter itself took well under a second for all ten.

lessons

solve times

public scoreboard · day 26 finish: below top 10

  • 0:29.2single#3 of 154 solvers
  • 3:05.0time trial#15 of 149 solvers
  • 3:18.1mastery#8 of 147 solvers
  • #32team day finishof 135 teams that cleared it, in 19:21.9
  • #3single orderof the day's 7, by our flag time

from the public scoreboard: 09:00 et release to our flag; the table below counts from our attempt's start.

from when we started working on the mode to its flag. the single was submitted by hand, so its row uses the flag time the event recorded.

mode work to flag attempts wrong submits
single 27.5s 1 0
time trial 142.8s 2 0
mastery 11.7s 1 0

the clock

server timer of the winning attempt; used is attempt start to flag, left is what remained on the clock.

mode time available time used time left
time trial 50.0s 0.7s 49.3s
mastery 320.0s 11.7s 308.3s

where we got stuck

flags: single, time trial, and mastery [redacted].

{generated by a clanker}