Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
10198bc8
Commit
10198bc8
authored
Nov 29, 2014
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui: update RSyntaxTextArea version, refactor new version checks
parent
a6b4043e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
46 deletions
+67
-46
build.gradle
jadx-gui/build.gradle
+1
-1
MainWindow.java
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
+7
-1
SearchBar.java
jadx-gui/src/main/java/jadx/gui/ui/SearchBar.java
+4
-8
JadxUpdate.java
jadx-gui/src/main/java/jadx/gui/update/JadxUpdate.java
+3
-3
Asset.java
jadx-gui/src/main/java/jadx/gui/update/data/Asset.java
+40
-23
Release.java
jadx-gui/src/main/java/jadx/gui/update/data/Release.java
+12
-10
No files found.
jadx-gui/build.gradle
View file @
10198bc8
...
...
@@ -5,7 +5,7 @@ mainClassName = "jadx.gui.JadxGUI"
dependencies
{
compile
(
project
(
":jadx-core"
))
compile
(
project
(
":jadx-cli"
))
compile
'com.fifesoft:rsyntaxtextarea:2.5.
0
'
compile
'com.fifesoft:rsyntaxtextarea:2.5.
4
'
compile
'com.google.code.gson:gson:2.3.1'
}
...
...
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
View file @
10198bc8
...
...
@@ -5,6 +5,7 @@ import jadx.gui.treemodel.JClass;
import
jadx.gui.treemodel.JNode
;
import
jadx.gui.treemodel.JRoot
;
import
jadx.gui.update.JadxUpdate
;
import
jadx.gui.update.JadxUpdate.IUpdateCallback
;
import
jadx.gui.update.data.Release
;
import
jadx.gui.utils.JadxPreferences
;
import
jadx.gui.utils.Link
;
...
...
@@ -94,7 +95,12 @@ public class MainWindow extends JFrame {
initUI
();
initMenuAndToolbar
();
JadxUpdate
.
check
(
new
JadxUpdate
.
IUpdateCallback
()
{
checkForUpdate
();
}
private
void
checkForUpdate
()
{
// TODO: add option for disable update checks
JadxUpdate
.
check
(
new
IUpdateCallback
()
{
@Override
public
void
onUpdate
(
final
Release
r
)
{
SwingUtilities
.
invokeLater
(
new
Runnable
()
{
...
...
jadx-gui/src/main/java/jadx/gui/ui/SearchBar.java
View file @
10198bc8
...
...
@@ -19,6 +19,7 @@ import java.awt.event.KeyEvent;
import
org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
;
import
org.fife.ui.rtextarea.SearchContext
;
import
org.fife.ui.rtextarea.SearchEngine
;
import
org.fife.ui.rtextarea.SearchResult
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -153,18 +154,13 @@ class SearchBar extends JToolBar {
boolean
regex
=
regexCB
.
isSelected
();
boolean
wholeWord
=
wholeWordCB
.
isSelected
();
if
(
markAllCB
.
isSelected
())
{
rTextArea
.
markAll
(
searchText
,
matchCase
,
wholeWord
,
regex
);
}
else
{
rTextArea
.
clearMarkAllHighlights
();
}
SearchContext
context
=
new
SearchContext
();
context
.
setSearchFor
(
searchText
);
context
.
setMatchCase
(
matchCase
);
context
.
setRegularExpression
(
regex
);
context
.
setSearchForward
(
forward
);
context
.
setWholeWord
(
wholeWord
);
context
.
setMarkAll
(
markAllCB
.
isSelected
());
// TODO hack: move cursor before previous search for not jump to next occurrence
if
(
direction
==
0
&&
!
COLOR_BG_ERROR
.
equals
(
searchField
.
getBackground
()))
{
...
...
@@ -179,8 +175,8 @@ class SearchBar extends JToolBar {
}
}
boolean
found
=
SearchEngine
.
find
(
rTextArea
,
context
);
if
(!
found
)
{
SearchResult
result
=
SearchEngine
.
find
(
rTextArea
,
context
);
if
(!
result
.
wasFound
()
)
{
int
pos
=
SearchEngine
.
getNextMatchPos
(
searchText
,
rTextArea
.
getText
(),
forward
,
matchCase
,
wholeWord
);
if
(
pos
!=
-
1
)
{
rTextArea
.
setCaretPosition
(
forward
?
0
:
rTextArea
.
getDocument
().
getLength
()
-
1
);
...
...
jadx-gui/src/main/java/jadx/gui/update/JadxUpdate.java
View file @
10198bc8
...
...
@@ -81,7 +81,7 @@ public class JadxUpdate {
for
(
Iterator
<
Release
>
it
=
list
.
iterator
();
it
.
hasNext
();
)
{
Release
release
=
it
.
next
();
if
(
release
.
getName
().
equalsIgnoreCase
(
version
)
||
release
.
isPre
r
elease
())
{
||
release
.
isPre
R
elease
())
{
it
.
remove
();
}
}
...
...
@@ -90,10 +90,10 @@ public class JadxUpdate {
}
Collections
.
sort
(
list
,
RELEASE_COMPARATOR
);
Release
latest
=
list
.
get
(
list
.
size
()
-
1
);
if
(
VersionComparator
.
checkAndCompare
(
version
,
latest
.
getName
())
=
=
0
)
{
if
(
VersionComparator
.
checkAndCompare
(
version
,
latest
.
getName
())
>
=
0
)
{
return
null
;
}
LOG
.
debug
(
"Found new
version: {}"
,
latest
);
LOG
.
info
(
"Found new jadx
version: {}"
,
latest
);
return
latest
;
}
...
...
jadx-gui/src/main/java/jadx/gui/update/data/Asset.java
View file @
10198bc8
package
jadx
.
gui
.
update
.
data
;
import
com.google.gson.annotations.SerializedName
;
public
class
Asset
{
private
int
id
;
private
String
url
;
private
String
name
;
private
String
label
;
private
long
size
;
private
int
download_count
;
@SerializedName
(
"download_count"
)
private
int
downloadCount
;
@SerializedName
(
"browser_download_url"
)
private
String
downloadUrl
;
@SerializedName
(
"created_at"
)
private
String
createdAt
;
public
int
getId
()
{
return
id
;
...
...
@@ -16,14 +24,6 @@ public class Asset {
this
.
id
=
id
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getName
()
{
return
name
;
}
...
...
@@ -32,14 +32,6 @@ public class Asset {
this
.
name
=
name
;
}
public
String
getLabel
()
{
return
label
;
}
public
void
setLabel
(
String
label
)
{
this
.
label
=
label
;
}
public
long
getSize
()
{
return
size
;
}
...
...
@@ -48,11 +40,36 @@ public class Asset {
this
.
size
=
size
;
}
public
int
getDownload_count
()
{
return
download_count
;
public
int
getDownloadCount
()
{
return
downloadCount
;
}
public
void
setDownloadCount
(
int
downloadCount
)
{
this
.
downloadCount
=
downloadCount
;
}
public
String
getDownloadUrl
()
{
return
downloadUrl
;
}
public
void
setDownloadUrl
(
String
downloadUrl
)
{
this
.
downloadUrl
=
downloadUrl
;
}
public
String
getCreatedAt
()
{
return
createdAt
;
}
public
void
setCreatedAt
(
String
createdAt
)
{
this
.
createdAt
=
createdAt
;
}
public
void
setDownload_count
(
int
download_count
)
{
this
.
download_count
=
download_count
;
@Override
public
String
toString
()
{
return
name
+
", size: "
+
String
.
format
(
"%.2fMB"
,
size
/
1024
.
/
1024
.)
+
", downloads count: "
+
downloadCount
+
", url: "
+
downloadUrl
+
", date: "
+
createdAt
;
}
}
jadx-gui/src/main/java/jadx/gui/update/data/Release.java
View file @
10198bc8
...
...
@@ -2,10 +2,15 @@ package jadx.gui.update.data;
import
java.util.List
;
import
com.google.gson.annotations.SerializedName
;
public
class
Release
{
private
int
id
;
private
String
name
;
private
boolean
prerelease
;
@SerializedName
(
"prerelease"
)
private
boolean
preRelease
;
private
List
<
Asset
>
assets
;
public
String
getName
()
{
...
...
@@ -24,12 +29,12 @@ public class Release {
this
.
id
=
id
;
}
public
boolean
isPre
r
elease
()
{
return
pre
r
elease
;
public
boolean
isPre
R
elease
()
{
return
pre
R
elease
;
}
public
void
setPre
release
(
boolean
prer
elease
)
{
this
.
pre
release
=
prer
elease
;
public
void
setPre
Release
(
boolean
preR
elease
)
{
this
.
pre
Release
=
preR
elease
;
}
public
List
<
Asset
>
getAssets
()
{
...
...
@@ -45,11 +50,8 @@ public class Release {
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
name
);
for
(
Asset
asset
:
getAssets
())
{
sb
.
append
(
'\n'
);
sb
.
append
(
" "
).
append
(
asset
.
getName
())
.
append
(
", asset id: "
).
append
(
asset
.
getId
())
.
append
(
", size: "
).
append
(
asset
.
getSize
())
.
append
(
", dc: "
).
append
(
asset
.
getDownload_count
());
sb
.
append
(
"\n "
);
sb
.
append
(
asset
);
}
return
sb
.
toString
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment