-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move AAB support to separate plugin (PR #2165)
* wip: finished with factories * wip: bundleconfig.pb * wip: jadx-aab-input, separate BundleConfig parser * wip: removed test apks * wip: proto xml pretty print * wip: fixed getNamedValues NPE * minor fixes * spotless * enabled zip64 for gui shadow jar * spotless * spotless * reverted manifest identification since signature parsing not working at the moment * replace static methods with new API methods --------- Co-authored-by: Skylot <[email protected]>
- Loading branch information
Showing
29 changed files
with
500 additions
and
133 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
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
33 changes: 33 additions & 0 deletions
33
jadx-core/src/main/java/jadx/api/plugins/resources/IResContainerFactory.java
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,33 @@ | ||
package jadx.api.plugins.resources; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import jadx.api.ResourceFile; | ||
import jadx.core.dex.nodes.RootNode; | ||
import jadx.core.xmlgen.ResContainer; | ||
|
||
/** | ||
* Factory for {@link ResContainer}. Can be used in plugins via | ||
* {@code context.getResourcesLoader().addResContainerFactory()} to implement content parsing in | ||
* files with | ||
* different formats. | ||
*/ | ||
public interface IResContainerFactory { | ||
|
||
/** | ||
* Optional init method | ||
*/ | ||
default void init(RootNode root) { | ||
} | ||
|
||
/** | ||
* Checks if resource file is of expected format and tries to parse its content. | ||
* | ||
* @return {@link ResContainer} if file is of expected format, {@code null} otherwise. | ||
*/ | ||
@Nullable | ||
ResContainer create(ResourceFile resFile, InputStream inputStream) throws IOException; | ||
} |
30 changes: 30 additions & 0 deletions
30
jadx-core/src/main/java/jadx/api/plugins/resources/IResTableParserProvider.java
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,30 @@ | ||
package jadx.api.plugins.resources; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import jadx.api.ResourceFile; | ||
import jadx.core.dex.nodes.RootNode; | ||
import jadx.core.xmlgen.IResTableParser; | ||
|
||
/** | ||
* Provides the resource table parser instance for specific resource table file format. Can be used | ||
* in plugins via {@code context.getResourcesLoader().addResTableParserProvider()} to parse | ||
* resources from tables | ||
* in different formats. | ||
*/ | ||
public interface IResTableParserProvider { | ||
|
||
/** | ||
* Optional init method | ||
*/ | ||
default void init(RootNode root) { | ||
} | ||
|
||
/** | ||
* Checks a file format and provides the instance if the format is expected. | ||
* | ||
* @return {@link IResTableParser} if resource table is of expected format, {@code null} otherwise. | ||
*/ | ||
@Nullable | ||
IResTableParser getParser(ResourceFile resFile); | ||
} |
8 changes: 8 additions & 0 deletions
8
jadx-core/src/main/java/jadx/api/plugins/resources/IResourcesLoader.java
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,8 @@ | ||
package jadx.api.plugins.resources; | ||
|
||
public interface IResourcesLoader { | ||
|
||
void addResContainerFactory(IResContainerFactory resContainerFactory); | ||
|
||
void addResTableParserProvider(IResTableParserProvider resTableParserProvider); | ||
} |
Oops, something went wrong.