|
1 | 1 | #!/bin/bash |
2 | | -PACKAGE_NAME=zphisher |
3 | | -ZPHISHER_VERSION=2.2 |
4 | | -PACKAGE_ARCH=all |
5 | | -DISTRO=$(uname -o) |
6 | | - |
7 | | - |
8 | | -build_package() { |
9 | | - # define variables depending on detected platform |
10 | | - distr_name=$1 |
11 | | - if [ "$distr_name" == "Android" ]; then |
12 | | - platform="Termux" |
13 | | - path_part="data/data/com.termux/files/" |
14 | | - else |
15 | | - platform="Debian" |
16 | | - path_part="" |
17 | | - fi |
18 | | - # print out message with detected platform |
19 | | - echo "Building .deb package for: $platform" |
20 | | - # run preparations and build package |
21 | | - platform=${platform^^} |
22 | | - mkdir -p ./package/DEBIAN |
23 | | - mkdir -p ./package/"$path_part"usr/bin |
24 | | - mkdir -p ./package/"$path_part"usr/opt |
25 | | - cp -rf ./.package/"$platform"/control ./package/DEBIAN/control |
26 | | - mkdir -p package/"$path_part"usr/opt/$PACKAGE_NAME |
27 | | - cp -rf ./LICENSE ./.sites ./.imgs ./zphisher.sh ./package/"$path_part"usr/opt/$PACKAGE_NAME |
28 | | - cp -rf ./.package/launch.sh ./package/"$path_part"usr/bin/$PACKAGE_NAME |
29 | | - chmod 755 ./package/DEBIAN |
30 | | - dpkg-deb --build ./package $PACKAGE_NAME\_$ZPHISHER_VERSION\_$PACKAGE_ARCH.deb |
31 | | -} |
32 | | - |
33 | | - |
34 | | -# launch the build |
35 | | -build_package $DISTRO |
| 2 | + |
| 3 | +# Make Deb Package for Zphisher (^.^) |
| 4 | +_PACKAGE=zphisher |
| 5 | +_VERSION=2.3.0 |
| 6 | +_ARCH="all" |
| 7 | +PKG_NAME="${_PACKAGE}_${_VERSION}_${_ARCH}.deb" |
| 8 | + |
| 9 | +if [[ ! -e "scripts/launch.sh" ]]; then |
| 10 | + echo "lauch.sh should be in the \`scripts\` Directory. Exiting..." |
| 11 | + exit 1 |
| 12 | +fi |
| 13 | + |
| 14 | +if [[ ${1,,} == "termux" || $(uname -o) == *'Android'* ]];then |
| 15 | + _depend="ncurses-utils, proot, resolv-conf, " |
| 16 | + _bin_dir="data/data/com.termux/files/" |
| 17 | + _opt_dir="data/data/com.termux/files/usr/" |
| 18 | + #PKG_NAME=${_PACKAGE}_${_VERSION}_${_ARCH}_termux.deb |
| 19 | +fi |
| 20 | + |
| 21 | +_depend+="curl, php, unzip" |
| 22 | +_bin_dir+="usr/bin" |
| 23 | +_opt_dir+="opt/${_PACKAGE}" |
| 24 | + |
| 25 | +if [[ -d "build_env" ]]; then rm -fr build_env; fi |
| 26 | +mkdir -p build_env |
| 27 | +mkdir -p ./build_env/${_bin_dir} ./build_env/$_opt_dir ./build_env/DEBIAN |
| 28 | + |
| 29 | +cat <<- CONTROL_EOF > ./build_env/DEBIAN/control |
| 30 | +Package: ${_PACKAGE} |
| 31 | +Version: ${_VERSION} |
| 32 | +Architecture: ${_ARCH} |
| 33 | +Maintainer: @htr-tech |
| 34 | +Depends: ${_depend} |
| 35 | +Homepage: https://github.com/htr-tech/zphisher |
| 36 | +Description: An automated phishing tool with 30+ templates. This Tool is made for educational purpose only ! |
| 37 | +CONTROL_EOF |
| 38 | + |
| 39 | +cat <<- PRERM_EOF > ./build_env/DEBIAN/prerm |
| 40 | +#!/bin/bash |
| 41 | +rm -fr $_opt_dir |
| 42 | +exit 0 |
| 43 | +PRERM_EOF |
| 44 | + |
| 45 | +chmod 755 ./build_env/DEBIAN/{control,prerm} |
| 46 | +cp -fr scripts/launch.sh ./build_env/$_bin_dir/$_PACKAGE |
| 47 | +chmod 755 ./build_env/$_bin_dir/$_PACKAGE |
| 48 | +cp -fr .github/ .sites/ LICENSE README.md zphisher.sh ./build_env/$_opt_dir |
| 49 | +dpkg-deb --build ./build_env ${#PKG_NAME} |
| 50 | +rm -fr ./build_env |
0 commit comments