-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
obfuscate
executable file
·66 lines (52 loc) · 1.26 KB
/
obfuscate
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
58
59
60
61
62
63
64
65
66
#
# Obfuscate Arahant using ProGuard 6.0.3
PROGUARD=/opt/proguard/lib/proguard.jar
if [ ! -f $PROGUARD ]; then
echo ProGuard obfuscator cannot be found at $PROGUARD
exit 1
fi
if [ ! -f dist/Arahant.war ]; then
echo Arahant.war does not exist. You must build first.
exit 1
fi
cp arahant.pro dist
cd dist
echo Removing old files
rm -rf SecureArahant.map SecureArahantWithoutLibs.war Secure Arahant libs ArahantSharedLibs.war ArahantWithoutLibs.war
echo Unpacking Arahant.war
mkdir Arahant
cd Arahant
jar xf ../Arahant.war
echo Moving libraries
cd WEB-INF/lib
mkdir ../../../libs
mkdir save
mv abcl.jar save
mv *.jar ../../../libs
mv save/* .
rmdir save
cd ../..
echo Creating ArahantWithoutLibs.war
jar cf ../ArahantWithoutLibs.war *
cd ..
echo Creating Secure tree
mkdir Secure
cd Secure
(cd ../Arahant ; tar cf - .) | tar xf -
# jar xf ../ArahantWithoutLibs.war
echo Removing unobfuscated class files
find . -name '*.class' -exec rm \{\} \;
cd ..
java -Xmx1G -jar $PROGUARD @arahant.pro
echo Creating SecureArahantWithoutLibs.war
cd Secure
jar cf ../SecureArahantWithoutLibs.war *
cd ..
echo Creating ArahantSharedLibs.war
cd libs
#rm DRCMessaging.jar
jar cf ../ArahantSharedLibs.war *
cd ..
echo Removing work directories
rm -rf Secure Arahant libs arahant.pro
cd ..