[SCRIPT][ANDROID] SUDo for Android - Android General

Earlier today I came up with the idea of a sudo implementation for Android. I mean, it's pretty tiring to have to enter 'su' first before issuing root commands, right? Sometimes we even forget to do that.
Description:
Well, this isn't a binary, but a script. What it does is just take the commands you pass to it and append it to 'su -c.'
I know it's dead simple but I wanted to bring this over to Android in an easy way, and I had free time
Usage:
Code:
sudo [command] - run [command] as root
sudo -b - use bash as root
sudo -s - like -b, but with sh
sudo -h - display the help message
Download:
Dropbox
Put it in /system/bin or /system/xbin, set perms to 755.

Changelog:
v1.1
• added support for parameters passed to the command that needs root privileges, e.g 'sudo mount -t'
v1.0
• initial release
Click to expand...
Click to collapse
Sent from my GT-I8730 using Tapatalk

And another!
Sent from my GT-I8730 using Tapatalk

Link down
Inviato dal mio Nexus 4 utilizzando Tapatalk

jacomail95 said:
Link down
Inviato dal mio Nexus 4 utilizzando Tapatalk
Click to expand...
Click to collapse
Updated

Related

[Q] Can't install apps , insufficient space

So I searched around, and found nothing for the Sensation regarding this. While restoring my previous apps from the market(re download, forgot to nandroid) it says
"Error downloading "RandomApp" There is insufficient space on the device" Anyone know how to fix this?
Wrong section buddy. Pls post questions in the q&a section!
Sent from my HTC Sensation Z710e using XDA Premium App
if rooted, using Terminal:
Code:
cd /cache
su
mkdir /mnt/sdcard/market-cache
mv download download.bak
ln -s /mnt/sdcard/download download
exit
moves your market-cache to the SDcard. give it a shot...
anotherdroid said:
if rooted, using Terminal:
Code:
cd /cache
su
mkdir /mnt/sdcard/market-cache
mv download download.bak
ln -s /mnt/sdcard/download download
exit
moves your market-cache to the SDcard. give it a shot...
Click to expand...
Click to collapse
I have the Android Revolution Rom, but Terminal is not already installed, and it wont let me install it Will a direct download of an apk file work?
Hi. I was have the same problem.
For me the solution was enter on recovery and wipe cache.
Enviado desde mi HTC Sensation
OK I found an apk but it says "Failed on 'download' no such file or directory
Do you have adb installed on your computer if you do then type
"adb shell" in a command prompt window. Then type those commands mentioned earlier.
raxor said:
Hi. I was have the same problem.
For me the solution was enter on recovery and wipe cache.
Enviado desde mi HTC Sensation
Click to expand...
Click to collapse
That worked! THANKS!
Ali_Shaikh said:
That worked! THANKS!
Click to expand...
Click to collapse
You're welcome!
Enviado desde mi HTC Sensation Z710e
anotherdroid said:
if rooted, using Terminal:
Code:
cd /cache
su
mkdir /mnt/sdcard/market-cache
mv download download.bak
ln -s /mnt/sdcard/download download
exit
moves your market-cache to the SDcard. give it a shot...
Click to expand...
Click to collapse
When I try the cd /cache
I get Permission denied.
My device is rooted. How can I add this to the list of allowed apps? Other apps have a setting or asked when I started them, and I set them to allow access all the time.

2.10 sms app

