Skip to content

Commit

Permalink
Add ycable check; updated APK
Browse files Browse the repository at this point in the history
APK should have latest ycable on/off in services.

Signed-off-by: binkybear <[email protected]>
  • Loading branch information
binkybear committed Nov 2, 2015
1 parent 3503e6b commit 04f7b0e
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
Binary file modified flash/data/app/nethunter.apk
Binary file not shown.
51 changes: 48 additions & 3 deletions flash/system/bin/bootkali
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
busybox=/data/local/bin/busybox
#!/system/bin/sh

if [ -x /system/xbin/busybox ]; then
busybox=/system/xbin/busybox
elif [ -x /data/local/bin/busybox ]; then
busybox=/data/local/bin/busybox
elif [ -x /system/bin/busybox ]; then
busybox=/system/bin/busybox
else
echo "Busybox not found! Install it!";
log "Busybox not found! Install it!";
exit;
fi

su 0 setenforce 0

######### CHECK FOR ROOT #########
Expand Down Expand Up @@ -73,7 +86,7 @@ fi
# mana-bdf, msf, fruitywifi
# --------------- SINGLE ARGUMENT ------------------------- #
# hid-cmd, hid-cmd-elevated-win[7-8], wifite, iptables, update
# start-rev-met, start-rev-met-elevated-win[8-7]
# start-rev-met, start-rev-met-elevated-win[8-7], dumpmifare

if [ $# -eq 0 ]; then
$busybox chroot $mnt /bin/bash -l
Expand Down Expand Up @@ -181,6 +194,12 @@ else
fi


#MFOC MIFARE DUMP

if [ "$1" == "dumpmifare" ]; then
$busybox chroot $mnt /usr/bin/dumpmifare.sh
fi

#OPENVPN

if [ "$1" == "openvpn" ] && [ "$2" == "start" ]; then
Expand Down Expand Up @@ -296,6 +315,32 @@ else
$busybox chroot $mnt /usr/bin/kalimenu
fi

#YCABLE ¯\_(ಠ_ಠ)_/¯

if [ "$1" == "ycable" ] && [ "$2" == "start" ]; then
if [ -f "/sys/module/msm_otg/parameters/usbhost_charge_mode" ]; then
echo "1" > /sys/module/msm_otg/parameters/usbhost_charge_mode
fi
if [ -f "/sys/module/tegra_otg/parameters/tegra_otg_on_charging" ]; then
echo "Y" > /sys/module/tegra_otg/parameters/tegra_otg_on_charging
fi
if [ -f "/sys/module/dwc3/parameters/aca_enable" ]; then
echo "Y" > /sys/module/dwc3/parameters/aca_enable
fi
fi

if [ "$1" == "ycable" ] && [ "$2" == "stop" ]; then
if [ -f "/sys/module/msm_otg/parameters/usbhost_charge_mode" ]; then
echo "0" > /sys/module/msm_otg/parameters/usbhost_charge_mode
fi
if [ -f "/sys/module/tegra_otg/parameters/tegra_otg_on_charging" ]; then
echo "N" > /sys/module/tegra_otg/parameters/tegra_otg_on_charging
fi
if [ -f "/sys/module/dwc3/parameters/aca_enable" ]; then
echo "N" > /sys/module/dwc3/parameters/aca_enable
fi
fi

#CUSTOM BUTTONS
if [ "$1" == "custom_cmd" ]; then
commmand=""
Expand All @@ -307,4 +352,4 @@ else
done
$busybox chroot $mnt $commmand
fi
fi
fi
10 changes: 10 additions & 0 deletions flash/system/xbin/check-ycable
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
unset LD_PRELOAD
CHECKMSM=$(cat /sys/module/msm_otg/parameters/usbhost_charge_mode)
CHECKTEGRA=$(cat /sys/module/tegra_otg/parameters/tegra_otg_on_charging)
CHECKDWC3=$(cat /sys/module/dwc3/parameters/aca_enable)

if [[ $CHECKTEGRA == 'Y' ]] || [[ $CHEKMSM == "1" ]] || [[ $CHECKDWC3 == "Y" ]]; then
echo "1"
else
echo "0"
fi

0 comments on commit 04f7b0e

Please sign in to comment.