mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-04-30 22:34:24 +02:00
fix: [XML] decode duplicate file as path string for multiple referencing entries
This commit is contained in:
parent
4439738534
commit
db59ebc6ae
@ -25,7 +25,6 @@ import com.reandroid.lib.arsc.chunk.xml.AndroidManifestBlock;
|
||||
import com.reandroid.lib.arsc.chunk.xml.ResXmlBlock;
|
||||
import com.reandroid.lib.arsc.container.SpecTypePair;
|
||||
import com.reandroid.lib.arsc.decoder.ValueDecoder;
|
||||
import com.reandroid.lib.arsc.item.TableString;
|
||||
import com.reandroid.lib.arsc.value.*;
|
||||
import com.reandroid.lib.common.EntryStore;
|
||||
import com.reandroid.lib.common.Frameworks;
|
||||
@ -110,7 +109,7 @@ import java.util.*;
|
||||
resFile.getInputSource().write(outputStream);
|
||||
outputStream.close();
|
||||
|
||||
addDecodedEntry(resFile.getEntryBlockList());
|
||||
addDecodedEntry(resFile.pickOne());
|
||||
}
|
||||
private void decodeResXml(EntryStore entryStore, File outDir, ResFile resFile)
|
||||
throws IOException, XMLException{
|
||||
@ -131,7 +130,7 @@ import java.util.*;
|
||||
XMLDocument xmlDocument=resXmlBlock.decodeToXml(entryStore, packageBlock.getId());
|
||||
xmlDocument.save(file, true);
|
||||
|
||||
addDecodedEntry(resFile.getEntryBlockList());
|
||||
addDecodedEntry(resFile.pickOne());
|
||||
}
|
||||
private void decodePublicXml(TableBlock tableBlock, File outDir)
|
||||
throws IOException{
|
||||
@ -167,11 +166,6 @@ import java.util.*;
|
||||
xmlDocument.save(file, true);
|
||||
addDecodedPath(AndroidManifestBlock.FILE_NAME);
|
||||
}
|
||||
private void addDecodedEntry(Collection<EntryBlock> entryBlockList){
|
||||
for(EntryBlock entryBlock:entryBlockList){
|
||||
addDecodedEntry(entryBlock);
|
||||
}
|
||||
}
|
||||
private void addDecodedEntry(EntryBlock entryBlock){
|
||||
if(entryBlock.isNull()){
|
||||
return;
|
||||
|
@ -28,7 +28,9 @@ class XMLValuesEncoderColor extends XMLValuesEncoder{
|
||||
if(encodeResult!=null){
|
||||
entryBlock.setValueAsRaw(encodeResult.valueType, encodeResult.value);
|
||||
}else {
|
||||
throw new EncodeException("Unknown color value: "+value);
|
||||
// If reaches here the value might be
|
||||
// file path e.g. res/color/something.xml
|
||||
entryBlock.setValueAsString(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user