Hi, is possible to substitute the standard sms app with the one from 2.10 sense 3 rom on a rooted and S-OFF 1.47 standard rom?
Inviato dal mio HTC Desire S usando Tapatalk
heavyhms said:
Hi, is possible to substitute the standard sms app with the one from 2.10 sense 3 rom on a rooted and S-OFF 1.47 standard rom?
Inviato dal mio HTC Desire S usando Tapatalk
Click to expand...
Click to collapse
This is not the place to request guys...please maintain the decorum and rules...its a general section post ???
He's right, this is the wrong forum
But here are the steps you will have to follow:
A:android-sdk-windows installed
B: (on your phone) go to menu>settings>applications>development and make sure usb debugging is checked.
B1: Connect your phone with the computed in CHARGING MODE
C: the file you are pushing must be placed in the tools folder of adb
so if you are pushing file "build.prop.txt" this needs to be downloaded/copy and pasted in C:\android-sdk-windows\tools
C1: open command promt
C2: type cd C:\android-sdk-windows\tools [or your sdk directory]
C3: type adb remount
C4: type adb devices
C5: type adb push FFFFFFF.FFF /#####/######
ie: adb push mms.apk /system/app => this is the command you need actually.
C6. type adb reboot this is how you finish
Click to expand...
Click to collapse
Here is the link for 2.1 Sense mms.apk: http://minus.com/lbw3lSrcf2tnyf
Here is the link for 3.0 Sense mms.apk: http://minus.com/l4xYSsH3jAPbz
Sorry, i've posted in wrong section for my mistake using tapatalk
thank you very much for answer, but mms app from 2.10 crash on 1.47 rom...

[UPDATE][SCRIPT][OTA-UPDATE][06/08/12][NOREFLASH] OTA-Updater

