Bash 4.3.46 for Android
Safe from Shellshock
All right guys im just going to keep this real nice and simple. Purpose of thread:
I compiled this binary from source and patched it get safe from ShellShock bug. It's compiled using arm-linux-gnueabihf toolchain from Linaro (CFLAGS = "-g -Ofast -static -pipe")
[*]You Should Now Have Bash
[*]To run it just type in termial "bash" or "bash --login" if you want to load /etc/profile
Download Link
Click The Text To Download
Flashable ZIP (thanks to Primokorn)
Flashable ZIP md5sum
Shellshock Test (thanks to ronaldteune)
Code:
busybox mount -o remount,rw /
busybox ln -s /system/xbin /bin
# download from browser https://shellshocker.net/shellshock_test.sh and place it in /data
busybox chmod 777 /data/shellshock_test.sh
/data/shellshock_test.sh
rm -f /data/shellshock_test.sh
busybox rm /bin
busybox mount -o remount,ro /
Thanks For Reading :good:
P.S.#1 Bash binary always be updated
P.S.#2 to mount system rw run from terminal
Code:
mount -o remount,rw /system
P.S.#3 if you don't have root put it in /data/local/bin and add it to your PATH
3lo0sh said:
Bash 4.3.30 for Android
Safe from Shellshock
All right guys im just going to keep this real nice and simple. Purpose of thread:
I compiled this binary from source and patched it get safe from ShellShock bug. It's compiled using arm-none-linux-gnueabi toolchain from Mentor Graphics
How To Use:
Download the binary and put it into /system/xbin ( you should mount your system part (r/w)
know run from terminal "chmod 777 /system/xbin/bash"
You Should Now Have Bash
To run it just type in termial "bash" or "bash --login" if you want to load /etc/profile
Download Link
Click The Text To Download
Always lastest Bash
Source Code
Thanks For Reading :good:
P.S. Bash binary always be updated
Click to expand...
Click to collapse
I'm trying to mount my /system using the following commands in Terminal Emulator:
su
mount -rw /system
When I try and type the chmod line above, I keep getting the message:
Usage: mount [-r] [-w] [-o options] [-t type] device directory
What am I doing wrong to mount the /system file in order to perform the chmod command? I've also used ~/system, same result.....it's probably something super simple, but I'm flummoxed. Any assist would be appreciated, thanks!
Joshmccullough said:
I'm trying to mount my /system using the following commands in Terminal Emulator:
su
mount -rw /system
When I try and type the chmod line above, I keep getting the message:
Usage: mount [-r] [-w] [-o options] [-t type] device directory
What am I doing wrong to mount the /system file in order to perform the chmod command? I've also used ~/system, same result.....it's probably something super simple, but I'm flummoxed. Any assist would be appreciated, thanks!
Click to expand...
Click to collapse
The currect syntax is
mount -o remount,rw /system
?
It never even occurred to me that android is vulnerable!! I hope Google patches this in AOSP Android L!!
I have in /system/xbin an old bash file ( coming with the ROM), I must overwrite it or that's enough?
i hope the cm team will include this
nadejo said:
i hope the cm team will include this
Click to expand...
Click to collapse
I'm running CM 11 M11 and I have the bash file but it's different from this one in size.
hp420 said:
It never even occurred to me that android is vulnerable!! I hope Google patches this in AOSP Android L!!
Click to expand...
Click to collapse
Android will never be vulnerable (unless installed unpatched bash)
abidifethi said:
I have in /system/xbin an old bash file ( coming with the ROM), I must overwrite it or that's enough?
Click to expand...
Click to collapse
If the original bash is patched (no need) just copy it as bash-arm
If it's not patched (overwrite it)
nadejo said:
i hope the cm team will include this
Click to expand...
Click to collapse
I don't think they will include it
I think they will just patch theirs
@3lo0sh Getting an error like this 'unable to chmod 777 /system/xbin/bash: Read-only file system. Where i am wrong?
EDIT:- I'm sorry for that. After typing this 'mount -o remount,rw /system' command in terminal I am not getting the above error but when i issue bash command this error returns 'bash: precmd: command not found. Herewith attaching screenshot
abidifethi said:
I'm running CM 11 M11 and I have the bash file but it's different from this one in size.
Click to expand...
Click to collapse
Is it bigger ?
Trilochanaaya said:
Getting an error like this 'unable to chmod 777 /system/xbin/bash: Read-only file system.
Click to expand...
Click to collapse
dude did you read the OP
you must mount your system rw
just run from terminal
"mount -o remount,rw /system"
3lo0sh said:
Is it bigger ?
Click to expand...
Click to collapse
no t's smaller (about 417kb)
abidifethi said:
no t's smaller (about 417kb)
Click to expand...
Click to collapse
It's even include bash_history ??
Sadly it isn't import bash.bashrc by default ?
3lo0sh said:
It's even include bash_history ??
Sadly it isn't import bash.bashrc by default ?
Click to expand...
Click to collapse
So what's your advise?I overwrite it and "Maoulaha RABBI"
3lo0sh said:
dude did you read the OP
you must mount your system rw
just run from terminal
"mount -o remount,rw /system"
Click to expand...
Click to collapse
I did that pls see the post again! I have attached screenshot also.
abidifethi said:
So what's your advise?I overwrite it and "Maoulaha RABBI"
Click to expand...
Click to collapse
Overwrite it
It's smaller,lastest and patched
Trilochanaaya said:
I did that pls see the post again! I have attached screenshot also.
Click to expand...
Click to collapse
I think it's will not work in adb shell ? I am not developer so i think you should wait untel i search for patch to make it work ?
Trilochanaaya said:
I did that pls see the post again! I have attached screenshot also.
Click to expand...
Click to collapse
Pls se the picture
Add this function to your /etc/profile and do "bash --login"
Related
Hey everyone,
wesgarner said:
Zip Align reduces the amount of RAM used during processing running for a major speed increase in running the apps: http://developer.android.com/guide/developing/tools/zipalign.html
Click to expand...
Click to collapse
I had been messing about with a script to pull apks off my phone, zipalign them and then push them back, but then I saw wesgarner's CM build with a binary and script for use on your phone. I don't really want to mess round with flashing a ROM just for that though, so I've ripped them out and uploaded them below. Another reason is I want to run this manually (with GScript) rather than on boot (as it does in wesgarner's ROM).
I take no credit for this, the binary and script were both taken from wesgarner's CM buiild.
To "install" this, just adb push the two files in the zip below onto your phone with:
Code:
adb shell mount -o remount,rw /system
adb push zipalign /system/bin
adb push zipalign_apks /system/sd/zipalign_apks.sh
adb shell chmod 755 /system/bin/zipalign /system/sd/zipalign_apks.sh
adb shell mount -o remount,ro /system
Then anytime you want to run the script just do:
Code:
adb shell sh /system/sd/zipalign_apks.sh
Or in terminal:
Code:
su
sh /system/sd/zipalign_apks.sh
Has been tested on CM 4.2.7.1
ZipAlign
senab said:
Hey everyone,
I had been messing about with a script to pull apks off my phone, zipalign them and then push them back, but then I saw wesgarner's CM build with a binary and script for use on your phone. I don't really want to mess round with flashing a ROM just for that though, so I've ripped them out and uploaded them below. Another reason is I want to run this manually (with GScript) rather than on boot (as it does in wesgarner's ROM).
I take no credit for this, the binary and script were both taken from wesgarner's CM buiild.
To "install" this, just adb push the two files in the zip below onto your phone with:
Code:
adb shell mount -o remount,rw /system
adb push zipalign /system/bin
adb push zipalign_apks.sh /system/sd
adb shell chmod 755 /system/bin/zipalign /system/sd/zipalign_apks.sh
adb shell mount -o remount,ro /system
Then anytime you want to run the script just do:
Code:
adb shell /system/sd/zipalign_apks.sh
Or in terminal:
Code:
su
sh /system/sd/zipalign_apks.sh
Has been tested on CM 4.2.7.1
Click to expand...
Click to collapse
i do not even know what zipalign does .. but i did add this to my script
# lucid -z
so .. what does it do exactly?
Sweet... Thanks...
I was surprised that more than half of the Apps I have were already ZipAligned...
LucidREM said:
i do not even know what zipalign does .. but i did add this to my script
# lucid -z
so .. what does it do exactly?
Click to expand...
Click to collapse
APKs (as you probably already know) are just zip files. zipalign simply aligns the APK on 4-byte boundaries which Android is more efficient wrt memory access.
You can read more from Jean-Baptiste Queru at http://android-developers.blogspot.com/2009/09/zipalign-easy-optimization.html
Vermithrax said:
Sweet... Thanks...
I was surprised that more than half of the Apps I have were already ZipAligned...
Click to expand...
Click to collapse
Since the 1.6 SDK was released, the ADT does this automatically on APK export. Therefore any app which has been updated since ~September (and was developed using the ADT Eclipse plugin) will be zipalign'd. I was more surprised that 12 out of the 43 apps on my phone weren't aligned!
ZipAlign
senab said:
APKs (as you probably already know) are just zip files. zipalign simply aligns the APK on 4-byte boundaries which Android is more much efficient wrt memory access.
You can read more from Jean-Baptiste Queru at http://android-developers.blogspot.com/2009/09/zipalign-easy-optimization.html
Click to expand...
Click to collapse
that's awesome .. thanks for the link .. i hadn't read about that
Thanks much for this!
Here is a simple gscript to install zipalign after a wipe or new build flash.
You must first create directory /sdcard/zipalign and place zipalign from the zip in the OP there. Path to the file should now be /sdcard/zipalign/zipalign.
Place this script in your gscript folder (after removing .txt from the name) and load it in gscript with su permissions.
I also find it easier to run the script in the zip from the OP in Gscript as well. Instead of placing it in /system/sd run this (assumes zipalign_apks.sh is at root of C:\)
Code:
adb remount
adb push C:\zipalign_apks.sh /sdcard/gscript/zipalign_apks.sh
Then just load it into Gsrcipt with su permissions as with the other script.
Easiest of all may just be to use the commands within Lucid's script. But, I'm comfortable with Gscript, and I can make it 2 clicks away.
EDIT: First execution, you may want to run the original way, because guess what? Gscript isn't zipaligned. But it worked fine just the same.
worked great thanks.
Thanks. I didn't want to flash whole ROM to zipalign apps, so script was very handy.
Actually I've zipaligned only 2 apps, one of them was everybody loved Linda
so anyone wanna bless me with a terminal code to install the script?
garz said:
so anyone wanna bless me with a terminal code to install the script?
Click to expand...
Click to collapse
Read, its on the first post....xD
ZipAlign
garz said:
so anyone wanna bless me with a terminal code to install the script?
Click to expand...
Click to collapse
# lucid -z
yeah so su? then #lucid -z? cause that did nothing for me...
LucidREM said:
i do not even know what zipalign does .. but i did add this to my script
# lucid -z
so .. what does it do exactly?
Click to expand...
Click to collapse
I put a quick explanation of my script on my ROM page: here ya go (rough explanation)
Zip Align reduces the amount of RAM used during processing running for a major speed increase in dex-opt and running the apps, along with the RAM hack and a CC (or your userinit) boots speeds incredibly and better usability of apps (boot and system) in Android: http://developer.android.com/guide/d.../zipalign.html
Most developers have not used this yet (CM does ZipAlign his apps), but this does for the system apps provided from the now old Google Apps
Click to expand...
Click to collapse
senab said:
Since the 1.6 SDK was released, the ADT does this automatically on APK export. Therefore any app which has been updated since ~September (and was developed using the ADT Eclipse plugin) will be zipalign'd. I was more surprised that 12 out of the 43 apps on my phone weren't aligned!
Click to expand...
Click to collapse
Agreed. The Market won't let non-zipaligned apps be uploaded.
AndroidAppCritic said:
Agreed. The Market won't let non-zipaligned apps be uploaded.
Click to expand...
Click to collapse
it will really, it doesn't detect the diff
Also, SDK4 didn't really include an enforced ZipAlign like SDK5 (eclair) does
Plus I built the ZipAlign from source from eclair - so this script may not update them all perfectly
garz said:
yeah so su? then #lucid -z? cause that did nothing for me...
Click to expand...
Click to collapse
Unzip the files to your SD Card, then:
Code:
su
mount -o remount,rw /system
mv /sdcard/zipalign /system/bin
mv /sdcard/zipalign_apks /system/sd/zipalign_apks.sh
chmod 755 /system/bin/zipalign /system/sd/zipalign_apks.sh
mount -o remount,ro /system
Post deleted becoz it was redundant
can someone make a script for windows or a bat file that can zipalign a batch of apks? I am not that ofay with line commands and when i create a new theme (which i often do), i then have to go and zipalign every single apk i have altered 1 at a time..... i do:
Code:
zipalign -f -v 4 E:\app\theapp.apk E:\app\theapp.apk.out
senab said:
Unzip the files to your SD Card, then:
Code:
su
mount -o remount,rw /system
cp /sdcard/zipalign /system/bin
cp /sdcard/zipalign_apks.sh /system/sd
chmod 755 /system/bin/zipalign /system/sd/zipalign_apks.sh
mount -o remount,ro /system
Click to expand...
Click to collapse
This isnt working for me bc of the .sh after zipalign_apks .. do i rename the zipalign_apks to zipalign_apks.sh after unzipping?
edit:that worked THANKS!
Sorry if this has been covered,but how would I go about pushing a file by using the phone only?Is that possible to do in a terminal?And if so what commands would be used.Thanks
casperlt1 said:
Sorry if this has been covered,but how would I go about pushing a file by using the phone only?Is that possible to do in a terminal?And if so what commands would be used.Thanks
Click to expand...
Click to collapse
all you'd need to do is go into a terminal, then su, mount with rw permissions, then cp file /path/to/destination
and how do I mount with permissions?that's what I was missing,thanks
casperlt1 said:
and how do I mount with permissions?that's what I was missing,thanks
Click to expand...
Click to collapse
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Go to Market and search for SU file manager or check out http://www.androlib.com/android.application.com-protocol-su-fbs-jmwq.aspx
It's not free, but it's cheap, and has pretty much replaced all the file explorer/editor/utility-type apps I used to screw around with. For all intents and purposes, you can use it to do just about anything you'd otherwise need adb to do.
As the title states, is TypeFresh good to go on rooted 2.1 on an X10i? The huge fonts are killing me
It wouldn't reboot for me so I've just used RootExplorer instead.
It worked fine for me, both apps (Typefresh and Andexplorer) where installed from the market.
javagreen said:
As the title states, is TypeFresh good to go on rooted 2.1 on an X10i? The huge fonts are killing me
Click to expand...
Click to collapse
yer typefresh works lol
Root Explorer copipast fonts an /system
Thanks for the replies guys, I went ahead anyway and got on it -- and it worked
i m still unable to figure please help, type fresh now displays clockopia on first order, was not there on 1.6. how did u change the font then
sahil4u said:
i m still unable to figure please help, type fresh now displays clockopia on first order, was not there on 1.6. how did u change the font then
Click to expand...
Click to collapse
See the link in my sig.
XperiaX10iUser said:
See the link in my sig.
Click to expand...
Click to collapse
Thanks for all the links my friend.
I always use this method to change my fonts:
1. I pick the font I want and I copy the regular and bold version on my SD.
2. I rename the regular to DroidSans.ttf and the bold to DroidSans-Bold.ttf.
3. Then, on my phone, using a Terminal application, I type:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
chmod 4755 /system/fonts/DroidSans.ttf
dd if=/sdcard/DroidSans.ttf of=/system/fonts/DroidSans.ttf
chmod 4755 /system/fonts/DroidSans-Bold.ttf
dd if=/sdcard/DroidSans-Bold.ttf of=/system/fonts/DroidSans-Bold.ttf
4. Reboot!
5. Enjoy!!
My_Immortal said:
I always use this method to change my fonts:
1. I pick the font I want and I copy the regular and bold version on my SD.
2. I rename the regular to DroidSans.ttf and the bold to DroidSans-Bold.ttf.
3. Then, on my phone, using a Terminal application, I type:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
chmod 4755 /system/fonts/DroidSans.ttf
adb shell dd if=/sdcard/DroidSans.ttf of=/system/fonts/DroidSans.ttf
chmod 4755 /system/fonts/DroidSans-Bold.ttf
adb shell dd if=/sdcard/DroidSans-Bold.ttf of=/system/fonts/DroidSans-Bold.ttf
4. Reboot!
5. Enjoy!!
Click to expand...
Click to collapse
I tried to change it by the Terminal but it says adb not found.Please help how can I overcome this problem.
If you can't get Typefresh to reboot please try the following: Install the latest Busybox from the market. This fixed the problem for a friend of mine.
good for i think there is some problem with my root, type fresh says cannot remount system. which root method did you use. i recently updated my x10i to 2.1 global generic and rooted with one click 1.5. titanium says ok and su too working. but still i cannot wrewrite or copy paste files. help will be appreciated.
sahil4u said:
good for i think there is some problem with my root, type fresh says cannot remount system. which root method did you use. i recently updated my x10i to 2.1 global generic and rooted with one click 1.5. titanium says ok and su too working. but still i cannot wrewrite or copy paste files. help will be appreciated.
Click to expand...
Click to collapse
I used the same method. The first time you run Typefresh you have to give permission, this will cause Typefresh to 'cannot remount sytem' , when you retry it works
dvildriver said:
I tried to change it by the Terminal but it says adb not found.Please help how can I overcome this problem.
Click to expand...
Click to collapse
Ooops...! Sorry! My bad! The correct commands are:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
chmod 4755 /system/fonts/DroidSans.ttf
dd if=/sdcard/DroidSans.ttf of=/system/fonts/DroidSans.ttf
chmod 4755 /system/fonts/DroidSans-Bold.ttf
dd if=/sdcard/DroidSans-Bold.ttf of=/system/fonts/DroidSans-Bold.ttf
My_Immortal said:
Ooops...! Sorry! My bad! The correct commands are:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
chmod 4755 /system/fonts/DroidSans.ttf
dd if=/sdcard/DroidSans.ttf of=/system/fonts/DroidSans.ttf
chmod 4755 /system/fonts/DroidSans-Bold.ttf
dd if=/sdcard/DroidSans-Bold.ttf of=/system/fonts/DroidSans-Bold.ttf
Click to expand...
Click to collapse
Hi.It works like a charm.Thanks for sharing!
Or just copy and paste using RootExplorer or similar. TF can be a bit temperamental at times, was in 1.6 and is in 2.1.
works perfectly for me... running sony sketch..... no more large letters in 2.1
For some reason I have never been able to mount my system r/w through adb or terminal emulator. I'm not quite sure what I'm doing wrong since I've been doing it for years now. I imagine it has to do with root. I can use ES file explorer and modify system to my hearts content just not through adb or terminal emulator. I am on 7.1.1 Pure Nexus with ElementalX 1.08 and SuperSU with 2.79 binaries. I've tried to mount multiple different ways and all result in same error.
Code:
sailfish:/ # mount -o remount,rw /system
mount: '/dev/block/bootdevice/by-name/system_b'->'/system': Device or resource busy
Nvm found it. I guess it's same as Pixel C.
Code:
mount -o rw,remount /system
Geofferey said:
For some reason I have never been able to mount my system r/w through adb or terminal emulator. I'm not quite sure what I'm doing wrong since I've been doing it for years now. I imagine it has to do with root. I can use ES file explorer and modify system to my hearts content just not through adb or terminal emulator. I am on 7.1.1 Pure Nexus with ElementalX 1.08 and SuperSU with 2.79 binaries. I've tried to mount multiple different ways and all result in same error.
Code:
sailfish:/ # mount -o remount,rw /system
mount: '/dev/block/bootdevice/by-name/system_b'->'/system': Device or resource busy
Click to expand...
Click to collapse
Same here but with Oneplus 3T.
I think its kind of encripted "new way" in Android 7.1.1
Also, if you check the magisk thread there is a way to use the mount remount command inside root browser
mate9-109 said:
Same here but with Oneplus 3T.
I think its kind of encripted "new way" in Android 7.1.1
Click to expand...
Click to collapse
Nope just a different mount syntax not encrypted at all. I was kinda thinking same at first like a security feature or root keeping you from so you don't accidentally modifying system.
mount -o rw,remount /system
Instead of
mount -o remount,rw /system
Geofferey said:
Nope just a different mount syntax not encrypted at all. I was kinda thinking same at first like a security feature or root keeping you from so you don't accidentally modifying system.
mount -o rw,remount /system
Instead of
mount -o remount,rw /system
Click to expand...
Click to collapse
Sadly I tried your new syntax, adb did some stuff, but it does not work either.
Anyway thank you very much, your solution almost got it.
:good::good::good::good::good:
I am rooted with magisk and using the follow command to mount /system rw
Code:
adb shell "su -c 'mount -o rw,remount /system'"
I can copy to system/priv-app using:
Code:
adb shell "su -c 'cp sdcard/name.apk system/priv-app/name/name.apk'"
But using this same command I cannot copy to system/app
Code:
adb shell "su -c 'cp sdcard/name.apk system/app/name/name.apk'"
I get the error:
cp: system/app/name/name.apk: Read-only file system
Click to expand...
Click to collapse
What am I doing wrong?
These days, you really don't want to try to modify the distribution filesystems directly. I'm pretty certain that newer ones are compacted/compressed, so there's no room to add anything, anyway. Look into Magisk modules, and do it that way.
creeve4 said:
I am rooted with magisk and using the follow command to mount /system rw
I can copy to system/priv-app using:
But using this same command I cannot copy to system/app
I get the error:
What am I doing wrong?
Click to expand...
Click to collapse
If you're on Android 10 you can't modify system, vendor or product at all due to the pixel phones using logical partitions now. Pretty much if you want to modify anything you must use magisk modules (or you can use /sbin/.magisk/mirror/ but I don't recommend that)
Sent from my Google Pixel 3a XL using XDA Labs
I appreciate the responses, and I understand what you are each saying.
I'm running a custom build of DU pie. I am making modifications and frequently pushing the apks to my phone. It's tedious to push and then have to use a file explorer on my phone to manually move the apk to the correct folder. I am looking for the correct way to mount all /system folders rw so I can script the apk transfer.