mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-04-30 06:14:25 +02:00
identify public.xml file
This commit is contained in:
parent
373b256058
commit
a79f90d875
@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package com.reandroid.apk.xmlencoder;
|
package com.reandroid.apk.xmlencoder;
|
||||||
|
|
||||||
|
import com.reandroid.apk.ApkUtil;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -31,6 +33,13 @@ package com.reandroid.apk.xmlencoder;
|
|||||||
};
|
};
|
||||||
stringList.sort(cmp);
|
stringList.sort(cmp);
|
||||||
}
|
}
|
||||||
|
public static boolean isPublicXml(File file){
|
||||||
|
if(!ApkUtil.FILE_NAME_PUBLIC_XML.equals(file.getName())){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
File dir = file.getParentFile();
|
||||||
|
return dir!=null && dir.getName().equals("values");
|
||||||
|
}
|
||||||
public static void sortPublicXml(List<File> fileList){
|
public static void sortPublicXml(List<File> fileList){
|
||||||
Comparator<File> cmp=new Comparator<File>() {
|
Comparator<File> cmp=new Comparator<File>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -253,6 +253,9 @@
|
|||||||
}
|
}
|
||||||
List<File> results = new ArrayList<>();
|
List<File> results = new ArrayList<>();
|
||||||
for(File file:xmlFiles){
|
for(File file:xmlFiles){
|
||||||
|
if(!EncodeUtil.isPublicXml(file)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if(toAndroidManifest(file).isFile()){
|
if(toAndroidManifest(file).isFile()){
|
||||||
results.add(file);
|
results.add(file);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user