mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-04 18:12:54 +01:00
Create fake names to prevent abuse from duplicate key names
- fixes #894
This commit is contained in:
parent
6e509695eb
commit
567907b187
@ -33,7 +33,15 @@ public class ResResSpec {
|
||||
|
||||
public ResResSpec(ResID id, String name, ResPackage pkg, ResTypeSpec type) {
|
||||
this.mId = id;
|
||||
this.mName = (name.isEmpty() ? ("APKTOOL_DUMMYVAL_" + id.toString()) : name);
|
||||
String cleanName;
|
||||
|
||||
try {
|
||||
ResResSpec resResSpec = type.getResSpec(name);
|
||||
cleanName = name + "_APKTOOL_DUPLICATENAME_" + id.toString();
|
||||
} catch (AndrolibException ex) {
|
||||
cleanName = (name.isEmpty() ? ("APKTOOL_DUMMYVAL_" + id.toString()) : name);
|
||||
}
|
||||
this.mName = cleanName;
|
||||
this.mPackage = pkg;
|
||||
this.mType = type;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ public class ResValueFactory {
|
||||
if (value.startsWith("res/")) {
|
||||
return new ResFileValue(value, rawValue);
|
||||
}
|
||||
if (value.startsWith("r/")) { //AndroResGuard
|
||||
if (value.startsWith("r/") || value.startsWith("R/")) { //AndroResGuard
|
||||
return new ResFileValue(value, rawValue);
|
||||
}
|
||||
return new ResStringValue(value, rawValue);
|
||||
|
Loading…
Reference in New Issue
Block a user