mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-05-01 22:54:26 +02:00
fix unsigned byte and short id
This commit is contained in:
parent
d8fa2b921c
commit
2849f50fc8
@ -248,6 +248,9 @@ import java.util.*;
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
this.typeMap = new HashMap<>();
|
this.typeMap = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
public int getIdInt(){
|
||||||
|
return 0xff & id;
|
||||||
|
}
|
||||||
public int applyTo(PackageBlock packageBlock){
|
public int applyTo(PackageBlock packageBlock){
|
||||||
int renameCount=0;
|
int renameCount=0;
|
||||||
Map<Integer, EntryGroup> map = packageBlock.getEntriesGroupMap();
|
Map<Integer, EntryGroup> map = packageBlock.getEntriesGroupMap();
|
||||||
@ -328,7 +331,7 @@ import java.util.*;
|
|||||||
}
|
}
|
||||||
public JSONObject toJson(){
|
public JSONObject toJson(){
|
||||||
JSONObject jsonObject=new JSONObject();
|
JSONObject jsonObject=new JSONObject();
|
||||||
jsonObject.put("id", this.id);
|
jsonObject.put("id", this.getIdInt());
|
||||||
if(this.name!=null){
|
if(this.name!=null){
|
||||||
jsonObject.put("name", this.name);
|
jsonObject.put("name", this.name);
|
||||||
}
|
}
|
||||||
@ -341,7 +344,7 @@ import java.util.*;
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(Package pkg) {
|
public int compareTo(Package pkg) {
|
||||||
return Integer.compare(id, pkg.id);
|
return Integer.compare(getIdInt(), pkg.getIdInt());
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int compare(Type t1, Type t2) {
|
public int compare(Type t1, Type t2) {
|
||||||
@ -440,6 +443,9 @@ import java.util.*;
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
this.entryMap = new HashMap<>();
|
this.entryMap = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
public int getIdInt(){
|
||||||
|
return 0xff & id;
|
||||||
|
}
|
||||||
public boolean applyTo(EntryGroup entryGroup){
|
public boolean applyTo(EntryGroup entryGroup){
|
||||||
boolean renamed=false;
|
boolean renamed=false;
|
||||||
Entry entry=entryMap.get(entryGroup.getEntryId());
|
Entry entry=entryMap.get(entryGroup.getEntryId());
|
||||||
@ -522,7 +528,7 @@ import java.util.*;
|
|||||||
|
|
||||||
public JSONObject toJson(){
|
public JSONObject toJson(){
|
||||||
JSONObject jsonObject=new JSONObject();
|
JSONObject jsonObject=new JSONObject();
|
||||||
jsonObject.put("id", getId());
|
jsonObject.put("id", getIdInt());
|
||||||
jsonObject.put("name", getName());
|
jsonObject.put("name", getName());
|
||||||
JSONArray jsonArray=new JSONArray();
|
JSONArray jsonArray=new JSONArray();
|
||||||
for(Entry entry: entryMap.values()){
|
for(Entry entry: entryMap.values()){
|
||||||
@ -546,7 +552,7 @@ import java.util.*;
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(Type type) {
|
public int compareTo(Type type) {
|
||||||
return Integer.compare(id, type.id);
|
return Integer.compare(getIdInt(), type.getIdInt());
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int compare(Entry entry1, Entry entry2) {
|
public int compare(Entry entry1, Entry entry2) {
|
||||||
@ -636,6 +642,9 @@ import java.util.*;
|
|||||||
public short getEntryId(){
|
public short getEntryId(){
|
||||||
return (short) (resourceId & 0xffff);
|
return (short) (resourceId & 0xffff);
|
||||||
}
|
}
|
||||||
|
public int getEntryIdInt(){
|
||||||
|
return resourceId & 0xffff;
|
||||||
|
}
|
||||||
public int getResourceId(){
|
public int getResourceId(){
|
||||||
return ((getPackageId() & 0xff)<<24)
|
return ((getPackageId() & 0xff)<<24)
|
||||||
| ((getTypeId() & 0xff)<<16)
|
| ((getTypeId() & 0xff)<<16)
|
||||||
@ -646,7 +655,7 @@ import java.util.*;
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(Entry entry) {
|
public int compareTo(Entry entry) {
|
||||||
return Integer.compare(getEntryId(), entry.getEntryId());
|
return Integer.compare(getEntryIdInt(), entry.getEntryIdInt());
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user