FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java-tools/compilestandard.java at master · javaarchive/java-tools · GitHub
This repository was archived by the owner on Feb 29, 2024. It is now read-only.
javaarchive
/
java-tools
Public archive
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
java-tools
/
compilestandard.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (50 loc) · 1.62 KB
Breadcrumbs
java-tools
/
compilestandard.java
Copy path
File metadata and controls
57 lines (50 loc) · 1.62 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import
java
.
io
.*;
import
java
.
security
.
MessageDigest
;
import
java
.
security
.*;
public
class
compilestandard
extends
javatools
{
public
static
String
sha256
(
String
input
)
throws
NoSuchAlgorithmException
{
MessageDigest
mDigest
=
MessageDigest
.
getInstance
(
"SHA-256"
);
byte
[]
result
=
mDigest
.
digest
(
input
.
getBytes
());
StringBuffer
sb
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
result
.
length
;
i
++) {
sb
.
append
(
Integer
.
toString
((
result
[
i
] &
0xff
) +
0x100
,
16
).
substring
(
1
));
}
return
sb
.
toString
();
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
// TODO Auto-generated method stub
BufferedReader
f
;
if
(
args
.
length
==
1
) {
if
(
args
[
0
].
equals
(
"eclipse"
)) {
f
=
mreader
(
"src/javatools.java"
);
}
else
{
f
=
mreader
(
"javatools.java"
);
}
}
else
{
f
=
mreader
(
"javatools.java"
);
}
print
(
"build"
);
String
st
;
String
full
=
""
;
while
((
st
=
f
.
readLine
()) !=
null
) {
full
=
full
+
st
+
"
\n
"
;
}
String
text
=
full
.
replace
(
"if(!(lock)) {return null;}"
,
""
);
text
=
text
.
replace
(
"public abstract class usacotools"
,
"public abstract class jt"
);
print
(
text
);
PrintWriter
pw
=
mwriter
(
"jt.java"
);
if
(
args
[
0
].
equals
(
"eclipse"
)) {
pw
=
mwriter
(
"src/jt.java"
);
}
else
{
}
pw
.
println
(
text
);
pw
.
close
();
print
(
"jt.java is the one you should copy into your code but usacotools is the one you should extend"
);
try
{
print
(
"jt.java SHA256: "
+
sha256
(
text
));
print
(
"javatools.java SHA256: "
+
sha256
(
full
));
}
catch
(
Exception
e
) {
e
.
printStackTrace
();
}
}
}
Back
|
FazBrowse Home
|
New Git URL