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
df9ae295
Commit
df9ae295
authored
Oct 25, 2018
by
Jan S
Committed by
skylot
Oct 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: make the import class name clickable (#378)
parent
8c348c93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
ClassGen.java
jadx-core/src/main/java/jadx/core/codegen/ClassGen.java
+18
-1
No files found.
jadx-core/src/main/java/jadx/core/codegen/ClassGen.java
View file @
df9ae295
...
...
@@ -91,7 +91,24 @@ public class ClassGen {
Collections
.
sort
(
sortImports
);
for
(
String
imp
:
sortImports
)
{
clsCode
.
startLine
(
"import "
).
add
(
imp
).
add
(
';'
);
ClassInfo
importClassInfo
=
ClassInfo
.
fromName
(
cls
.
dex
().
root
(),
imp
);
ClassNode
classNode
=
cls
.
dex
().
resolveClass
(
importClassInfo
);
// Clickable element seems to be limited by the next dot, therefore
// we can't just use the complete class name including packagename
int
clsDotIdx
=
imp
.
lastIndexOf
(
'.'
);
String
pkg
=
""
;
if
(
clsDotIdx
>=
0
)
{
pkg
=
imp
.
substring
(
0
,
clsDotIdx
+
1
);
imp
=
imp
.
substring
(
clsDotIdx
+
1
);
}
clsCode
.
startLine
(
"import "
);
clsCode
.
add
(
pkg
);
if
(
classNode
!=
null
)
{
// attach the clickable link info to the class name
clsCode
.
attachAnnotation
(
classNode
);
}
clsCode
.
add
(
imp
);
clsCode
.
add
(
';'
);
}
clsCode
.
newLine
();
...
...
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