Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76393173
jadx
提交
2c1b3b24
J
jadx
项目概览
2301_76393173
/
jadx
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jadx
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2c1b3b24
编写于
8月 16, 2020
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'jpstotz-copyprefs' into master
上级
545cd4ec
f1f7c70a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
39 addition
and
0 deletion
+39
-0
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsAdapter.java
.../src/main/java/jadx/gui/settings/JadxSettingsAdapter.java
+5
-0
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
...i/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
+26
-0
jadx-gui/src/main/resources/i18n/Messages_de_DE.properties
jadx-gui/src/main/resources/i18n/Messages_de_DE.properties
+2
-0
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
+2
-0
jadx-gui/src/main/resources/i18n/Messages_es_ES.properties
jadx-gui/src/main/resources/i18n/Messages_es_ES.properties
+2
-0
jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties
jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties
+2
-0
未找到文件。
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsAdapter.java
浏览文件 @
2c1b3b24
...
@@ -17,6 +17,7 @@ import com.google.gson.FieldAttributes;
...
@@ -17,6 +17,7 @@ import com.google.gson.FieldAttributes;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.InstanceCreator
;
import
com.google.gson.InstanceCreator
;
import
com.google.gson.JsonObject
;
import
jadx.gui.JadxGUI
;
import
jadx.gui.JadxGUI
;
import
jadx.gui.utils.PathTypeAdapter
;
import
jadx.gui.utils.PathTypeAdapter
;
...
@@ -92,6 +93,10 @@ public class JadxSettingsAdapter {
...
@@ -92,6 +93,10 @@ public class JadxSettingsAdapter {
return
GSON
.
toJson
(
settings
);
return
GSON
.
toJson
(
settings
);
}
}
public
static
JsonObject
makeJsonObject
(
JadxSettings
settings
)
{
return
GSON
.
toJsonTree
(
settings
).
getAsJsonObject
();
}
public
static
void
fill
(
JadxSettings
settings
,
String
jsonStr
)
{
public
static
void
fill
(
JadxSettings
settings
,
String
jsonStr
)
{
populate
(
GSON_BUILDER
,
jsonStr
,
JadxSettings
.
class
,
settings
);
populate
(
GSON_BUILDER
,
jsonStr
,
JadxSettings
.
class
,
settings
);
}
}
...
...
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
浏览文件 @
2c1b3b24
package
jadx.gui.settings
;
package
jadx.gui.settings
;
import
java.awt.*
;
import
java.awt.*
;
import
java.awt.datatransfer.Clipboard
;
import
java.awt.datatransfer.StringSelection
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ItemEvent
;
import
java.awt.event.ItemEvent
;
import
java.awt.event.MouseAdapter
;
import
java.awt.event.MouseAdapter
;
...
@@ -13,6 +15,9 @@ import javax.swing.*;
...
@@ -13,6 +15,9 @@ import javax.swing.*;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.JsonObject
;
import
say.swing.JFontChooser
;
import
say.swing.JFontChooser
;
import
jadx.api.JadxArgs
;
import
jadx.api.JadxArgs
;
...
@@ -113,10 +118,31 @@ public class JadxSettingsWindow extends JDialog {
...
@@ -113,10 +118,31 @@ public class JadxSettingsWindow extends JDialog {
}
}
});
});
JButton
copyBtn
=
new
JButton
(
NLS
.
str
(
"preferences.copy"
));
copyBtn
.
addActionListener
(
event
->
{
JsonObject
settingsJson
=
JadxSettingsAdapter
.
makeJsonObject
(
this
.
settings
);
// remove irrelevant preferences
settingsJson
.
remove
(
"windowPos"
);
settingsJson
.
remove
(
"mainWindowExtendedState"
);
settingsJson
.
remove
(
"lastSaveProjectPath"
);
settingsJson
.
remove
(
"lastOpenFilePath"
);
settingsJson
.
remove
(
"lastSaveFilePath"
);
settingsJson
.
remove
(
"recentProjects"
);
String
settingsText
=
new
GsonBuilder
().
setPrettyPrinting
().
create
().
toJson
(
settingsJson
);
Clipboard
clipboard
=
Toolkit
.
getDefaultToolkit
().
getSystemClipboard
();
StringSelection
selection
=
new
StringSelection
(
settingsText
);
clipboard
.
setContents
(
selection
,
selection
);
JOptionPane
.
showMessageDialog
(
JadxSettingsWindow
.
this
,
NLS
.
str
(
"preferences.copy_message"
));
});
JPanel
buttonPane
=
new
JPanel
();
JPanel
buttonPane
=
new
JPanel
();
buttonPane
.
setLayout
(
new
BoxLayout
(
buttonPane
,
BoxLayout
.
LINE_AXIS
));
buttonPane
.
setLayout
(
new
BoxLayout
(
buttonPane
,
BoxLayout
.
LINE_AXIS
));
buttonPane
.
setBorder
(
BorderFactory
.
createEmptyBorder
(
10
,
10
,
10
,
10
));
buttonPane
.
setBorder
(
BorderFactory
.
createEmptyBorder
(
10
,
10
,
10
,
10
));
buttonPane
.
add
(
resetBtn
);
buttonPane
.
add
(
resetBtn
);
buttonPane
.
add
(
copyBtn
);
buttonPane
.
add
(
Box
.
createHorizontalGlue
());
buttonPane
.
add
(
Box
.
createHorizontalGlue
());
buttonPane
.
add
(
saveBtn
);
buttonPane
.
add
(
saveBtn
);
buttonPane
.
add
(
Box
.
createRigidArea
(
new
Dimension
(
10
,
0
)));
buttonPane
.
add
(
Box
.
createRigidArea
(
new
Dimension
(
10
,
0
)));
...
...
jadx-gui/src/main/resources/i18n/Messages_de_DE.properties
浏览文件 @
2c1b3b24
...
@@ -124,6 +124,8 @@ preferences.cancel=Abbrechen
...
@@ -124,6 +124,8 @@ preferences.cancel=Abbrechen
preferences.reset
=
Zurücksetzen
preferences.reset
=
Zurücksetzen
preferences.reset_message
=
Einstellungen auf Standardwerte zurücksetzen?
preferences.reset_message
=
Einstellungen auf Standardwerte zurücksetzen?
preferences.reset_title
=
Einstellungen zurücksetzen
preferences.reset_title
=
Einstellungen zurücksetzen
#preferences.copy=Copy to clipboard
#preferences.copy_message=All settings values has been copied to clipboard
preferences.rename
=
Umbenennen
preferences.rename
=
Umbenennen
preferences.rename_case
=
System unterscheidet zwischen Groß/Kleinschreibung
preferences.rename_case
=
System unterscheidet zwischen Groß/Kleinschreibung
preferences.rename_valid
=
Ist eine gültige Kennung
preferences.rename_valid
=
Ist eine gültige Kennung
...
...
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
浏览文件 @
2c1b3b24
...
@@ -124,6 +124,8 @@ preferences.cancel=Cancel
...
@@ -124,6 +124,8 @@ preferences.cancel=Cancel
preferences.reset
=
Reset
preferences.reset
=
Reset
preferences.reset_message
=
Reset settings to default values?
preferences.reset_message
=
Reset settings to default values?
preferences.reset_title
=
Reset settings
preferences.reset_title
=
Reset settings
preferences.copy
=
Copy to clipboard
preferences.copy_message
=
All settings values has been copied to clipboard
preferences.rename
=
Rename
preferences.rename
=
Rename
preferences.rename_case
=
System case sensitivity
preferences.rename_case
=
System case sensitivity
preferences.rename_valid
=
To be valid identifier
preferences.rename_valid
=
To be valid identifier
...
...
jadx-gui/src/main/resources/i18n/Messages_es_ES.properties
浏览文件 @
2c1b3b24
...
@@ -124,6 +124,8 @@ preferences.cancel=Cancelar
...
@@ -124,6 +124,8 @@ preferences.cancel=Cancelar
preferences.reset
=
Reestablecer
preferences.reset
=
Reestablecer
preferences.reset_message
=
¿Reestablecer preferencias a valores por defecto?
preferences.reset_message
=
¿Reestablecer preferencias a valores por defecto?
preferences.reset_title
=
Reestablecer preferencias
preferences.reset_title
=
Reestablecer preferencias
#preferences.copy=Copy to clipboard
#preferences.copy_message=All settings values has been copied to clipboard
#preferences.rename=
#preferences.rename=
#preferences.rename_case=
#preferences.rename_case=
#preferences.rename_valid=
#preferences.rename_valid=
...
...
jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties
浏览文件 @
2c1b3b24
...
@@ -124,6 +124,8 @@ preferences.cancel=取消
...
@@ -124,6 +124,8 @@ preferences.cancel=取消
preferences.reset
=
重置
preferences.reset
=
重置
preferences.reset_message
=
要恢复默认设置吗?
preferences.reset_message
=
要恢复默认设置吗?
preferences.reset_title
=
重置设置
preferences.reset_title
=
重置设置
#preferences.copy=Copy to clipboard
#preferences.copy_message=All settings values has been copied to clipboard
preferences.rename
=
重命名
preferences.rename
=
重命名
preferences.rename_case
=
系统区分大小写
preferences.rename_case
=
系统区分大小写
preferences.rename_valid
=
是有效的标识符
preferences.rename_valid
=
是有效的标识符
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录