Skip to content

Commit afa547c

Browse files
Improve flexibility
1 parent 727df3e commit afa547c

File tree

7 files changed

+103
-114
lines changed

7 files changed

+103
-114
lines changed

MyJavaTools.sh

Lines changed: 0 additions & 111 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ Run command `bash Install.sh` to install required dependencies.
1313

1414
## The App
1515

16-
![Screenshoot](https://github.com/zavierferodova/Android-Java-Tools/blob/master/media/Screenshot.png?raw=true)
16+
![Screenshoot](https://github.com/zavierferodova/Android-Java-Tools/blob/master/media/Screenshot.jpg?raw=true)

Install.sh renamed to install

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
chmod +x MyJavaTools.sh
2-
cp MyJavaTools.sh /data/data/com.termux/files/usr/bin
1+
#!/bin/bash
2+
chmod +x myjavatools
3+
cp myjavatools /data/data/com.termux/files/usr/bin
34
pkg update
45
pkg install ecj && pkg install dx && pkg install zip && pkg install unzip

media/Screenshot.jpg

179 KB
Loading

media/Screenshot.png

-53.7 KB
Binary file not shown.

myjavatools

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/bin/bash
2+
3+
banner() {
4+
echo " __ __ _ _____ _ "
5+
echo "| \/ |_ _ | | __ ___ ____ _ |_ _|__ ___ | |___ "
6+
echo "| |\/| | | | | _ | |/ _' \ \ / / _' | | |/ _ \ / _ \| / __| "
7+
echo "| | | | |_| | | |_| | (_| |\ V / (_| | | | (_) | (_) | \__ \ "
8+
echo "|_| |_|\__, | \___/ \__,_| \_/ \__,_| |_|\___/ \___/|_|___/ "
9+
echo " |___/ "
10+
echo "=============================================================== "
11+
echo -e " Coded By: Zavier Ferodova\n"
12+
}
13+
14+
pause() {
15+
read -s -n 1 -p "Press any key to continue . . ."
16+
}
17+
18+
load() {
19+
clear
20+
banner
21+
current_dir=$(pwd)
22+
echo "Active directory :"
23+
echo -e "$current_dir\n"
24+
echo "Menu :"
25+
echo "[1] Compile Java Files"
26+
echo "[2] Make Dex File"
27+
echo "[3] Delete Classes File"
28+
echo "[4] Run Program"
29+
echo "[#] Exit"
30+
echo "========================="
31+
echo -n "-> "
32+
read Menu
33+
34+
if [ $Menu = "1" ]; then
35+
clear
36+
banner
37+
java_files=$(find $current_dir -name \*.java)
38+
echo "Compiling..."
39+
ecj $java_files
40+
echo "Finish"
41+
pause
42+
load
43+
elif [ $Menu = "2" ]; then
44+
clear
45+
banner
46+
class_files=$(find $current_dir -name \*.class)
47+
if [[ "" == *"$class_files"* ]]; then
48+
echo -e "Please compile java file frist !\n"
49+
pause
50+
load
51+
fi
52+
53+
echo -e "\nThis process will make output .jar and .dex files";
54+
echo -n "Dex filename : "
55+
read filename
56+
57+
zip -r "$filename.jar" . -x \*.java
58+
dx --dex --output "$filename.dex" "$filename.jar"
59+
pause
60+
load
61+
elif [ $Menu = "3" ]; then
62+
clear
63+
banner
64+
class_files=$(find $current_dir -name \*.class)
65+
rm $class_files
66+
echo "Classes file deleted!"
67+
pause
68+
load
69+
elif [ $Menu = "4" ]; then
70+
clear
71+
banner
72+
echo "Run with : [file.dex] [MainClass]"
73+
echo -e "Example : hello.dex Main\n"
74+
echo "List of dex file :"
75+
listing=$(find $(pwd) -name \*.dex)
76+
echo $listing | sed "s|^$current_dir/||"
77+
echo -n -e "\n-> "
78+
read input
79+
clear
80+
dalvikvm -cp $input
81+
elif [ $Menu = "#" ]; then
82+
exit
83+
else
84+
echo -e "\nSorry, system doesn't reconigze your input";
85+
pause
86+
load
87+
fi
88+
}
89+
90+
load

uninstall

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
termux_bin=/data/data/com.termux/files/usr/bin
4+
5+
if [[ ! "No such file or directory" == *"$(ls myjavatools)"* ]]; then
6+
rm $termux_bin/myjavatools
7+
fi
8+
9+
echo "Uninstall completed!"

0 commit comments

Comments
 (0)