So, as the name says, OTA-Updater (Script) for LG Optimus One (no, every device )
You can also use it on Linux, e.g. Ubuntu, Debian and Mint!
You need:
- A server:
I'm using Square7
- A rooted phone
- Busybox
- Terminal Emulator
This Script will not search for updates in background, you need to start the script (via Terminal Emulator) to check for updates
I'm not responsible for any damage to your phone.
PLEASE READ EVERYTHING CAREFULLY BEFORE POSTING SOMETHING LIKE
'This doesn't work!' or 'That's spamming!!!'
Guys, there is a REPORT-button, use it instead spamming the thread!!!
1. First, create your own server, I'm using Square7 or you can also use Funpic;
I recommend that you use Square7
2. Install Busybox from Play Store (Busybox Installer), if not installed. It's pre-installed on almost every ROM
3. Create a file called "version.xml"(what file (e.g. xml,txt) doesn't matter) on your server, and type in it the latest available version.
YOU NEED TO EDIT THE FILE EVERYTIME YOU UPDATED THE ROM
4. Now, create a file called "update.xml" on your phone, located in /system/ (Don't forget to mount system) and type in it the running version on the phone
So, now the script
The script should start with this:
Code:
#!/system/bin/sh
___
Check if user is running as root;
If no, then message "You are not running this scripts as root."; Abort:
Code:
id=`id`; id=`echo ${id#*=}`; id=`echo ${id%%\(*}`; id=`echo ${id%%gid*}`
if test "$id" != "0" && test "$id" != "root"; then
echo " You are not running this script as root."
exit 0
fi
___
Mount system read-write:
Code:
busybox mount -o remount,rw /system
___
Now, the script should search for updates; first download a file (I'm using .XML file; doesn't matter what file):
Code:
wget -q http://your-server.server.com/version.xml -P /sdcard/Folder/
___
Compare downloaded file with "update.xml" on /system/:
If files are the same (No update), Message: "No update available."; Abort
Else (Update available), Message: "Update available"
Code:
if diff /sdcard/Folder/version.xml /system/update.xml
then
echo "No update available"
echo "Aborted"
exit 0
else
echo "Update available!"
fi
___
Clean up folder:
Code:
rm /sdcard/Folder/*
___
Update available, download "update.zip" (Read everything carefully, if you read everything carefully, you'll know what the file should contain...):
Code:
wget -q http://your-server.server.com/update.zip -P /sdcard/Folder/
___
Unzip "update.zip":
Code:
unzip -q /sdcard/Folder/update.zip -d /sdcard/Folder/
___
Set permissions:
Code:
chmod 0777 /sdcard/Folder/updater.sh
___
Update ROM:
Code:
sh /sdcard/Folder/updater.sh
First phase done, save the file as "update" (Not .TXT or XML, nothing) and copy the file to /system/bin/ and set permissions
___________
Update.zip
So, now the update.zip:
This file contains system-files, the new update.xml and the updater-script (.sh, not the updater-script in flashable packages!!!)
So, first, you need to SAVE the files to the update.zip, I mean do not compress or something else, only SAVE, else "Unzip" wont work
SAVE all changed files to update.zip
Upload the update.zip to your server. You need to edit the update.zip everytime, when you updated the ROM
Now, the updater.sh:
It should start with this:
Code:
#!/system/bin/sh
___
Now, the changed files should be copied to them right location:
I've only changed the build.prop, it's a example, you can change everything you want:
Code:
cp -f /sdcard/Folder/build.prop /system/
___
COPY THE NEW update.xml TO SYSTEM :
Code:
cp /sdcard/Folder/update.xml /system/
___
Reboot:
Code:
reboot
___
And done!
If you want to update:
1. Start Terminal Emulator
2. Type su and press ENTER
3. Type update and press ENTER
4. Updating...
Customize it, and add more functions, but I'll update this script anyway.
___
My "Update" in /system/bin/ looks like this:
Code:
#!/system/bin/sh
id=`id`; id=`echo ${id#*=}`; id=`echo ${id%%\(*}`; id=`echo ${id%%gid*}`
if test "$id" != "0" && test "$id" != "root"; then
echo " You are not running this script as root."
exit 0
fi
busybox mount -o remount,rw /system
wget -q http://cloudos.square7.ch/Update/One/version.xml -P /sdcard/CloudOS/update/
if diff /sdcard/CloudOS/update/version.xml /system/update.xml
then
echo "No update available"
echo "Aborted"
exit 0
else
echo "Update available!"
fi
rm /sdcard/CloudOS/update/*
wget -q http://cloudos.square7.ch/Update/One/update.zip -P /sdcard/CloudOS/update/
unzip /sdcard/CloudOS/update/update.zip /sdcard/CloudOS/update/
chmod 0777 /sdcard/CloudOS/update/updater.sh
sh /sdcard/CloudOS/update/updater.sh
And my updater.sh:
Code:
#!/system/bin/sh
cp -f /sdcard/CloudOS/update/build.prop /system/
cp -f /sdcard/CloudOS/update/update.xml /system/
reboot
If you want to use my work, then your work must be open-source, too!
CHANGELOG:
06/08/12:
- Added "Check root before updating"-feature
04/08/12:
- Initial release
Plans:
- Better thread-design
- Improved script
Smart kid, LOL XD
Nice work kid, this is actually cool!
Soon we shall have ROMs 10mb-30mb
This is what i want to tell you: made a useful thing for the community.
Great Job!
thachtunganh said:
This is what i want to tell you: made a useful thing for the community.
Great Job!
Click to expand...
Click to collapse
And I did it
Will upload next update tomorrow, changelog:
- Check root before updating
- Will upload completed files
- Better thread-design
Gesendet von meinem LG-P500 mit Tapatalk 2
Tach is right you have contributed much to this subforum
Sorry for my english
JeduRocks said:
Tach is right you have contributed much to this subforum
Sorry for my english
Click to expand...
Click to collapse
He said great job, I don't understand what you mean...
fd1999 said:
He said great job, I don't understand what you mean...
Click to expand...
Click to collapse
Use Google translate xd
Enviado desde mi LG-P500 usando Tapatalk 2
JeduRocks said:
Use Google translate xd
Enviado desde mi LG-P500 usando Tapatalk 2
Click to expand...
Click to collapse
Lol, I can speak English as well, but this is my first post in this subforum (Original Android development) and you said I posted to much in this subforum ?!?
fd1999 said:
Lol, I can speak English as well, but this is my first post in this subforum (Original Android development) and you said I posted to much in this subforum ?!?
Click to expand...
Click to collapse
He said you contributed much to this subforum!! It's a good thing keep it up little buddy :thumbup:
Sent from my LG-P500 using xda premium
thedoginme87 said:
He said you contributed much to this subforum!! It's a good thing keep it up little buddy :thumbup:
Sent from my LG-P500 using xda premium
Click to expand...
Click to collapse
Okay, I misread his post
I thought he said 'posted' instead 'contributed', I was scrolling at the moment
How you did to create the version.xml file on the server? And in what server you bases the update? Magic update?
Enviado desde mi Galaxy Nexus usando Tapatalk HD
fd1999 said:
Lol, I can speak English as well, but this is my first post in this subforum (Original Android development) and you said I posted to much in this subforum ?!?
Click to expand...
Click to collapse
Subforum: LG Optimus One
Enviado desde mi LG-P500 usando Tapatalk 2
edinrh said:
How you did to create the version.xml file on the server? And in what server you bases the update? Magic update?
Enviado desde mi Galaxy Nexus usando Tapatalk HD
Click to expand...
Click to collapse
Just create a version.xml, type in the,latest available version (e.g. 1.0.1) and upload it. Square7, I said. Read my post.
Script updated, Changelog:
- Added "Check root before updating"-feature
EDIT: I'm senior member, now
fd1999 said:
Just create a version.xml, type in the,latest available version (e.g. 1.0.1) and upload it. Square7, I said. Read my post.
Click to expand...
Click to collapse
My question is: how to upload that file on Square7?
Enviado desde mi Galaxy Nexus usando Tapatalk HD
edinrh said:
My question is: how to upload that file on Square7?
Click to expand...
Click to collapse
Well, you apparently missed the purpose of this script. :laugh:
Just read...
edinrh said:
My question is: how to upload that file on Square7?
Enviado desde mi Galaxy Nexus usando Tapatalk HD
Click to expand...
Click to collapse
You can google for it, but some guys are too lazy...
So, create a server on Square7 and download FileZilla or also another FTP Client.
Start FileZilla, and configure it like this(in this example, my server is "cloudos.square7.ch"):
Server: cloudos.square7.ch
Username: cloudos
Password: Don't think I'm stupid
Port: Don't enter anything
And press "Connect". Now you have access to the server. On the left side, you see your files, located on the PC.
On the right site, the files on your server. On the left site, search for the file you want to upload and douple-click it
or drag & drop it to your server. Done!

[SCRIPT] Recovery & Kernel Management Tool

Hi guys,
I had some free time and decided to write this script specially for Terminal Emulator's users like me.
It's a simple script allows you to:
Backup
Restore backup
Flash
Reboot in any mode
Copy the script to /system/bin
recovery and /or kernel IMG files without the need to input so long codes again and again.
This script will make a new folder named Recovery-Kernel-Tools in your internal storage, including 3 more folders inside it:
Backups (max one backup for each partition, names are "case-sensitive")
Flash (but any recovery.img / boot.img to flash them, names are "case-sensitive")
Input (for future use)
Everything is self explanatory, when you execute this script for the first time, it will ask you to set your partitions, you can change them later at any time.
If it's useful for you and you need more options, feel free to suggest me.
Download link: ReKeTv1
After downloading, cd to installation folder and input:
Code:
su
sh ReKeTv1
If you're using Script Manager, just execute it as root.
Latest busybox is required.
Bassel Bakr said:
Hi guys,
I had some free time and decided to write this script specially for Terminal Emulator's users like me.
It's a simple script allows you to:
Backup
Restore backup
Flash
Reboot in any mode
Copy the script to /system/bin
recovery and /or kernel IMG files without the need to input so long codes again and again.
This script will make a new folder named Recovery-Kernel-Tools in your internal storage, including 3 more folders inside it:
Backups (max one backup for each partition, names are "case-sensitive")
Flash (but any recovery.img / boot.img to flash them, names are "case-sensitive")
Input (for future use)
Everything is self explanatory, when you execute this script for the first time, it will ask you to set your partitions, you can change them later at any time.
If it's useful for you and you need more options, feel free to suggest me.
Download link: ReKeTv1
After downloading, cd to installation folder and input:
Code:
su
sh ReKeTv1
If you're using Script Manager, just execute it as root.
Latest busybox is required.
Click to expand...
Click to collapse
There are three files in it...which 1 to download?
Sent from my GT-S7500 using Tapatalk 2
tandon.ayush said:
There are three files in it...which 1 to download?
Sent from my GT-S7500 using Tapatalk 2
Click to expand...
Click to collapse
ReKeTv1
Don't forget to leave some suggestions.
Bassel Bakr said:
ReKeTv1
Don't forget to leave some suggestions.
Click to expand...
Click to collapse
Tried with both terminal emulator and script manager
Got this error
" exec /system/bin/sh '/mnt/sdcard/download/ReKeTv1.txt'
# bin/sh '/mnt/sdcard/download/ReKeTv1.txt'
head: /mnt/sdcard/Recovery-Kernel-Tools/partitions: No such file or directory
tail: can't open '/mnt/sdcard/Recovery-Kernel-Tools/partitions': No such file or directory
tail: no files
Root access denied!
Please issue su command first"
Any solution?
Sent from my GT-S7500 using Tapatalk 2
tandon.ayush said:
Tried with both terminal emulator and script manager
Got this error
" exec /system/bin/sh '/mnt/sdcard/download/ReKeTv1.txt'
# bin/sh '/mnt/sdcard/download/ReKeTv1.txt'
head: /mnt/sdcard/Recovery-Kernel-Tools/partitions: No such file or directory
tail: can't open '/mnt/sdcard/Recovery-Kernel-Tools/partitions': No such file or directory
tail: no files
Root access denied!
Please issue su command first"
Any solution?
Sent from my GT-S7500 using Tapatalk 2
Click to expand...
Click to collapse
Run as root
Or in terminal emulator type
su
First
Bassel Bakr said:
Run as root
Or in terminal emulator type
su
First
Click to expand...
Click to collapse
Did both...still the same error
Any solution??
Sent from my GT-S7500 using Tapatalk 2
tandon.ayush said:
Did both...still the same error
Any solution??
Sent from my GT-S7500 using Tapatalk 2
Click to expand...
Click to collapse
In terminal emulator:
su
set -x
sh ReKeTv1 2> /sdcard/log1.txt
sh -n ReKeTv1 2> /sdcard/log2.txt
Then upload log1.txt & log2.txt files here.
Bassel Bakr said:
In terminal emulator:
su
set -x
sh ReKeTv1 2> /sdcard/log1.txt
sh -n ReKeTv1 2> /sdcard/log2.txt
Then upload log1.txt & log2.txt files here.
Click to expand...
Click to collapse
"No such file or directory"in both logs
Sent from my GT-S7500 using Tapatalk 2
tandon.ayush said:
"No such file or directory"in both logs
Sent from my GT-S7500 using Tapatalk 2
Click to expand...
Click to collapse
After set -x cd to installation directory then complete the code.

[MOD] Install busybox(1.22.1-Stericson)

#!/bin/bash
#*Disclaimer*
echo "I AM NOT RESPONSIBLE FOR ANYTHING THAT HAPPENS"
Click to expand...
Click to collapse
This installs the latest busybox onto your gear 2.
God bless Skin1980 and gav83collins for inspiring me! ))
How to install?
1) Download the zip file
2) Extract it to a folder
3) Run installbusybox.bat
4) Done ))
Benefits:-
1) Able to use over 20 new commands!!
2) Better scripts can be made, and better functionally.
Usage:-
sdb root on
sdb shell
busybox "anycommand"
For ex:-
busybox kill
busybox date
busybox bzip2
busybox fstrim
Will this help at all with failed to install issue many are having.
Hey man,
Thanks very much for your work. Would you mind explaining to us the potential of busybox on Gear 2 ?
Cheers
You are most welcome, I did not build these binaries. I took them and make a batch script to install them onto the gear 2. Experienced users and developers can make use of busybox to improve the watch. For example by utilising the sysctl command. I don't know all of busybox applets, but this is an example of what u can do
Sent from my SM-N910C using Tapatalk
diamantericos said:
Will this help at all with failed to install issue many are having.
Click to expand...
Click to collapse
No sir it can not
Sent from my SM-N910C using Tapatalk

Categories

Resources