Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
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
772c664d
Commit
772c664d
authored
Mar 28, 2013
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store version number in manifest
parent
29840e03
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
3 deletions
+31
-3
build.gradle
build.gradle
+2
-1
Consts.java
src/main/java/jadx/Consts.java
+3
-1
JadxArgs.java
src/main/java/jadx/JadxArgs.java
+1
-1
Utils.java
src/main/java/jadx/utils/Utils.java
+24
-0
version
version
+1
-0
No files found.
build.gradle
View file @
772c664d
...
...
@@ -7,9 +7,10 @@ apply plugin: 'idea'
sourceCompatibility
=
1.6
targetCompatibility
=
1.6
version
=
'dev'
version
=
file
(
'version'
).
readLines
().
get
(
0
)
mainClassName
=
"jadx.Main"
manifest
.
mainAttributes
(
"jadx-version"
:
version
)
project
.
ext
{
mainSamplesClass
=
"jadx.samples.RunTests"
...
...
src/main/java/jadx/Consts.java
View file @
772c664d
package
jadx
;
import
jadx.utils.Utils
;
public
class
Consts
{
public
static
final
String
JADX_VERSION
=
"dev"
;
public
static
final
String
JADX_VERSION
=
Utils
.
getJadxVersion
()
;
public
static
final
boolean
DEBUG
=
false
;
...
...
src/main/java/jadx/JadxArgs.java
View file @
772c664d
...
...
@@ -110,7 +110,7 @@ public class JadxArgs {
JCommander
jc
=
new
JCommander
(
this
);
// print usage in not sorted fields order (by default its sorted by description)
PrintStream
out
=
System
.
out
;
out
.
println
(
"jadx - dex to java decompiler, version:
'"
+
Consts
.
JADX_VERSION
+
"'"
);
out
.
println
(
"jadx - dex to java decompiler, version:
"
+
Consts
.
JADX_VERSION
);
out
.
println
();
out
.
println
(
"usage: jadx [options] "
+
jc
.
getMainParameterDescription
());
out
.
println
(
"options:"
);
...
...
src/main/java/jadx/utils/Utils.java
View file @
772c664d
package
jadx
.
utils
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.net.URL
;
import
java.util.Enumeration
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.jar.Manifest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
public
class
Utils
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
Utils
.
class
);
public
static
String
cleanObjectName
(
String
obj
)
{
int
last
=
obj
.
length
()
-
1
;
...
...
@@ -52,4 +60,20 @@ public class Utils {
}
return
sb
.
toString
();
}
public
static
String
getJadxVersion
()
{
try
{
Enumeration
<
URL
>
resources
=
new
Utils
().
getClass
().
getClassLoader
().
getResources
(
"META-INF/MANIFEST.MF"
);
while
(
resources
.
hasMoreElements
())
{
Manifest
manifest
=
new
Manifest
(
resources
.
nextElement
().
openStream
());
String
ver
=
manifest
.
getMainAttributes
().
getValue
(
"jadx-version"
);
if
(
ver
!=
null
)
return
ver
;
}
}
catch
(
IOException
e
)
{
LOG
.
error
(
"Can't get manifest file"
,
e
);
}
return
"dev"
;
}
}
version
0 → 100644
View file @
772c664d
0.4
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