support arsc raw file view
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
package jadx.gui.treemodel;
|
||||
|
||||
import jadx.api.ResourceFile;
|
||||
import jadx.gui.JadxWrapper;
|
||||
import jadx.gui.treemodel.JResource.JResType;
|
||||
import jadx.gui.utils.Utils;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
import jadx.api.ResourceFile;
|
||||
import jadx.gui.JadxWrapper;
|
||||
import jadx.gui.treemodel.JResource.JResType;
|
||||
import jadx.gui.utils.Utils;
|
||||
|
||||
public class JRoot extends JNode {
|
||||
private static final long serialVersionUID = 8888495789773527342L;
|
||||
|
||||
@@ -45,7 +46,13 @@ public class JRoot extends JNode {
|
||||
JResource root = new JResource(null, "Resources", JResType.ROOT);
|
||||
String splitPathStr = Pattern.quote(File.separator);
|
||||
for (ResourceFile rf : resources) {
|
||||
String[] parts = new File(rf.getName()).getPath().split(splitPathStr);
|
||||
String rfName;
|
||||
if (rf.getZipRef() != null) {
|
||||
rfName = rf.getName();
|
||||
} else {
|
||||
rfName = new File(rf.getName()).getName();
|
||||
}
|
||||
String[] parts = new File(rfName).getPath().split(splitPathStr);
|
||||
JResource curRf = root;
|
||||
int count = parts.length;
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
||||
@@ -171,7 +171,7 @@ public class MainWindow extends JFrame {
|
||||
public void openFile() {
|
||||
JFileChooser fileChooser = new JFileChooser();
|
||||
fileChooser.setAcceptAllFileFilterUsed(true);
|
||||
String[] exts = {"apk", "dex", "jar", "class", "zip", "aar"};
|
||||
String[] exts = {"apk", "dex", "jar", "class", "zip", "aar", "arsc"};
|
||||
String description = "supported files: " + Arrays.toString(exts).replace('[', '(').replace(']', ')');
|
||||
fileChooser.setFileFilter(new FileNameExtensionFilter(description, exts));
|
||||
fileChooser.setToolTipText(NLS.str("file.open"));
|
||||
|
||||
Reference in New Issue
Block a user