iBotPeaches/Apktool · error · AndrolibException
Repeated alias: pkgId=0x%02x, aliasId=%s
Error message
Repeated alias: pkgId=0x%02x, aliasId=%s
What it means
AndrolibException thrown by ResPackage.addAlias(aliasId, finalId) when the alias id is already mapped in mAliases. Aliases redirect one resource id to another (common in obfuscated/collapsed resource tables); each alias id may be registered only once. Note the sibling resolveAlias throws 'alias: pkgId=..., aliasId=...' (error in the same SOURCE block) when looking up an unregistered alias.
Source
Thrown at brut.apktool/apktool-lib/src/main/java/brut/androlib/res/table/ResPackage.java:346
return mOverlayables.values();
}
public boolean isAlias(ResId resId) {
return mAliases.containsKey(resId);
}
public ResId resolveAlias(ResId aliasId) throws UndefinedResObjectException {
ResId resId = mAliases.get(aliasId);
if (resId == null) {
throw new UndefinedResObjectException(
String.format("alias: pkgId=0x%02x, aliasId=%s", getId(), aliasId));
}
return resId;
}
public void addAlias(ResId aliasId, ResId finalId) throws AndrolibException {
if (mAliases.containsKey(aliasId)) {
throw new AndrolibException(
String.format("Repeated alias: pkgId=0x%02x, aliasId=%s", getId(), aliasId));
}
mAliases.put(aliasId, finalId);
}
public int getAliasCount() {
return mAliases.size();
}
public Map<ResId, ResId> getAliases() {
return mAliases;
}
@Override
public String toString() {
return String.format("ResPackage{id=0x%02x, name=%s}", getId(), getName());
}View on GitHub (pinned to 79b63384d7)
Solutions
- Before addAlias, check getAliases().containsKey(aliasId) and skip or update instead of re-adding.
- For parsed files, a genuine duplicate alias indicates corruption — validate with aapt2 and re-obtain the APK.
- Keep alias generation deterministic (sort/dedupe) when emitting arsc yourself.
Example fix
// before
pkg.addAlias(aliasId, finalId); // throws if already mapped
// after
if (!pkg.getAliases().containsKey(aliasId)) {
pkg.addAlias(aliasId, finalId);
} Defensive patterns
Strategy: validation
Validate before calling
if (!pkg.getAliases().containsKey(aliasId)) {
pkg.addAlias(aliasId, finalId);
} Try / catch
try {
pkg.addAlias(aliasId, finalId);
} catch (AndrolibException ex) {
// duplicate alias mapping -> corrupt or replayed table; report
} Prevention
- Check getAliases() before registering an alias
- Dedupe alias tables when emitting arsc
- Do not re-parse into an already populated ResPackage
When it happens
Trigger: An arsc with two alias definitions for the same source id; programmatic table construction registering the same alias twice; alias chains where an id is both alias and target mapped repeatedly.
Common situations: Resource-obfuscation output (collapsed ids) with duplicated mapping entries; merged or patched arsc files; rebuild tools replaying alias registration.
Related errors
- type spec: pkgId=0x%02x, typeId=0x%02x
- Repeated type spec: pkgId=0x%02x, typeId=0x%02x, typeName=%s
- entry spec: pkgId=0x%02x, typeId=0x%02x, entryId=0x%04x
- Repeated entry spec: pkgId=0x%02x, typeId=0x%02x, entryId=0x
- Repeated entry: pkgId=0x%02x, typeId=0x%02x, entryId=0x%04x,
AI-assisted analysis of iBotPeaches/Apktool@79b63384d7 (2026-08-14).
Data as JSON: /api/errors/4862bffc06052e87.
Report an issue: GitHub.