mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-05-08 09:44:26 +02:00
compare configs with more specific
This commit is contained in:
parent
a1b44908a9
commit
e53f294258
@ -47,6 +47,30 @@
|
||||
this.configSize.setBlockLoad(this);
|
||||
this.mQualifiersStamp = 0;
|
||||
}
|
||||
public boolean isEqualOrMoreSpecificThan(ResConfig resConfig){
|
||||
if(resConfig == null){
|
||||
return false;
|
||||
}
|
||||
if(resConfig == this || resConfig.isDefault()){
|
||||
return true;
|
||||
}
|
||||
byte[] bytes = ByteArray.trimTrailZeros(this.mValuesContainer.getBytes());
|
||||
byte[] otherBytes = ByteArray.trimTrailZeros(resConfig.mValuesContainer.getBytes());
|
||||
int max = otherBytes.length;
|
||||
if(max > bytes.length){
|
||||
return false;
|
||||
}
|
||||
for(int i=0; i<max; i++){
|
||||
byte other = otherBytes[i];
|
||||
if(other == 0){
|
||||
continue;
|
||||
}
|
||||
if(bytes[i] != other){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void copyFrom(ResConfig resConfig){
|
||||
if(resConfig==this||resConfig==null){
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user