mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-05-01 14:44:27 +02:00
trim min possible config size
This commit is contained in:
parent
10016e68ad
commit
a1b44908a9
@ -108,6 +108,11 @@
|
|||||||
setConfigSize(size);
|
setConfigSize(size);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
public void trimToMinimumSize(){
|
||||||
|
int size = ByteArray.trimTrailZeros(mValuesContainer.getBytes()).length + 4;
|
||||||
|
size = nearestSize(size);
|
||||||
|
trimToSize(size);
|
||||||
|
}
|
||||||
|
|
||||||
public void setMcc(int value){
|
public void setMcc(int value){
|
||||||
if(getConfigSize()<SIZE_16){
|
if(getConfigSize()<SIZE_16){
|
||||||
@ -882,6 +887,30 @@
|
|||||||
resConfig.parseQualifiers(qualifiers);
|
resConfig.parseQualifiers(qualifiers);
|
||||||
return resConfig;
|
return resConfig;
|
||||||
}
|
}
|
||||||
|
public static int nearestSize(int size){
|
||||||
|
if(size <= SIZE_16){
|
||||||
|
return SIZE_16;
|
||||||
|
}
|
||||||
|
if(size <= SIZE_28){
|
||||||
|
return SIZE_28;
|
||||||
|
}
|
||||||
|
if(size <= SIZE_32){
|
||||||
|
return SIZE_32;
|
||||||
|
}
|
||||||
|
if(size <= SIZE_36){
|
||||||
|
return SIZE_36;
|
||||||
|
}
|
||||||
|
if(size <= SIZE_48){
|
||||||
|
return SIZE_48;
|
||||||
|
}
|
||||||
|
if(size <= SIZE_52){
|
||||||
|
return SIZE_52;
|
||||||
|
}
|
||||||
|
if(size <= SIZE_56){
|
||||||
|
return SIZE_56;
|
||||||
|
}
|
||||||
|
return SIZE_64;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static char[] unPackLanguage(byte in0, byte in1) {
|
private static char[] unPackLanguage(byte in0, byte in1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user