mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-05-08 09:44:26 +02:00
decode unknown resource id as hex
This commit is contained in:
parent
a7b3a466d0
commit
0e161a4321
@ -479,9 +479,12 @@ public class ResXmlPullParser implements XmlResourceParser {
|
||||
if(attribute==null){
|
||||
return null;
|
||||
}
|
||||
String name = mDecoder.decodeResourceName(attribute.getNameResourceID());
|
||||
if(name == null){
|
||||
String name;
|
||||
int resourceId = attribute.getNameResourceID();
|
||||
if(resourceId == 0 || mDecoder==null){
|
||||
name = attribute.getName();
|
||||
}else {
|
||||
name = mDecoder.decodeResourceName(attribute.getNameResourceID(), true);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
@ -39,12 +39,24 @@ public class Decoder {
|
||||
this.currentPackageId = currentPackageId;
|
||||
}
|
||||
public String decodeResourceName(int resourceId){
|
||||
return decodeResourceName(resourceId, true);
|
||||
}
|
||||
public String decodeResourceName(int resourceId, boolean defaultHex){
|
||||
if(resourceId == 0){
|
||||
return null;
|
||||
}
|
||||
EntryGroup entryGroup = getEntryStore().getEntryGroup(resourceId);
|
||||
if(entryGroup!=null){
|
||||
return entryGroup.getSpecName();
|
||||
}
|
||||
if(defaultHex){
|
||||
return hexResourceName(resourceId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private String hexResourceName(int resourceId){
|
||||
return String.format("@0x%08x", resourceId);
|
||||
}
|
||||
public String decodeValue(Value value){
|
||||
if(value==null){
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user