mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-04-30 22:34:24 +02:00
add spec reference setter
This commit is contained in:
parent
d0f6703a19
commit
cadd96846c
@ -278,6 +278,10 @@ public class EntryBlock extends Block implements JSONConvert<JSONObject> {
|
|||||||
mSpecReference.set(ref);
|
mSpecReference.set(ref);
|
||||||
updateSpecRef(old, ref);
|
updateSpecRef(old, ref);
|
||||||
}
|
}
|
||||||
|
public void setSpecReference(SpecString specString){
|
||||||
|
removeSpecRef();
|
||||||
|
mSpecReference.set(specString.getIndex());
|
||||||
|
}
|
||||||
public BaseResValue getResValue(){
|
public BaseResValue getResValue(){
|
||||||
return mResValue;
|
return mResValue;
|
||||||
}
|
}
|
||||||
@ -620,6 +624,21 @@ public class EntryBlock extends Block implements JSONConvert<JSONObject> {
|
|||||||
specStringNew.addReference(getSpecReferenceBlock());
|
specStringNew.addReference(getSpecReferenceBlock());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private void removeSpecRef(){
|
||||||
|
TypeBlock typeBlock=getTypeBlock();
|
||||||
|
if(typeBlock==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PackageBlock packageBlock=typeBlock.getPackageBlock();
|
||||||
|
if(packageBlock==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SpecStringPool specStringPool=packageBlock.getSpecStringPool();
|
||||||
|
SpecString specString=specStringPool.get(getSpecReference());
|
||||||
|
if(specString!=null){
|
||||||
|
specString.removeReference(getSpecReferenceBlock());
|
||||||
|
}
|
||||||
|
}
|
||||||
private void updatePackage(){
|
private void updatePackage(){
|
||||||
TypeBlock typeBlock=getTypeBlock();
|
TypeBlock typeBlock=getTypeBlock();
|
||||||
if(typeBlock==null){
|
if(typeBlock==null){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user