/
DecApk.qml
216 lines (198 loc) · 6.78 KB
/
DecApk.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
Item {
id: root
signal nobtn
signal decapk(string options, bool rootPerm)
property int itemHeightMargin: height/20
property int fontSize: width/40
property color textColor: mc.colorValue("user/textColor")
MouseArea {
anchors.fill: parent
}
Image {
id: rectangle1
// color: "#f5ffffff"
// border.width: 0
source: "qrc:/icons/bg.png"
anchors.right: parent.right
anchors.rightMargin: 50
anchors.left: parent.left
anchors.leftMargin: 50
anchors.bottom: parent.bottom
anchors.bottomMargin: 50
anchors.top: parent.top
anchors.topMargin: 50
RadioButton {
id: rb1
text: qsTr("Decompile All")
anchors.left: parent.left
anchors.leftMargin: 20
anchors.top: parent.top
anchors.topMargin: 20
exclusiveGroup: tabPositionGroup
property int tag: 0
checked: true
}
RadioButton {
id: rb2
text: qsTr("Decompile classes.dex")
anchors.left: parent.left
anchors.leftMargin: 20
anchors.top: rb1.bottom
anchors.topMargin: root.itemHeightMargin/2
property int tag: 1
exclusiveGroup: tabPositionGroup
}
RadioButton {
id: rb3
text: qsTr("Decompile resource")
anchors.top: rb2.bottom
anchors.topMargin: root.itemHeightMargin/2
anchors.left: parent.left
anchors.leftMargin: 20
property int tag: 2
exclusiveGroup: tabPositionGroup
}
ExclusiveGroup { id: tabPositionGroup }
CheckBox {
id: checkBox1
text: "-b,--no-debug-info"
anchors.topMargin: root.itemHeightMargin
anchors.top: rb3.bottom
anchors.left: parent.left
anchors.leftMargin: 20
}
Text {
id: text2
y: 66
text: qsTr("don't write out debug info (.local, .param, .line, etc.)")
anchors.right: parent.right
anchors.rightMargin: 20
anchors.verticalCenter: checkBox1.verticalCenter
anchors.left: checkBox1.right
anchors.leftMargin: 20
textFormat: Text.PlainText
wrapMode: Text.WordWrap
font.pixelSize: root.fontSize
color: root.textColor
}
CheckBox {
id: checkBox2
text: "-k,--keep-broken-res"
anchors.top: checkBox1.bottom
anchors.topMargin: root.itemHeightMargin
anchors.left: parent.left
anchors.leftMargin: 20
}
Text {
id: text3
y: 109
font.pixelSize: root.fontSize
text: qsTr("Use if there was an error and some resources were dropped, e.g.You will have to fix them manually before building.")
anchors.right: parent.right
anchors.rightMargin: 20
anchors.verticalCenter: checkBox2.verticalCenter
anchors.left: checkBox2.right
anchors.leftMargin: 20
textFormat: Text.PlainText
wrapMode: Text.WordWrap
color: root.textColor
}
CheckBox {
id: checkBox3
text: "-m,--match-original"
anchors.left: parent.left
anchors.leftMargin: 20
anchors.top: checkBox2.bottom
anchors.topMargin: root.itemHeightMargin
}
Text {
id: text4
y: 153
font.pixelSize: root.fontSize
text: qsTr("Keeps files to closest to original as possible. Prevents rebuild.")
anchors.right: parent.right
anchors.rightMargin: 20
anchors.verticalCenter: checkBox3.verticalCenter
anchors.left: checkBox3.right
anchors.leftMargin: 20
textFormat: Text.PlainText
wrapMode: Text.WordWrap
color: root.textColor
}
TextField {
id: textField1
text: ""
placeholderText: qsTr("Input extra apktool options here")
anchors.right: parent.right
anchors.rightMargin: 20
anchors.top: checkBox3.bottom
anchors.topMargin: root.itemHeightMargin
anchors.left: parent.left
anchors.leftMargin: 20
// font.pixelSize: 12
style: TextFieldStyle {
textColor: root.textColor
background: Rectangle {
radius: 2
opacity: 0.1
implicitWidth: 100
implicitHeight: root.height/18
border.color: "#333"
border.width: 1
}
}
}
MyButton {
id: button1
width: parent.width/3
height: parent.height/15
text: qsTr("Cancel")
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
anchors.left: parent.left
anchors.leftMargin: 20
onClicked: root.nobtn()
}
MyButton {
id: button2
width: parent.width/3
height: parent.height/15
text: qsTr("Decompile")
anchors.verticalCenter: button1.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 20
onClicked: {
var opt = " d -f ";
if(tabPositionGroup.current.tag===1){
opt += "-r ";
}else if(tabPositionGroup.current.tag===2){
opt += "-s ";
}
if(checkBox1.checked){
opt += "-b ";
}
if(checkBox2.checked){
opt += "-k ";
}
if(checkBox3.checked){
opt += "-m ";
}
opt += textField1.getText(0, textField1.length);
root.decapk(opt, checkBox4.checked);
}
}
CheckBox {
id: checkBox4
text: qsTr("run as root")
anchors.top: textField1.bottom
anchors.topMargin: root.itemHeightMargin
anchors.left: parent.left
anchors.leftMargin: 20
enabled: mc.hasRoot()
// checked: true
}
}
}