-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update deps and fix proto resource loading (AAB) (#1129)
- Loading branch information
Showing
8 changed files
with
97 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package jadx.core.xmlgen; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
public interface IResParser { | ||
|
||
void decode(InputStream inputStream) throws IOException; | ||
|
||
ResourceStorage getResStorage(); | ||
|
||
String[] getStrings(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package jadx.core.xmlgen; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import jadx.api.ResourceFile; | ||
import jadx.api.ResourceType; | ||
import jadx.core.dex.nodes.RootNode; | ||
import jadx.core.utils.exceptions.JadxRuntimeException; | ||
|
||
public class ResDecoder { | ||
|
||
public static IResParser decode(RootNode root, ResourceFile resFile, InputStream is) throws IOException { | ||
if (resFile.getType() != ResourceType.ARSC) { | ||
throw new IllegalArgumentException("Unexpected resource type for decode: " + resFile.getType() + ", expect ARSC"); | ||
} | ||
IResParser parser = null; | ||
String fileName = resFile.getOriginalName(); | ||
if (fileName.endsWith(".arsc")) { | ||
parser = new ResTableParser(root); | ||
} | ||
if (fileName.endsWith(".pb")) { | ||
parser = new ResProtoParser(root); | ||
} | ||
if (parser == null) { | ||
throw new JadxRuntimeException("Unknown type of resource file: " + fileName); | ||
} | ||
parser.decode(is); | ||
return parser; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters