Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add button to go to Android Manifest #2296

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,20 @@ public void goToApplication() {
}
}

public void goToManifest() {
ResourceFile androidManifest = AndroidManifestParser.getAndroidManifest(getWrapper().getResources());
if (androidManifest == null) {
JOptionPane.showMessageDialog(MainWindow.this,
NLS.str("error_dialog.not_found", "AndroidManifest.xml"),
NLS.str("error_dialog.title"),
JOptionPane.ERROR_MESSAGE);
return;
}

JResource res = new JResource(androidManifest, androidManifest.getDeobfName(), JResource.JResType.FILE);
tabsController.selectTab(res);
}

private void initMenuAndToolbar() {
JadxGuiAction openAction = new JadxGuiAction(ActionModel.OPEN, this::openFileDialog);
JadxGuiAction openProject = new JadxGuiAction(ActionModel.OPEN_PROJECT, this::openProjectDialog);
Expand Down Expand Up @@ -1078,6 +1092,7 @@ private void initMenuAndToolbar() {
this::goToMainActivity);
JadxGuiAction goToApplicationAction = new JadxGuiAction(ActionModel.GO_TO_APPLICATION,
this::goToApplication);
JadxGuiAction goToManifestAction = new JadxGuiAction(ActionModel.GO_TO_MANIFEST, this::goToManifest);
JadxGuiAction decompileAllAction = new JadxGuiAction(ActionModel.DECOMPILE_ALL, this::requestFullDecompilation);
JadxGuiAction resetCacheAction = new JadxGuiAction(ActionModel.RESET_CACHE, this::resetCodeCache);
JadxGuiAction deobfAction = new JadxGuiAction(ActionModel.DEOBF, this::toggleDeobfuscation);
Expand Down Expand Up @@ -1140,6 +1155,7 @@ private void initMenuAndToolbar() {
nav.add(commentSearchAction);
nav.add(goToMainActivityAction);
nav.add(goToApplicationAction);
nav.add(goToManifestAction);
nav.addSeparator();
nav.add(backAction);
nav.add(forwardAction);
Expand Down Expand Up @@ -1209,6 +1225,7 @@ public void actionPerformed(ActionEvent e) {
toolbar.add(commentSearchAction);
toolbar.add(goToMainActivityAction);
toolbar.add(goToApplicationAction);
toolbar.add(goToManifestAction);
toolbar.addSeparator();
toolbar.add(backAction);
toolbar.add(forwardAction);
Expand Down Expand Up @@ -1238,6 +1255,7 @@ public void actionPerformed(ActionEvent e) {
commentSearchAction.setEnabled(loaded);
goToMainActivityAction.setEnabled(loaded);
goToApplicationAction.setEnabled(loaded);
goToManifestAction.setEnabled(loaded);
backAction.setEnabled(loaded);
backVariantAction.setEnabled(loaded);
forwardAction.setEnabled(loaded);
Expand Down
2 changes: 2 additions & 0 deletions jadx-gui/src/main/java/jadx/gui/ui/action/ActionModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public enum ActionModel {
Shortcut.keyboard(KeyEvent.VK_M, UiUtils.ctrlButton() | KeyEvent.SHIFT_DOWN_MASK)),
GO_TO_APPLICATION(MENU_TOOLBAR, "menu.go_to_application", "menu.go_to_application", "ui/application",
Shortcut.keyboard(KeyEvent.VK_A, UiUtils.ctrlButton() | KeyEvent.SHIFT_DOWN_MASK)),
GO_TO_MANIFEST(MENU_TOOLBAR, "menu.go_to_manifest", "menu.go_to_manifest", "ui/goToManifest",
Shortcut.none()),
DECOMPILE_ALL(MENU_TOOLBAR, "menu.decompile_all", "menu.decompile_all", "ui/runAll",
Shortcut.none()),
RESET_CACHE(MENU_TOOLBAR, "menu.reset_cache", "menu.reset_cache", "ui/reset",
Expand Down
1 change: 1 addition & 0 deletions jadx-gui/src/main/resources/i18n/Messages_de_DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ menu.class_search=Klassen-Suche
menu.comment_search=Kommentar suchen
#menu.go_to_main_activity=
#menu.go_to_application=Go to Application
#menu.go_to_manifest=Go to Manifest
menu.tools=Tools
#menu.plugins=Plugins
#menu.decompile_all=Decompile all classes
Expand Down
1 change: 1 addition & 0 deletions jadx-gui/src/main/resources/i18n/Messages_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ menu.class_search=Class search
menu.comment_search=Comment search
menu.go_to_main_activity=Go to main Activity
menu.go_to_application=Go to Application
menu.go_to_manifest=Go to Manifest
menu.tools=Tools
menu.plugins=Plugins
menu.decompile_all=Decompile all classes
Expand Down
1 change: 1 addition & 0 deletions jadx-gui/src/main/resources/i18n/Messages_es_ES.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ menu.class_search=Buscar clase
#menu.comment_search=Comment search
#menu.go_to_main_activity=
#menu.go_to_application=Go to Application
#menu.go_to_manifest=Go to Manifest
menu.tools=Herramientas
#menu.plugins=Plugins
#menu.decompile_all=Decompile all classes
Expand Down
1 change: 1 addition & 0 deletions jadx-gui/src/main/resources/i18n/Messages_id_ID.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ menu.class_search=Pencarian Kelas
menu.comment_search=Pencarian Komentar
menu.go_to_main_activity=Pergi ke Activitas Utama
#menu.go_to_application=Go to Application
#menu.go_to_manifest=Go to Manifest
menu.tools=Alat
menu.plugins=Plugin
menu.decompile_all=Deskompilasi semua kelas
Expand Down
1 change: 1 addition & 0 deletions jadx-gui/src/main/resources/i18n/Messages_ko_KR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ menu.class_search=클래스 검색
menu.comment_search=주석 검색
#menu.go_to_main_activity=
#menu.go_to_application=Go to Application
#menu.go_to_manifest=Go to Manifest
menu.tools=도구
#menu.plugins=Plugins
#menu.decompile_all=Decompile all classes
Expand Down
1 change: 1 addition & 0 deletions jadx-gui/src/main/resources/i18n/Messages_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ menu.class_search=Buscar por classe
menu.comment_search=Busca por comentário
#menu.go_to_main_activity=
#menu.go_to_application=Go to Application
#menu.go_to_manifest=Go to Manifest
menu.tools=Ferramentas
#menu.plugins=Plugins
#menu.decompile_all=Decompile all classes
Expand Down
1 change: 1 addition & 0 deletions jadx-gui/src/main/resources/i18n/Messages_ru_RU.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ menu.class_search=Поиск классов
menu.comment_search=Поиск комментариев
menu.go_to_main_activity=Найти главное Activity
#menu.go_to_application=Go to Application
#menu.go_to_manifest=Go to Manifest
menu.tools=Инструменты
menu.plugins=Плагины
menu.decompile_all=Декомпилировать все
Expand Down
1 change: 1 addition & 0 deletions jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ menu.class_search=类名搜索
menu.comment_search=注释搜索
menu.go_to_main_activity=前往主 Activity
#menu.go_to_application=Go to Application
menu.go_to_manifest=前往 Manifest
menu.tools=工具
menu.plugins=插件
menu.decompile_all=反编译所有类
Expand Down
1 change: 1 addition & 0 deletions jadx-gui/src/main/resources/i18n/Messages_zh_TW.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ menu.class_search=類別搜尋
menu.comment_search=註解搜尋
menu.go_to_main_activity=前往主 Activity
#menu.go_to_application=Go to Application
menu.go_to_manifest=前往 Manifest
menu.tools=工具
menu.plugins=外掛程式
menu.decompile_all=反編譯所有類別
Expand Down
6 changes: 6 additions & 0 deletions jadx-gui/src/main/resources/icons/ui/goToManifest.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.