Skip to content

Instantly share code, notes, and snippets.

@hosamn
Forked from sleirsgoevy/serve_img.sh
Created December 17, 2021 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hosamn/fafabd47dc18d9a7f5fadf0bfbd5af90 to your computer and use it in GitHub Desktop.
Save hosamn/fafabd47dc18d9a7f5fadf0bfbd5af90 to your computer and use it in GitHub Desktop.
Script for enabling mass storage emulation on rooted Samsung phones
A=/sys/class/android_usb/android0
set -x
killall -STOP adbd
sleep 1
echo 0 > $A/enable
echo mass_storage > $A/functions
echo disk > $A/f_mass_storage/luns
echo 1 > $A/enable
sleep 1
echo 0 > $A/enable
echo "$1" > $A/f_mass_storage/lun0/file
echo 1 > $A/enable
A=/sys/class/android_usb/android0
set -x
echo 0 > $A/enable
echo mtp,acm,ffs > $A/functions
echo 1 > $A/enable
killall -CONT adbd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment