mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-05-01 06:34:26 +02:00
encode ids and attrs at first
This commit is contained in:
parent
7455e35bef
commit
7cf6a5a694
@ -73,6 +73,8 @@
|
|||||||
Map<File, ResourceIds.Table.Package> map =
|
Map<File, ResourceIds.Table.Package> map =
|
||||||
initializeEncodeMaterials(pubXmlFileList, encodeMaterials);
|
initializeEncodeMaterials(pubXmlFileList, encodeMaterials);
|
||||||
|
|
||||||
|
Map<File, PackageBlock> packageBlockMap=new HashMap<>();
|
||||||
|
|
||||||
for(File pubXmlFile:pubXmlFileList){
|
for(File pubXmlFile:pubXmlFileList){
|
||||||
ResourceIds.Table.Package pkgResourceIds=map.get(pubXmlFile);
|
ResourceIds.Table.Package pkgResourceIds=map.get(pubXmlFile);
|
||||||
addParsedFiles(pubXmlFile);
|
addParsedFiles(pubXmlFile);
|
||||||
@ -82,6 +84,36 @@
|
|||||||
|
|
||||||
PackageBlock packageBlock = packageCreator.createNew(tableBlock, pkgResourceIds);
|
PackageBlock packageBlock = packageCreator.createNew(tableBlock, pkgResourceIds);
|
||||||
encodeMaterials.setCurrentPackage(packageBlock);
|
encodeMaterials.setCurrentPackage(packageBlock);
|
||||||
|
packageBlockMap.put(pubXmlFile, packageBlock);
|
||||||
|
|
||||||
|
ValuesEncoder valuesEncoder = new ValuesEncoder(encodeMaterials);
|
||||||
|
File fileIds = toId(pubXmlFile);
|
||||||
|
if(fileIds.isFile()){
|
||||||
|
valuesEncoder.encodeValuesXml(fileIds);
|
||||||
|
packageBlock.sortTypes();
|
||||||
|
packageBlock.refresh();
|
||||||
|
addParsedFiles(fileIds);
|
||||||
|
}
|
||||||
|
File fileAttrs = toAttr(pubXmlFile);
|
||||||
|
if(fileAttrs.isFile()){
|
||||||
|
valuesEncoder.encodeValuesXml(fileAttrs);
|
||||||
|
packageBlock.sortTypes();
|
||||||
|
packageBlock.refresh();
|
||||||
|
addParsedFiles(fileAttrs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(File pubXmlFile:pubXmlFileList){
|
||||||
|
ResourceIds.Table.Package pkgResourceIds=map.get(pubXmlFile);
|
||||||
|
addParsedFiles(pubXmlFile);
|
||||||
|
|
||||||
|
PackageBlock packageBlock=packageBlockMap.get(pubXmlFile);
|
||||||
|
|
||||||
|
if(packageBlock==null){
|
||||||
|
PackageCreator packageCreator = new PackageCreator();
|
||||||
|
packageCreator.setPackageName(pkgResourceIds.name);
|
||||||
|
packageBlock = packageCreator.createNew(tableBlock, pkgResourceIds);
|
||||||
|
}
|
||||||
|
encodeMaterials.setCurrentPackage(packageBlock);
|
||||||
|
|
||||||
File resDir=toResDirectory(pubXmlFile);
|
File resDir=toResDirectory(pubXmlFile);
|
||||||
encodeResDir(encodeMaterials, resDir);
|
encodeResDir(encodeMaterials, resDir);
|
||||||
@ -178,6 +210,12 @@
|
|||||||
.getParentFile()
|
.getParentFile()
|
||||||
.getParentFile();
|
.getParentFile();
|
||||||
}
|
}
|
||||||
|
private File toId(File pubXmlFile){
|
||||||
|
return new File(pubXmlFile.getParentFile(), "ids.xml");
|
||||||
|
}
|
||||||
|
private File toAttr(File pubXmlFile){
|
||||||
|
return new File(pubXmlFile.getParentFile(), "attrs.xml");
|
||||||
|
}
|
||||||
private List<File> listValuesDir(File resDir){
|
private List<File> listValuesDir(File resDir){
|
||||||
List<File> results=new ArrayList<>();
|
List<File> results=new ArrayList<>();
|
||||||
File def=new File(resDir, "values");
|
File def=new File(resDir, "values");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user