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
9189f23e
Commit
9189f23e
authored
May 13, 2019
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(gui): rename Utils class due to clash with class from core
parent
62826334
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
118 additions
and
118 deletions
+118
-118
BackgroundWorker.java
jadx-gui/src/main/java/jadx/gui/jobs/BackgroundWorker.java
+6
-6
IndexJob.java
jadx-gui/src/main/java/jadx/gui/jobs/IndexJob.java
+2
-2
ApkSignature.java
jadx-gui/src/main/java/jadx/gui/treemodel/ApkSignature.java
+2
-2
JCertificate.java
jadx-gui/src/main/java/jadx/gui/treemodel/JCertificate.java
+2
-2
JClass.java
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
+8
-8
JField.java
jadx-gui/src/main/java/jadx/gui/treemodel/JField.java
+10
-10
JMethod.java
jadx-gui/src/main/java/jadx/gui/treemodel/JMethod.java
+11
-11
JPackage.java
jadx-gui/src/main/java/jadx/gui/treemodel/JPackage.java
+2
-2
JResource.java
jadx-gui/src/main/java/jadx/gui/treemodel/JResource.java
+7
-7
JRoot.java
jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
+2
-2
JSources.java
jadx-gui/src/main/java/jadx/gui/treemodel/JSources.java
+2
-2
AboutDialog.java
jadx-gui/src/main/java/jadx/gui/ui/AboutDialog.java
+2
-2
HeapUsageBar.java
jadx-gui/src/main/java/jadx/gui/ui/HeapUsageBar.java
+3
-3
MainWindow.java
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
+27
-27
ProgressPanel.java
jadx-gui/src/main/java/jadx/gui/ui/ProgressPanel.java
+2
-2
TabbedPane.java
jadx-gui/src/main/java/jadx/gui/ui/TabbedPane.java
+4
-4
CodePanel.java
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodePanel.java
+3
-3
SearchBar.java
jadx-gui/src/main/java/jadx/gui/ui/codearea/SearchBar.java
+4
-4
FontUtils.java
jadx-gui/src/main/java/jadx/gui/utils/FontUtils.java
+1
-1
TextStandardActions.java
...gui/src/main/java/jadx/gui/utils/TextStandardActions.java
+2
-2
UiUtils.java
jadx-gui/src/main/java/jadx/gui/utils/UiUtils.java
+9
-9
CodeIndex.java
jadx-gui/src/main/java/jadx/gui/utils/search/CodeIndex.java
+2
-2
StringRef.java
jadx-gui/src/main/java/jadx/gui/utils/search/StringRef.java
+1
-1
TextSearchIndex.java
.../src/main/java/jadx/gui/utils/search/TextSearchIndex.java
+4
-4
No files found.
jadx-gui/src/main/java/jadx/gui/jobs/BackgroundWorker.java
View file @
9189f23e
...
...
@@ -10,7 +10,7 @@ import org.slf4j.LoggerFactory;
import
jadx.gui.ui.ProgressPanel
;
import
jadx.gui.utils.CacheObject
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
import
jadx.gui.utils.search.TextSearchIndex
;
public
class
BackgroundWorker
extends
SwingWorker
<
Void
,
Void
>
{
...
...
@@ -45,20 +45,20 @@ public class BackgroundWorker extends SwingWorker<Void, Void> {
protected
Void
doInBackground
()
{
try
{
System
.
gc
();
LOG
.
debug
(
"Memory usage: Before decompile: {}"
,
Utils
.
memoryInfo
());
LOG
.
debug
(
"Memory usage: Before decompile: {}"
,
U
iU
tils
.
memoryInfo
());
runJob
(
cache
.
getDecompileJob
());
LOG
.
debug
(
"Memory usage: Before index: {}"
,
Utils
.
memoryInfo
());
LOG
.
debug
(
"Memory usage: Before index: {}"
,
U
iU
tils
.
memoryInfo
());
runJob
(
cache
.
getIndexJob
());
LOG
.
debug
(
"Memory usage: After index: {}"
,
Utils
.
memoryInfo
());
LOG
.
debug
(
"Memory usage: After index: {}"
,
U
iU
tils
.
memoryInfo
());
System
.
gc
();
LOG
.
debug
(
"Memory usage: After gc: {}"
,
Utils
.
memoryInfo
());
LOG
.
debug
(
"Memory usage: After gc: {}"
,
U
iU
tils
.
memoryInfo
());
TextSearchIndex
searchIndex
=
cache
.
getTextIndex
();
if
(
searchIndex
!=
null
&&
searchIndex
.
getSkippedCount
()
>
0
)
{
LOG
.
warn
(
"Indexing of some classes skipped, count: {}, low memory: {}"
,
searchIndex
.
getSkippedCount
(),
Utils
.
memoryInfo
());
searchIndex
.
getSkippedCount
(),
U
iU
tils
.
memoryInfo
());
String
msg
=
NLS
.
str
(
"message.indexingClassesSkipped"
,
searchIndex
.
getSkippedCount
());
JOptionPane
.
showMessageDialog
(
null
,
msg
);
}
...
...
jadx-gui/src/main/java/jadx/gui/jobs/IndexJob.java
View file @
9189f23e
...
...
@@ -13,7 +13,7 @@ import jadx.gui.utils.CacheObject;
import
jadx.gui.utils.CodeLinesInfo
;
import
jadx.gui.utils.CodeUsageInfo
;
import
jadx.gui.utils.JNodeCache
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
import
jadx.gui.utils.search.StringRef
;
import
jadx.gui.utils.search.TextSearchIndex
;
...
...
@@ -42,7 +42,7 @@ public class IndexJob extends BackgroundJob {
List
<
StringRef
>
lines
=
splitLines
(
cls
);
usageInfo
.
processClass
(
cls
,
linesInfo
,
lines
);
if
(
Utils
.
isFreeMemoryAvailable
())
{
if
(
U
iU
tils
.
isFreeMemoryAvailable
())
{
index
.
indexCode
(
cls
,
linesInfo
,
lines
);
}
else
{
index
.
classCodeIndexSkipped
(
cls
);
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/ApkSignature.java
View file @
9189f23e
...
...
@@ -17,14 +17,14 @@ import com.android.apksig.ApkVerifier;
import
jadx.gui.JadxWrapper
;
import
jadx.gui.utils.CertificateManager
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
ApkSignature
extends
JNode
{
private
static
final
long
serialVersionUID
=
-
9121321926113143407L
;
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
ApkSignature
.
class
);
private
static
final
ImageIcon
CERTIFICATE_ICON
=
Utils
.
openIcon
(
"certificate_obj"
);
private
static
final
ImageIcon
CERTIFICATE_ICON
=
U
iU
tils
.
openIcon
(
"certificate_obj"
);
private
final
transient
File
openFile
;
private
String
content
;
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JCertificate.java
View file @
9189f23e
...
...
@@ -17,13 +17,13 @@ import jadx.api.ResourceFile;
import
jadx.core.utils.files.ZipSecurity
;
import
jadx.gui.utils.CertificateManager
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
JCertificate
extends
JNode
{
private
static
final
long
serialVersionUID
=
4308696770188518731L
;
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
JCertificate
.
class
);
private
static
final
ImageIcon
CERTIFICATE_ICON
=
Utils
.
openIcon
(
"certificate_obj"
);
private
static
final
ImageIcon
CERTIFICATE_ICON
=
U
iU
tils
.
openIcon
(
"certificate_obj"
);
private
final
transient
ResourceFile
rf
;
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
View file @
9189f23e
...
...
@@ -10,18 +10,18 @@ import jadx.api.JavaMethod;
import
jadx.api.JavaNode
;
import
jadx.core.dex.info.AccessInfo
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
JClass
extends
JLoadableNode
{
private
static
final
long
serialVersionUID
=
-
1239986875244097177L
;
private
static
final
ImageIcon
ICON_CLASS
=
Utils
.
openIcon
(
"class_obj"
);
private
static
final
ImageIcon
ICON_CLASS_DEFAULT
=
Utils
.
openIcon
(
"class_default_obj"
);
private
static
final
ImageIcon
ICON_CLASS_PRIVATE
=
Utils
.
openIcon
(
"innerclass_private_obj"
);
private
static
final
ImageIcon
ICON_CLASS_PROTECTED
=
Utils
.
openIcon
(
"innerclass_protected_obj"
);
private
static
final
ImageIcon
ICON_INTERFACE
=
Utils
.
openIcon
(
"int_obj"
);
private
static
final
ImageIcon
ICON_ENUM
=
Utils
.
openIcon
(
"enum_obj"
);
private
static
final
ImageIcon
ICON_ANNOTATION
=
Utils
.
openIcon
(
"annotation_obj"
);
private
static
final
ImageIcon
ICON_CLASS
=
U
iU
tils
.
openIcon
(
"class_obj"
);
private
static
final
ImageIcon
ICON_CLASS_DEFAULT
=
U
iU
tils
.
openIcon
(
"class_default_obj"
);
private
static
final
ImageIcon
ICON_CLASS_PRIVATE
=
U
iU
tils
.
openIcon
(
"innerclass_private_obj"
);
private
static
final
ImageIcon
ICON_CLASS_PROTECTED
=
U
iU
tils
.
openIcon
(
"innerclass_protected_obj"
);
private
static
final
ImageIcon
ICON_INTERFACE
=
U
iU
tils
.
openIcon
(
"int_obj"
);
private
static
final
ImageIcon
ICON_ENUM
=
U
iU
tils
.
openIcon
(
"enum_obj"
);
private
static
final
ImageIcon
ICON_ANNOTATION
=
U
iU
tils
.
openIcon
(
"annotation_obj"
);
private
final
transient
JavaClass
cls
;
private
final
transient
JClass
jParent
;
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JField.java
View file @
9189f23e
...
...
@@ -6,18 +6,18 @@ import jadx.api.JavaField;
import
jadx.api.JavaNode
;
import
jadx.core.dex.info.AccessInfo
;
import
jadx.gui.utils.OverlayIcon
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
JField
extends
JNode
{
private
static
final
long
serialVersionUID
=
1712572192106793359L
;
private
static
final
ImageIcon
ICON_FLD_DEF
=
Utils
.
openIcon
(
"field_default_obj"
);
private
static
final
ImageIcon
ICON_FLD_PRI
=
Utils
.
openIcon
(
"field_private_obj"
);
private
static
final
ImageIcon
ICON_FLD_PRO
=
Utils
.
openIcon
(
"field_protected_obj"
);
private
static
final
ImageIcon
ICON_FLD_PUB
=
Utils
.
openIcon
(
"field_public_obj"
);
private
static
final
ImageIcon
ICON_FLD_DEF
=
U
iU
tils
.
openIcon
(
"field_default_obj"
);
private
static
final
ImageIcon
ICON_FLD_PRI
=
U
iU
tils
.
openIcon
(
"field_private_obj"
);
private
static
final
ImageIcon
ICON_FLD_PRO
=
U
iU
tils
.
openIcon
(
"field_protected_obj"
);
private
static
final
ImageIcon
ICON_FLD_PUB
=
U
iU
tils
.
openIcon
(
"field_public_obj"
);
private
static
final
ImageIcon
ICON_TRANSIENT
=
Utils
.
openIcon
(
"transient_co"
);
private
static
final
ImageIcon
ICON_VOLATILE
=
Utils
.
openIcon
(
"volatile_co"
);
private
static
final
ImageIcon
ICON_TRANSIENT
=
U
iU
tils
.
openIcon
(
"transient_co"
);
private
static
final
ImageIcon
ICON_VOLATILE
=
U
iU
tils
.
openIcon
(
"volatile_co"
);
private
final
transient
JavaField
field
;
private
final
transient
JClass
jParent
;
...
...
@@ -50,7 +50,7 @@ public class JField extends JNode {
@Override
public
Icon
getIcon
()
{
AccessInfo
af
=
field
.
getAccessFlags
();
OverlayIcon
icon
=
Utils
.
makeIcon
(
af
,
ICON_FLD_PUB
,
ICON_FLD_PRI
,
ICON_FLD_PRO
,
ICON_FLD_DEF
);
OverlayIcon
icon
=
U
iU
tils
.
makeIcon
(
af
,
ICON_FLD_PUB
,
ICON_FLD_PRI
,
ICON_FLD_PRO
,
ICON_FLD_DEF
);
if
(
af
.
isTransient
())
{
icon
.
add
(
ICON_TRANSIENT
);
}
...
...
@@ -62,12 +62,12 @@ public class JField extends JNode {
@Override
public
String
makeString
()
{
return
Utils
.
typeFormat
(
field
.
getName
(),
field
.
getType
());
return
U
iU
tils
.
typeFormat
(
field
.
getName
(),
field
.
getType
());
}
@Override
public
String
makeLongString
()
{
return
Utils
.
typeFormat
(
field
.
getFullName
(),
field
.
getType
());
return
U
iU
tils
.
typeFormat
(
field
.
getFullName
(),
field
.
getType
());
}
@Override
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JMethod.java
View file @
9189f23e
...
...
@@ -9,18 +9,18 @@ import jadx.api.JavaNode;
import
jadx.core.dex.info.AccessInfo
;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.gui.utils.OverlayIcon
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
JMethod
extends
JNode
{
private
static
final
long
serialVersionUID
=
3834526867464663751L
;
private
static
final
ImageIcon
ICON_MTH_DEF
=
Utils
.
openIcon
(
"methdef_obj"
);
private
static
final
ImageIcon
ICON_MTH_PRI
=
Utils
.
openIcon
(
"methpri_obj"
);
private
static
final
ImageIcon
ICON_MTH_PRO
=
Utils
.
openIcon
(
"methpro_obj"
);
private
static
final
ImageIcon
ICON_MTH_PUB
=
Utils
.
openIcon
(
"methpub_obj"
);
private
static
final
ImageIcon
ICON_MTH_DEF
=
U
iU
tils
.
openIcon
(
"methdef_obj"
);
private
static
final
ImageIcon
ICON_MTH_PRI
=
U
iU
tils
.
openIcon
(
"methpri_obj"
);
private
static
final
ImageIcon
ICON_MTH_PRO
=
U
iU
tils
.
openIcon
(
"methpro_obj"
);
private
static
final
ImageIcon
ICON_MTH_PUB
=
U
iU
tils
.
openIcon
(
"methpub_obj"
);
private
static
final
ImageIcon
ICON_CONSTRUCTOR
=
Utils
.
openIcon
(
"constr_ovr"
);
private
static
final
ImageIcon
ICON_SYNC
=
Utils
.
openIcon
(
"synch_co"
);
private
static
final
ImageIcon
ICON_CONSTRUCTOR
=
U
iU
tils
.
openIcon
(
"constr_ovr"
);
private
static
final
ImageIcon
ICON_SYNC
=
U
iU
tils
.
openIcon
(
"synch_co"
);
private
final
transient
JavaMethod
mth
;
private
final
transient
JClass
jParent
;
...
...
@@ -57,7 +57,7 @@ public class JMethod extends JNode {
@Override
public
Icon
getIcon
()
{
AccessInfo
accessFlags
=
mth
.
getAccessFlags
();
OverlayIcon
icon
=
Utils
.
makeIcon
(
accessFlags
,
ICON_MTH_PUB
,
ICON_MTH_PRI
,
ICON_MTH_PRO
,
ICON_MTH_DEF
);
OverlayIcon
icon
=
U
iU
tils
.
makeIcon
(
accessFlags
,
ICON_MTH_PUB
,
ICON_MTH_PRI
,
ICON_MTH_PRO
,
ICON_MTH_DEF
);
if
(
accessFlags
.
isConstructor
())
{
icon
.
add
(
ICON_CONSTRUCTOR
);
}
...
...
@@ -79,7 +79,7 @@ public class JMethod extends JNode {
}
base
.
append
(
'('
);
for
(
Iterator
<
ArgType
>
it
=
mth
.
getArguments
().
iterator
();
it
.
hasNext
();)
{
base
.
append
(
Utils
.
typeStr
(
it
.
next
()));
base
.
append
(
U
iU
tils
.
typeStr
(
it
.
next
()));
if
(
it
.
hasNext
())
{
base
.
append
(
", "
);
}
...
...
@@ -90,13 +90,13 @@ public class JMethod extends JNode {
@Override
public
String
makeString
()
{
return
Utils
.
typeFormat
(
makeBaseString
(),
getReturnType
());
return
U
iU
tils
.
typeFormat
(
makeBaseString
(),
getReturnType
());
}
@Override
public
String
makeLongString
()
{
String
name
=
mth
.
getDeclaringClass
().
getFullName
()
+
'.'
+
makeBaseString
();
return
Utils
.
typeFormat
(
name
,
getReturnType
());
return
U
iU
tils
.
typeFormat
(
name
,
getReturnType
());
}
@Override
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JPackage.java
View file @
9189f23e
...
...
@@ -10,12 +10,12 @@ import org.jetbrains.annotations.NotNull;
import
jadx.api.JavaClass
;
import
jadx.api.JavaPackage
;
import
jadx.gui.JadxWrapper
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
JPackage
extends
JNode
implements
Comparable
<
JPackage
>
{
private
static
final
long
serialVersionUID
=
-
4120718634156839804L
;
private
static
final
ImageIcon
PACKAGE_ICON
=
Utils
.
openIcon
(
"package_obj"
);
private
static
final
ImageIcon
PACKAGE_ICON
=
U
iU
tils
.
openIcon
(
"package_obj"
);
private
final
String
fullName
;
private
String
name
;
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JResource.java
View file @
9189f23e
...
...
@@ -19,17 +19,17 @@ import jadx.core.codegen.CodeWriter;
import
jadx.core.xmlgen.ResContainer
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.OverlayIcon
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
JResource
extends
JLoadableNode
implements
Comparable
<
JResource
>
{
private
static
final
long
serialVersionUID
=
-
201018424302612434L
;
private
static
final
ImageIcon
ROOT_ICON
=
Utils
.
openIcon
(
"cf_obj"
);
private
static
final
ImageIcon
FOLDER_ICON
=
Utils
.
openIcon
(
"folder"
);
private
static
final
ImageIcon
FILE_ICON
=
Utils
.
openIcon
(
"file_obj"
);
private
static
final
ImageIcon
MANIFEST_ICON
=
Utils
.
openIcon
(
"template_obj"
);
private
static
final
ImageIcon
JAVA_ICON
=
Utils
.
openIcon
(
"java_ovr"
);
private
static
final
ImageIcon
ERROR_ICON
=
Utils
.
openIcon
(
"error_co"
);
private
static
final
ImageIcon
ROOT_ICON
=
U
iU
tils
.
openIcon
(
"cf_obj"
);
private
static
final
ImageIcon
FOLDER_ICON
=
U
iU
tils
.
openIcon
(
"folder"
);
private
static
final
ImageIcon
FILE_ICON
=
U
iU
tils
.
openIcon
(
"file_obj"
);
private
static
final
ImageIcon
MANIFEST_ICON
=
U
iU
tils
.
openIcon
(
"template_obj"
);
private
static
final
ImageIcon
JAVA_ICON
=
U
iU
tils
.
openIcon
(
"java_ovr"
);
private
static
final
ImageIcon
ERROR_ICON
=
U
iU
tils
.
openIcon
(
"error_co"
);
public
enum
JResType
{
ROOT
,
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
View file @
9189f23e
...
...
@@ -12,12 +12,12 @@ import jadx.api.ResourceFile;
import
jadx.gui.JadxWrapper
;
import
jadx.gui.treemodel.JResource.JResType
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
JRoot
extends
JNode
{
private
static
final
long
serialVersionUID
=
8888495789773527342L
;
private
static
final
ImageIcon
ROOT_ICON
=
Utils
.
openIcon
(
"java_model_obj"
);
private
static
final
ImageIcon
ROOT_ICON
=
U
iU
tils
.
openIcon
(
"java_model_obj"
);
private
final
transient
JadxWrapper
wrapper
;
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JSources.java
View file @
9189f23e
...
...
@@ -14,12 +14,12 @@ import javax.swing.*;
import
jadx.api.JavaPackage
;
import
jadx.gui.JadxWrapper
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
JSources
extends
JNode
{
private
static
final
long
serialVersionUID
=
8962924556824862801L
;
private
static
final
ImageIcon
ROOT_ICON
=
Utils
.
openIcon
(
"packagefolder_obj"
);
private
static
final
ImageIcon
ROOT_ICON
=
U
iU
tils
.
openIcon
(
"packagefolder_obj"
);
private
final
transient
JadxWrapper
wrapper
;
private
final
transient
boolean
flatPackages
;
...
...
jadx-gui/src/main/java/jadx/gui/ui/AboutDialog.java
View file @
9189f23e
...
...
@@ -7,7 +7,7 @@ import javax.swing.*;
import
jadx.api.JadxDecompiler
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
class
AboutDialog
extends
JDialog
{
private
static
final
long
serialVersionUID
=
5763493590584039096L
;
...
...
@@ -70,7 +70,7 @@ class AboutDialog extends JDialog {
contentPane
.
add
(
textPane
,
BorderLayout
.
CENTER
);
contentPane
.
add
(
close
,
BorderLayout
.
PAGE_END
);
Utils
.
setWindowIcons
(
this
);
U
iU
tils
.
setWindowIcons
(
this
);
setModalityType
(
ModalityType
.
APPLICATION_MODAL
);
...
...
jadx-gui/src/main/java/jadx/gui/ui/HeapUsageBar.java
View file @
9189f23e
...
...
@@ -12,7 +12,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
HeapUsageBar
extends
JProgressBar
implements
ActionListener
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
HeapUsageBar
.
class
);
...
...
@@ -43,7 +43,7 @@ public class HeapUsageBar extends JProgressBar implements ActionListener {
Runtime
.
getRuntime
().
gc
();
update
();
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Memory used: {}"
,
Utils
.
memoryInfo
());
LOG
.
debug
(
"Memory used: {}"
,
U
iU
tils
.
memoryInfo
());
}
}
});
...
...
@@ -55,7 +55,7 @@ public class HeapUsageBar extends JProgressBar implements ActionListener {
setValue
(
usedKB
);
setString
(
NLS
.
str
(
"heapUsage.text"
,
(
usedKB
/
TWO_TO_20
),
maxGB
));
if
((
used
+
Utils
.
MIN_FREE_MEMORY
)
>
runtime
.
maxMemory
())
{
if
((
used
+
U
iU
tils
.
MIN_FREE_MEMORY
)
>
runtime
.
maxMemory
())
{
setForeground
(
RED
);
}
else
{
setForeground
(
GREEN
);
...
...
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
View file @
9189f23e
...
...
@@ -92,7 +92,7 @@ import jadx.gui.utils.FontUtils;
import
jadx.gui.utils.JumpPosition
;
import
jadx.gui.utils.Link
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
import
static
javax
.
swing
.
KeyStroke
.
getKeyStroke
;
...
...
@@ -106,20 +106,20 @@ public class MainWindow extends JFrame {
private
static
final
double
WINDOW_RATIO
=
1
-
BORDER_RATIO
*
2
;
private
static
final
double
SPLIT_PANE_RESIZE_WEIGHT
=
0.15
;
private
static
final
ImageIcon
ICON_OPEN
=
Utils
.
openIcon
(
"folder"
);
private
static
final
ImageIcon
ICON_SAVE_ALL
=
Utils
.
openIcon
(
"disk_multiple"
);
private
static
final
ImageIcon
ICON_EXPORT
=
Utils
.
openIcon
(
"database_save"
);
private
static
final
ImageIcon
ICON_CLOSE
=
Utils
.
openIcon
(
"cross"
);
private
static
final
ImageIcon
ICON_SYNC
=
Utils
.
openIcon
(
"sync"
);
private
static
final
ImageIcon
ICON_FLAT_PKG
=
Utils
.
openIcon
(
"empty_logical_package_obj"
);
private
static
final
ImageIcon
ICON_SEARCH
=
Utils
.
openIcon
(
"wand"
);
private
static
final
ImageIcon
ICON_FIND
=
Utils
.
openIcon
(
"magnifier"
);
private
static
final
ImageIcon
ICON_BACK
=
Utils
.
openIcon
(
"icon_back"
);
private
static
final
ImageIcon
ICON_FORWARD
=
Utils
.
openIcon
(
"icon_forward"
);
private
static
final
ImageIcon
ICON_PREF
=
Utils
.
openIcon
(
"wrench"
);
private
static
final
ImageIcon
ICON_DEOBF
=
Utils
.
openIcon
(
"lock_edit"
);
private
static
final
ImageIcon
ICON_LOG
=
Utils
.
openIcon
(
"report"
);
private
static
final
ImageIcon
ICON_JADX
=
Utils
.
openIcon
(
"jadx-logo"
);
private
static
final
ImageIcon
ICON_OPEN
=
U
iU
tils
.
openIcon
(
"folder"
);
private
static
final
ImageIcon
ICON_SAVE_ALL
=
U
iU
tils
.
openIcon
(
"disk_multiple"
);
private
static
final
ImageIcon
ICON_EXPORT
=
U
iU
tils
.
openIcon
(
"database_save"
);
private
static
final
ImageIcon
ICON_CLOSE
=
U
iU
tils
.
openIcon
(
"cross"
);
private
static
final
ImageIcon
ICON_SYNC
=
U
iU
tils
.
openIcon
(
"sync"
);
private
static
final
ImageIcon
ICON_FLAT_PKG
=
U
iU
tils
.
openIcon
(
"empty_logical_package_obj"
);
private
static
final
ImageIcon
ICON_SEARCH
=
U
iU
tils
.
openIcon
(
"wand"
);
private
static
final
ImageIcon
ICON_FIND
=
U
iU
tils
.
openIcon
(
"magnifier"
);
private
static
final
ImageIcon
ICON_BACK
=
U
iU
tils
.
openIcon
(
"icon_back"
);
private
static
final
ImageIcon
ICON_FORWARD
=
U
iU
tils
.
openIcon
(
"icon_forward"
);
private
static
final
ImageIcon
ICON_PREF
=
U
iU
tils
.
openIcon
(
"wrench"
);
private
static
final
ImageIcon
ICON_DEOBF
=
U
iU
tils
.
openIcon
(
"lock_edit"
);
private
static
final
ImageIcon
ICON_LOG
=
U
iU
tils
.
openIcon
(
"report"
);
private
static
final
ImageIcon
ICON_JADX
=
U
iU
tils
.
openIcon
(
"jadx-logo"
);
private
final
transient
JadxWrapper
wrapper
;
private
final
transient
JadxSettings
settings
;
...
...
@@ -159,7 +159,7 @@ public class MainWindow extends JFrame {
FontUtils
.
registerBundledFonts
();
initUI
();
initMenuAndToolbar
();
Utils
.
setWindowIcons
(
this
);
U
iU
tils
.
setWindowIcons
(
this
);
loadSettings
();
checkForUpdate
();
newProject
();
...
...
@@ -573,7 +573,7 @@ public class MainWindow extends JFrame {
}
};
openAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"file.open_action"
));
openAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_O
,
Utils
.
ctrlButton
()));
openAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_O
,
U
iU
tils
.
ctrlButton
()));
newProjectAction
=
new
AbstractAction
(
NLS
.
str
(
"file.new_project"
))
{
@Override
...
...
@@ -606,7 +606,7 @@ public class MainWindow extends JFrame {
}
};
saveAllAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"file.save_all"
));
saveAllAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_S
,
Utils
.
ctrlButton
()));
saveAllAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_S
,
U
iU
tils
.
ctrlButton
()));
Action
exportAction
=
new
AbstractAction
(
NLS
.
str
(
"file.export_gradle"
),
ICON_EXPORT
)
{
@Override
...
...
@@ -615,7 +615,7 @@ public class MainWindow extends JFrame {
}
};
exportAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"file.export_gradle"
));
exportAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_E
,
Utils
.
ctrlButton
()));
exportAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_E
,
U
iU
tils
.
ctrlButton
()));
JMenu
recentProjects
=
new
JMenu
(
NLS
.
str
(
"menu.recent_projects"
));
recentProjects
.
addMenuListener
(
new
RecentProjectsMenuListener
(
recentProjects
));
...
...
@@ -628,7 +628,7 @@ public class MainWindow extends JFrame {
};
prefsAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.preferences"
));
prefsAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_P
,
Utils
.
ctrlButton
()
|
KeyEvent
.
SHIFT_DOWN_MASK
));
U
iU
tils
.
ctrlButton
()
|
KeyEvent
.
SHIFT_DOWN_MASK
));
Action
exitAction
=
new
AbstractAction
(
NLS
.
str
(
"file.exit"
),
ICON_CLOSE
)
{
@Override
...
...
@@ -655,7 +655,7 @@ public class MainWindow extends JFrame {
}
};
syncAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.sync"
));
syncAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_T
,
Utils
.
ctrlButton
()));
syncAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_T
,
U
iU
tils
.
ctrlButton
()));
Action
textSearchAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.text_search"
),
ICON_SEARCH
)
{
@Override
...
...
@@ -665,7 +665,7 @@ public class MainWindow extends JFrame {
};
textSearchAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.text_search"
));
textSearchAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_F
,
Utils
.
ctrlButton
()
|
KeyEvent
.
SHIFT_DOWN_MASK
));
getKeyStroke
(
KeyEvent
.
VK_F
,
U
iU
tils
.
ctrlButton
()
|
KeyEvent
.
SHIFT_DOWN_MASK
));
Action
clsSearchAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.class_search"
),
ICON_FIND
)
{
@Override
...
...
@@ -674,7 +674,7 @@ public class MainWindow extends JFrame {
}
};
clsSearchAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.class_search"
));
clsSearchAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_N
,
Utils
.
ctrlButton
()));
clsSearchAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_N
,
U
iU
tils
.
ctrlButton
()));
Action
deobfAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.deobfuscation"
),
ICON_DEOBF
)
{
@Override
...
...
@@ -684,7 +684,7 @@ public class MainWindow extends JFrame {
};
deobfAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"preferences.deobfuscation"
));
deobfAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_D
,
Utils
.
ctrlButton
()
|
KeyEvent
.
ALT_DOWN_MASK
));
getKeyStroke
(
KeyEvent
.
VK_D
,
U
iU
tils
.
ctrlButton
()
|
KeyEvent
.
ALT_DOWN_MASK
));
deobfToggleBtn
=
new
JToggleButton
(
deobfAction
);
deobfToggleBtn
.
setSelected
(
settings
.
isDeobfuscationOn
());
...
...
@@ -701,7 +701,7 @@ public class MainWindow extends JFrame {
};
logAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.log"
));
logAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_L
,
Utils
.
ctrlButton
()
|
KeyEvent
.
SHIFT_DOWN_MASK
));
U
iU
tils
.
ctrlButton
()
|
KeyEvent
.
SHIFT_DOWN_MASK
));
Action
aboutAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.about"
),
ICON_JADX
)
{
@Override
...
...
@@ -718,7 +718,7 @@ public class MainWindow extends JFrame {
};
backAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"nav.back"
));
backAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_LEFT
,
Utils
.
ctrlButton
()
|
KeyEvent
.
ALT_DOWN_MASK
));
U
iU
tils
.
ctrlButton
()
|
KeyEvent
.
ALT_DOWN_MASK
));
Action
forwardAction
=
new
AbstractAction
(
NLS
.
str
(
"nav.forward"
),
ICON_FORWARD
)
{
@Override
...
...
@@ -728,7 +728,7 @@ public class MainWindow extends JFrame {
};
forwardAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"nav.forward"
));
forwardAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_RIGHT
,
Utils
.
ctrlButton
()
|
KeyEvent
.
ALT_DOWN_MASK
));
U
iU
tils
.
ctrlButton
()
|
KeyEvent
.
ALT_DOWN_MASK
));
JMenu
file
=
new
JMenu
(
NLS
.
str
(
"menu.file"
));
file
.
setMnemonic
(
KeyEvent
.
VK_F
);
...
...
jadx-gui/src/main/java/jadx/gui/ui/ProgressPanel.java
View file @
9189f23e
...
...
@@ -6,13 +6,13 @@ import java.beans.PropertyChangeListener;
import
javax.swing.*
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
ProgressPanel
extends
JPanel
implements
PropertyChangeListener
{
private
static
final
long
serialVersionUID
=
-
3238438119672015733L
;
private
static
final
Icon
ICON_CANCEL
=
Utils
.
openIcon
(
"cross"
);
private
static
final
Icon
ICON_CANCEL
=
U
iU
tils
.
openIcon
(
"cross"
);
private
final
JProgressBar
progressBar
;
private
final
JLabel
progressLabel
;
...
...
jadx-gui/src/main/java/jadx/gui/ui/TabbedPane.java
View file @
9189f23e
...
...
@@ -30,15 +30,15 @@ import jadx.gui.ui.codearea.CodeContentPanel;
import
jadx.gui.utils.JumpManager
;
import
jadx.gui.utils.JumpPosition
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
TabbedPane
extends
JTabbedPane
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
TabbedPane
.
class
);
private
static
final
long
serialVersionUID
=
-
8833600618794570904L
;
private
static
final
ImageIcon
ICON_CLOSE
=
Utils
.
openIcon
(
"cross"
);
private
static
final
ImageIcon
ICON_CLOSE_INACTIVE
=
Utils
.
openIcon
(
"cross_grayed"
);
private
static
final
ImageIcon
ICON_CLOSE
=
U
iU
tils
.
openIcon
(
"cross"
);
private
static
final
ImageIcon
ICON_CLOSE_INACTIVE
=
U
iU
tils
.
openIcon
(
"cross_grayed"
);
private
final
transient
MainWindow
mainWindow
;
private
final
transient
Map
<
JNode
,
ContentPanel
>
openTabs
=
new
LinkedHashMap
<>();
...
...
@@ -294,7 +294,7 @@ public class TabbedPane extends JTabbedPane {
public
void
copyRootClassName
()
{
String
name
=
getNodeFullName
();
if
(
name
!=
null
)
{
Utils
.
setClipboardString
(
name
);
U
iU
tils
.
setClipboardString
(
name
);
}
}
...
...
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodePanel.java
View file @
9189f23e
...
...
@@ -11,7 +11,7 @@ import javax.swing.KeyStroke;
import
jadx.gui.treemodel.JResource
;
import
jadx.gui.ui.ContentPanel
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
/**
* A panel combining a {@link SearchBar and a scollable {@link CodeArea}
...
...
@@ -32,8 +32,8 @@ public class CodePanel extends JPanel {
add
(
codeScrollPane
,
BorderLayout
.
CENTER
);
initLineNumbers
();
KeyStroke
key
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_F
,
Utils
.
ctrlButton
());
Utils
.
addKeyBinding
(
codeArea
,
key
,
"SearchAction"
,
new
AbstractAction
()
{
KeyStroke
key
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_F
,
U
iU
tils
.
ctrlButton
());
U
iU
tils
.
addKeyBinding
(
codeArea
,
key
,
"SearchAction"
,
new
AbstractAction
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
searchBar
.
toggle
();
...
...
jadx-gui/src/main/java/jadx/gui/ui/codearea/SearchBar.java
View file @
9189f23e
...
...
@@ -17,7 +17,7 @@ import org.slf4j.LoggerFactory;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.TextStandardActions
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
class
SearchBar
extends
JToolBar
{
private
static
final
long
serialVersionUID
=
1836871286618633003L
;
...
...
@@ -28,9 +28,9 @@ class SearchBar extends JToolBar {
private
static
final
Color
COLOR_BG_WARN
=
new
Color
(
0xFFFDD9
);
private
static
final
Color
COLOR_BG_NORMAL
=
new
Color
(
0xFFFFFF
);
private
static
final
Icon
ICON_UP
=
Utils
.
openIcon
(
"arrow_up"
);
private
static
final
Icon
ICON_DOWN
=
Utils
.
openIcon
(
"arrow_down"
);
private
static
final
Icon
ICON_CLOSE
=
Utils
.
openIcon
(
"cross"
);
private
static
final
Icon
ICON_UP
=
U
iU
tils
.
openIcon
(
"arrow_up"
);
private
static
final
Icon
ICON_DOWN
=
U
iU
tils
.
openIcon
(
"arrow_down"
);
private
static
final
Icon
ICON_CLOSE
=
U
iU
tils
.
openIcon
(
"cross"
);
private
RSyntaxTextArea
rTextArea
;
...
...
jadx-gui/src/main/java/jadx/gui/utils/FontUtils.java
View file @
9189f23e
...
...
@@ -74,7 +74,7 @@ public class FontUtils {
@Nullable
public
static
Font
openFontTTF
(
String
name
)
{
String
fontPath
=
"/fonts/"
+
name
+
".ttf"
;
try
(
InputStream
is
=
Utils
.
class
.
getResourceAsStream
(
fontPath
))
{
try
(
InputStream
is
=
U
iU
tils
.
class
.
getResourceAsStream
(
fontPath
))
{
Font
font
=
Font
.
createFont
(
Font
.
TRUETYPE_FONT
,
is
);
return
font
.
deriveFont
(
12
f
);
}
catch
(
Exception
e
)
{
...
...
jadx-gui/src/main/java/jadx/gui/utils/TextStandardActions.java
View file @
9189f23e
...
...
@@ -100,9 +100,9 @@ public class TextStandardActions {
}
private
void
addKeyActions
()
{
KeyStroke
undoKey
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_Z
,
Utils
.
ctrlButton
());
KeyStroke
undoKey
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_Z
,
U
iU
tils
.
ctrlButton
());
textComponent
.
getInputMap
().
put
(
undoKey
,
undoAction
);
KeyStroke
redoKey
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_R
,
Utils
.
ctrlButton
());
KeyStroke
redoKey
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_R
,
U
iU
tils
.
ctrlButton
());
textComponent
.
getInputMap
().
put
(
redoKey
,
redoAction
);
}
...
...
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
→
jadx-gui/src/main/java/jadx/gui/utils/U
iU
tils.java
View file @
9189f23e
...
...
@@ -19,8 +19,8 @@ import jadx.core.dex.info.AccessInfo;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.utils.exceptions.JadxRuntimeException
;
public
class
Utils
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
Utils
.
class
);
public
class
U
iU
tils
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
U
iU
tils
.
class
);
private
static
final
ImageIcon
ICON_STATIC
=
openIcon
(
"static_co"
);
private
static
final
ImageIcon
ICON_FINAL
=
openIcon
(
"final_co"
);
...
...
@@ -39,12 +39,12 @@ public class Utils {
*/
public
static
final
long
MIN_FREE_MEMORY
=
calculateMinFreeMemory
();
private
Utils
()
{
private
U
iU
tils
()
{
}
public
static
ImageIcon
openIcon
(
String
name
)
{
String
iconPath
=
"/icons-16/"
+
name
+
".png"
;
URL
resource
=
Utils
.
class
.
getResource
(
iconPath
);
URL
resource
=
U
iU
tils
.
class
.
getResource
(
iconPath
);
if
(
resource
==
null
)
{
throw
new
JadxRuntimeException
(
"Icon not found: "
+
iconPath
);
}
...
...
@@ -52,7 +52,7 @@ public class Utils {
}
public
static
Image
openImage
(
String
path
)
{
URL
resource
=
Utils
.
class
.
getResource
(
path
);
URL
resource
=
U
iU
tils
.
class
.
getResource
(
path
);
if
(
resource
==
null
)
{
throw
new
JadxRuntimeException
(
"Image not found: "
+
path
);
}
...
...
@@ -173,10 +173,10 @@ public class Utils {
public
static
void
setWindowIcons
(
Window
window
)
{
List
<
Image
>
icons
=
new
ArrayList
<>();
icons
.
add
(
Utils
.
openImage
(
"/logos/jadx-logo-16px.png"
));
icons
.
add
(
Utils
.
openImage
(
"/logos/jadx-logo-32px.png"
));
icons
.
add
(
Utils
.
openImage
(
"/logos/jadx-logo-48px.png"
));
icons
.
add
(
Utils
.
openImage
(
"/logos/jadx-logo.png"
));
icons
.
add
(
U
iU
tils
.
openImage
(
"/logos/jadx-logo-16px.png"
));
icons
.
add
(
U
iU
tils
.
openImage
(
"/logos/jadx-logo-32px.png"
));
icons
.
add
(
U
iU
tils
.
openImage
(
"/logos/jadx-logo-48px.png"
));
icons
.
add
(
U
iU
tils
.
openImage
(
"/logos/jadx-logo.png"
));
window
.
setIconImages
(
icons
);
}
...
...
jadx-gui/src/main/java/jadx/gui/utils/search/CodeIndex.java
View file @
9189f23e
...
...
@@ -9,7 +9,7 @@ import org.slf4j.LoggerFactory;
import
io.reactivex.BackpressureStrategy
;
import
io.reactivex.Flowable
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
public
class
CodeIndex
<
T
>
implements
SearchIndex
<
T
>
{
...
...
@@ -55,7 +55,7 @@ public class CodeIndex<T> implements SearchIndex<T> {
return
;
}
}
LOG
.
debug
(
"Code search complete: {}, memory usage: {}"
,
searchStr
,
Utils
.
memoryInfo
());
LOG
.
debug
(
"Code search complete: {}, memory usage: {}"
,
searchStr
,
U
iU
tils
.
memoryInfo
());
emitter
.
onComplete
();
},
BackpressureStrategy
.
LATEST
);
}
...
...
jadx-gui/src/main/java/jadx/gui/utils/search/StringRef.java
View file @
9189f23e
...
...
@@ -6,7 +6,7 @@ import java.util.List;
import
org.jetbrains.annotations.NotNull
;
import
static
jadx
.
gui
.
utils
.
Utils
.
caseChar
;
import
static
jadx
.
gui
.
utils
.
U
iU
tils
.
caseChar
;
public
class
StringRef
implements
CharSequence
{
...
...
jadx-gui/src/main/java/jadx/gui/utils/search/TextSearchIndex.java
View file @
9189f23e
...
...
@@ -22,7 +22,7 @@ import jadx.gui.treemodel.JNode;
import
jadx.gui.ui.SearchDialog
;
import
jadx.gui.utils.CodeLinesInfo
;
import
jadx.gui.utils.JNodeCache
;
import
jadx.gui.utils.Utils
;
import
jadx.gui.utils.U
iU
tils
;
import
static
jadx
.
gui
.
ui
.
SearchDialog
.
SearchOptions
.
CLASS
;
import
static
jadx
.
gui
.
ui
.
SearchDialog
.
SearchOptions
.
CODE
;
...
...
@@ -126,13 +126,13 @@ public class TextSearchIndex {
return
;
}
}
if
(!
Utils
.
isFreeMemoryAvailable
())
{
LOG
.
warn
(
"Skipped code search stopped due to memory limit: {}"
,
Utils
.
memoryInfo
());
if
(!
U
iU
tils
.
isFreeMemoryAvailable
())
{
LOG
.
warn
(
"Skipped code search stopped due to memory limit: {}"
,
U
iU
tils
.
memoryInfo
());
emitter
.
onComplete
();
return
;
}
}
LOG
.
debug
(
"Skipped code search complete: {}, memory usage: {}"
,
searchStr
,
Utils
.
memoryInfo
());
LOG
.
debug
(
"Skipped code search complete: {}, memory usage: {}"
,
searchStr
,
U
iU
tils
.
memoryInfo
());
emitter
.
onComplete
();
},
BackpressureStrategy
.
LATEST
);
}
...
...
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