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
7cba2c3f
Commit
7cba2c3f
authored
Mar 08, 2016
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui: remove suffix tree search cache
parent
218c39b1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
9 additions
and
84 deletions
+9
-84
build.gradle
jadx-gui/build.gradle
+0
-1
BackgroundWorker.java
jadx-gui/src/main/java/jadx/gui/jobs/BackgroundWorker.java
+1
-3
IndexJob.java
jadx-gui/src/main/java/jadx/gui/jobs/IndexJob.java
+2
-8
JadxSettings.java
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
+0
-10
JadxSettingsWindow.java
...i/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
+0
-10
MainWindow.java
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
+1
-1
SuffixTree.java
jadx-gui/src/main/java/jadx/gui/utils/search/SuffixTree.java
+0
-39
TextSearchIndex.java
.../src/main/java/jadx/gui/utils/search/TextSearchIndex.java
+5
-11
Messages_en_US.properties
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
+0
-1
No files found.
jadx-gui/build.gradle
View file @
7cba2c3f
...
...
@@ -8,7 +8,6 @@ dependencies {
compile
'com.fifesoft:rsyntaxtextarea:2.5.8'
compile
'com.google.code.gson:gson:2.3.1'
compile
files
(
'libs/jfontchooser-1.0.5.jar'
)
compile
'com.googlecode.concurrent-trees:concurrent-trees:2.4.0'
}
applicationDistribution
.
with
{
...
...
jadx-gui/src/main/java/jadx/gui/jobs/BackgroundWorker.java
View file @
7cba2c3f
...
...
@@ -60,9 +60,7 @@ public class BackgroundWorker extends SwingWorker<Void, Void> {
LOG
.
debug
(
"Memory usage: After gc: {}"
,
Utils
.
memoryInfo
());
TextSearchIndex
searchIndex
=
cache
.
getTextIndex
();
if
(
cache
.
getIndexJob
().
isUseFastSearch
()
&&
searchIndex
!=
null
&&
searchIndex
.
getSkippedCount
()
>
0
)
{
if
(
searchIndex
!=
null
&&
searchIndex
.
getSkippedCount
()
>
0
)
{
LOG
.
warn
(
"Indexing of some classes skipped, count: {}, low memory: {}"
,
searchIndex
.
getSkippedCount
(),
Utils
.
memoryInfo
());
}
...
...
jadx-gui/src/main/java/jadx/gui/jobs/IndexJob.java
View file @
7cba2c3f
...
...
@@ -21,17 +21,15 @@ public class IndexJob extends BackgroundJob {
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
IndexJob
.
class
);
private
final
CacheObject
cache
;
private
final
boolean
useFastSearch
;
public
IndexJob
(
JadxWrapper
wrapper
,
CacheObject
cache
,
int
threadsCount
,
boolean
useFastSearch
)
{
public
IndexJob
(
JadxWrapper
wrapper
,
CacheObject
cache
,
int
threadsCount
)
{
super
(
wrapper
,
threadsCount
);
this
.
useFastSearch
=
useFastSearch
;
this
.
cache
=
cache
;
}
protected
void
runJob
()
{
JNodeCache
nodeCache
=
cache
.
getNodeCache
();
final
TextSearchIndex
index
=
new
TextSearchIndex
(
nodeCache
,
useFastSearch
);
final
TextSearchIndex
index
=
new
TextSearchIndex
(
nodeCache
);
final
CodeUsageInfo
usageInfo
=
new
CodeUsageInfo
(
nodeCache
);
cache
.
setTextIndex
(
index
);
cache
.
setUsageInfo
(
usageInfo
);
...
...
@@ -73,8 +71,4 @@ public class IndexJob extends BackgroundJob {
public
String
getInfoString
()
{
return
"Indexing: "
;
}
public
boolean
isUseFastSearch
()
{
return
useFastSearch
;
}
}
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
View file @
7cba2c3f
...
...
@@ -31,7 +31,6 @@ public class JadxSettings extends JadxCLIArgs {
private
boolean
checkForUpdates
=
true
;
private
List
<
String
>
recentFiles
=
new
ArrayList
<
String
>();
private
String
fontStr
=
""
;
private
boolean
useFastSearch
=
false
;
private
boolean
autoStartJobs
=
true
;
private
Map
<
String
,
WindowLocation
>
windowPos
=
new
HashMap
<
String
,
WindowLocation
>();
...
...
@@ -169,15 +168,6 @@ public class JadxSettings extends JadxCLIArgs {
this
.
escapeUnicode
=
escapeUnicode
;
}
public
boolean
isUseFastSearch
()
{
return
false
;
// return useFastSearch;
}
public
void
setUseFastSearch
(
boolean
useFastSearch
)
{
this
.
useFastSearch
=
useFastSearch
;
}
public
boolean
isAutoStartJobs
()
{
return
autoStartJobs
;
}
...
...
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
View file @
7cba2c3f
...
...
@@ -294,20 +294,10 @@ public class JadxSettingsWindow extends JDialog {
}
});
JCheckBox
fastSearch
=
new
JCheckBox
();
fastSearch
.
setEnabled
(
false
);
fastSearch
.
setSelected
(
settings
.
isUseFastSearch
());
fastSearch
.
addItemListener
(
new
ItemListener
()
{
public
void
itemStateChanged
(
ItemEvent
e
)
{
settings
.
setUseFastSearch
(
e
.
getStateChange
()
==
ItemEvent
.
SELECTED
);
}
});
SettingsGroup
other
=
new
SettingsGroup
(
NLS
.
str
(
"preferences.other"
));
other
.
addRow
(
NLS
.
str
(
"preferences.check_for_updates"
),
update
);
other
.
addRow
(
NLS
.
str
(
"preferences.cfg"
),
cfg
);
other
.
addRow
(
NLS
.
str
(
"preferences.raw_cfg"
),
rawCfg
);
other
.
addRow
(
NLS
.
str
(
"preferences.fast_search"
),
fastSearch
);
return
other
;
}
...
...
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
View file @
7cba2c3f
...
...
@@ -200,7 +200,7 @@ public class MainWindow extends JFrame {
// TODO: decompilation freezes sometime with several threads
int
threadsCount
=
1
;
// settings.getThreadsCount();
cacheObject
.
setDecompileJob
(
new
DecompileJob
(
wrapper
,
threadsCount
));
cacheObject
.
setIndexJob
(
new
IndexJob
(
wrapper
,
cacheObject
,
threadsCount
,
settings
.
isUseFastSearch
()
));
cacheObject
.
setIndexJob
(
new
IndexJob
(
wrapper
,
cacheObject
,
threadsCount
));
}
private
synchronized
void
runBackgroundJobs
()
{
...
...
jadx-gui/src/main/java/jadx/gui/utils/search/SuffixTree.java
deleted
100644 → 0
View file @
218c39b1
package
jadx
.
gui
.
utils
.
search
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.googlecode.concurrenttrees.radix.node.concrete.DefaultCharArrayNodeFactory
;
import
com.googlecode.concurrenttrees.suffix.ConcurrentSuffixTree
;
public
class
SuffixTree
<
V
>
extends
SearchIndex
<
V
>
{
private
final
ConcurrentSuffixTree
<
V
>
tree
;
public
SuffixTree
()
{
this
.
tree
=
new
ConcurrentSuffixTree
<
V
>(
new
DefaultCharArrayNodeFactory
());
}
@Override
public
void
put
(
String
str
,
V
value
)
{
if
(
str
==
null
||
str
.
isEmpty
())
{
return
;
}
tree
.
putIfAbsent
(
str
,
value
);
}
@Override
public
List
<
V
>
getValuesForKeysContaining
(
String
str
)
{
Iterable
<
V
>
resultsIt
=
tree
.
getValuesForKeysContaining
(
str
);
List
<
V
>
list
=
new
ArrayList
<
V
>();
for
(
V
v
:
resultsIt
)
{
list
.
add
(
v
);
}
return
list
;
}
@Override
public
int
size
()
{
return
tree
.
size
();
}
}
jadx-gui/src/main/java/jadx/gui/utils/search/TextSearchIndex.java
View file @
7cba2c3f
...
...
@@ -22,7 +22,6 @@ public class TextSearchIndex {
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
TextSearchIndex
.
class
);
private
final
JNodeCache
nodeCache
;
private
final
boolean
useFastSearch
;
private
SearchIndex
<
JNode
>
clsNamesIndex
;
private
SearchIndex
<
JNode
>
mthNamesIndex
;
...
...
@@ -31,17 +30,12 @@ public class TextSearchIndex {
private
List
<
JavaClass
>
skippedClasses
=
new
ArrayList
<
JavaClass
>();
public
TextSearchIndex
(
JNodeCache
nodeCache
,
boolean
useFastSearch
)
{
public
TextSearchIndex
(
JNodeCache
nodeCache
)
{
this
.
nodeCache
=
nodeCache
;
this
.
useFastSearch
=
useFastSearch
;
this
.
clsNamesIndex
=
initIndex
();
this
.
mthNamesIndex
=
initIndex
();
this
.
fldNamesIndex
=
initIndex
();
this
.
codeIndex
=
useFastSearch
?
new
SuffixTree
<
CodeNode
>()
:
new
CodeIndex
<
CodeNode
>();
}
private
<
T
>
SearchIndex
<
T
>
initIndex
()
{
return
useFastSearch
?
new
SuffixTree
<
T
>()
:
new
SimpleIndex
<
T
>();
this
.
clsNamesIndex
=
new
SimpleIndex
<
JNode
>();
this
.
mthNamesIndex
=
new
SimpleIndex
<
JNode
>();
this
.
fldNamesIndex
=
new
SimpleIndex
<
JNode
>();
this
.
codeIndex
=
new
CodeIndex
<
CodeNode
>();
}
public
void
indexNames
(
JavaClass
cls
)
{
...
...
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
View file @
7cba2c3f
...
...
@@ -64,7 +64,6 @@ preferences.threads=Processing threads count
preferences.cfg
=
Generate methods CFG graphs (in 'dot' format)
preferences.raw_cfg
=
Generate RAW CFG graphs
preferences.font
=
Editor font
preferences.fast_search
=
Fast search (uses more memory)
preferences.start_jobs
=
Auto start background decompilation
preferences.select_font
=
Select
preferences.deobfuscation_on
=
Enable deobfuscation
...
...
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