Android 8 (Oreo) has a major behavior change on how device ID is manipulated, this tool helps you Query / Modify the IDs on Oreo in a programmatic way.
For further information about the behavior changes of device ID in Oreo, see the page: https://developer.android.com/about/versions/oreo/android-8.0-changes.html#privacy-all
Looking for the App?
See This New Threadhttps://forum.xda-developers.com/android/general/app-device-id-changer-oreo-13-aprv0-9-2-t3777299
How to use it:
Root privilege is NEEDED.
Download the proper version for your phone - if not sure, armv7 is **[pretty much]** working on most phones.
You might need adb tools / Terminal Emulator.
Copy the executable binary downloaded to /cache or other ext filesystems.
Give 0755 permission to the executable.
Assign/Query IDs.
Command Usage:
See the link: https://github.com/CoNsTaRs/oreo_device_id_changer/blob/master/README.md
Step By Step Querying/Assigning IDs:
Have the downloaded exctuable placed at the root of your SD card.
Use either adb/Terminal Emulator to run the commands below.
Setting up
Code:
su # Gain root permission if available
cp /sdcard/[EXECUTABLE] /cache/ # Copy executable from /sdcard to /cache
chmod 0755 /cache/[EXECUTABLE] # Set permission
Querying
Query current device ID for package [PACKAGE].
Code:
/cache/[EXECUTABLE] -q -p [PACKAGE]
Query the default device ID for package [PACKAGE].
Code:
/cache/[EXECUTABLE] -Q -p [PACKAGE]
Assigning
Make a backup first using this command.
Code:
/cache/[EXECUTABLE] -b /sdcard/settings-ssaid.xml.bak
Preview changes. (This is not changing anything, just previewing the modification(s).)
Code:
/cache/[EXECUTABLE] -a [ID] -p [PACKAGE]
If satisfied with the result given from the command above, run the following command to make the changes.
Assign the ID [ID] to the package [PACKAGE] directly.
Code:
/cache/[EXECUTABLE] -i -a [ID] -p [PACKAGE]
※ Substitute [EXECUTABLE] to the file name of the executable, [ID] to the appreciated ID, and [PACKAGE] to the package name in the commands above.
Do not forget to REBOOT your phone after changing IDs.
New IDs go into effect only after a reboot is performed.
Downloads:
https://github.com/CoNsTaRs/oreo_device_id_changer/releases
------------------------------------------------------------------------------------------------------------------------------------------------------
I'll update this thread soon, heading out for food now
Waiting patiently haha
CoNsTaR said:
Android 8 (Oreo) has a major behavior change on how device id is manipulated, I wrote a tool to Query / Modify the ID on Oreo.
For more information, see the github repo below:
HTML:
https://github.com/CoNsTaRwU/oreo_device_id_changer
I'll update this thread soon, heading out for food now
Click to expand...
Click to collapse
Just one question. Your notes contradict themselves.
First you say you cannot query and assign at the same time
Then you say to query and assign at the same time set ......the flags.
So which is true? Can you set and query in fact at the same time or not?
Thanks
Sent from my SM-G935W8 using Tapatalk
tineprogramming said:
Waiting patiently haha
Click to expand...
Click to collapse
I just found out I might have selective disorder on food
I'm gonna keep the last line in the post. hahaha
sonic_the_hedgeh said:
Just one question. Your notes contradict themselves.
First you say you cannot query and assign at the same time
Then you say to query and assign at the same time set ......the flags.
So which is true? Can you set and query in fact at the same time or not?
Thanks
Sent from my SM-G935W8 using Tapatalk
Click to expand...
Click to collapse
I don't really find the contradiction in my note.
To clarify, I'll restate them again for you.
Querying both ID - NOT possible
Assigning both ID - Possible
Querying and Assigning in one command - NOT possible
how can i use it? should i compile it in some way? it uses adb?
Edit: whoops, just found the instructions
mirko902 said:
how can i use it? should i compile it in some way? it uses adb?
Click to expand...
Click to collapse
See the Release Page for downloads.
Use this tool through adb or terminal emulator are both possible.
I've just updated the original post, hope that gives more information.
I'm still not sure to where to put the executable so i can execute it with the terminal emulator
mirko902 said:
I'm still not sure to where to put the executable so i can execute it with the terminal emulator
Click to expand...
Click to collapse
Any ext filesystem should be good.
Step by step:
Copy/Download the executable to the root of your SD card
Follow the commands below
Code:
su
cp /sdcard/dvcid-armv7 /cache/
chmod 0755 /cache/dvcid-armv7
/cache/dvcid-armv7 -q -p com.android.example # Run commands as you want
it looks like it works, if i query the id i get the new id that i set, but the app wich i'm trying to use it on recognize that it is still the same phone, maybe i'm doing something wrong, thanks anyway!
mirko902 said:
it looks like it works, if i query the id i get the new id that i set, but the app wich i'm trying to use it on recognize that it is still the same phone, maybe i'm doing something wrong, thanks anyway!
Click to expand...
Click to collapse
Don't forget to REBOOT your phone after changing IDs.
The changes take place after the next boot.
Hi
Firstly thanks for your efforts; I've been after a device id tool since I updated to Oreo.
My system:
Xiaomi MIX (ARM64) running Resurrection Remix Oreo.
I used the ARM64 version of your tool and the query part worked fine.
The trial change reported that the id I had supplied wasn't a 16 digit number (it was) but I could use --force to do it anyway, which I did, and it appeared to work.
I made the actual change (again using --force) and rebooted.
Querying the id for the package now shows that it has reverted to the original id.
Any ideas? If there's anything I can do to help (logs...), please let me know.
Sláinte
mmidders
mmidders said:
Hi
Firstly thanks for your efforts; I've been after a device id tool since I updated to Oreo.
My system:
Xiaomi MIX (ARM64) running Resurrection Remix Oreo.
I used the ARM64 version of your tool and the query part worked fine.
The trial change reported that the id I had supplied wasn't a 16 digit number (it was) but I could use --force to do it anyway, which I did, and it appeared to work.
I made the actual change (again using --force) and rebooted.
Querying the id for the package now shows that it has reverted to the original id.
Any ideas? If there's anything I can do to help (logs...), please let me know.
Sláinte
mmidders
Click to expand...
Click to collapse
Hi, thanks for your report.
Can you try again with This Release, and see if your problems are still there.
Thanks for the swift response.
I still get an error about the deviceid I'm using and have to use the --force switch, but the change worked with the above realease and has persisted after a reboot. Thanks muchly.
Sláinte
mmidders
Session log:
lithium:/sbin # chmod 0755 dvcid
lithium:/sbin # dvcid -q -p net.fishlabs.gof2hdallandroid2012
a3d809934af2ca85
lithium:/sbin # dvcid -a 84dbc105e6063270 -p net.fishlabs.gof2hdallandroid2012
the designated ID is NOT valid: 84dbc105e6063270
use --force to perform anyway
lithium:/sbin # dvcid --force -a 84dbc105e6063270 -p net.fishlabs.gof2hdallandroid2012
...
lithium:/sbin # dvcid --force -i -a 84dbc105e6063270 -p net.fishlabs.gof2hdallandroid2012
lithium:/sbin # dvcid -q -p net.fishlabs.gof2hdallandroid2012
84dbc105e6063270
mmidders said:
Thanks for the swift response.
I still get an error about the deviceid I'm using and have to use the --force switch, but the change worked with the above realease and has persisted after a reboot. Thanks muchly.
Sláinte
mmidders
Session log:
lithium:/sbin # chmod 0755 dvcid
lithium:/sbin # dvcid -q -p net.fishlabs.gof2hdallandroid2012
a3d809934af2ca85
lithium:/sbin # dvcid -a 84dbc105e6063270 -p net.fishlabs.gof2hdallandroid2012
the designated ID is NOT valid: 84dbc105e6063270
use --force to perform anyway
lithium:/sbin # dvcid --force -a 84dbc105e6063270 -p net.fishlabs.gof2hdallandroid2012
...
lithium:/sbin # dvcid --force -i -a 84dbc105e6063270 -p net.fishlabs.gof2hdallandroid2012
lithium:/sbin # dvcid -q -p net.fishlabs.gof2hdallandroid2012
84dbc105e6063270
Click to expand...
Click to collapse
Thanks for the feedback. I'm happy it helps.
It appears that I mistaken thought that device IDs are numbers which actually are not.
I'll make some improvements based on your feedback.
CoNsTaR said:
It appears that I mistaken thought that device IDs are numbers which actually are not.
I'll make some improvements based on your feedback.
Click to expand...
Click to collapse
They're sixteen digit hex strings, so technically numbers, just not in decimal.
Thanks for your help.
Just as an addendum, I found it quite difficult to find out where the ssaid settings file was in oreo; maybe because I'm new to Android development, but for google and anyone else:
Android Oreo 8.1 Device ID SSAID /data/system/users/0/settings_ssaid.xml
If it is possible.. Then please Make an App to Change the Device id changing id through Commands is little bit complicated.. I m searching for Changing ID in my oreo Device with any module or App. But nothing working till now it ll be very helpful and easy to me and to others too by an App to Change id.. Thanks
Bhabesh98 said:
If it is possible.. Then please Make an App to Change the Device id changing id through Commands is little bit complicated.. I m searching for Changing ID in my oreo Device with any module or App. But nothing working till now it ll be very helpful and easy to me and to others too by an App to Change id.. Thanks
Click to expand...
Click to collapse
Hi Bhabesh,
I totally understand what you're saying, and it was actually my intention to make an android app in the first place I started this project.
However, I've hardly no experience of developing android apps as of the last time I did it was years ago.
Specifically, it apparently will take a lot of time for me to re-learn it, get my knowledge up to date, and maintain such a project.
The problem is, I'm currently busy working on another project which consumes most of my free time, and have no time to pay attention to this.
For these reasons, I'm not likely to get into this shortly, but I will finally make it an app for sure.
Hope you can understand my situation, if I made it, eventually, I'll as soon update this thread and let you know.
CoNsTaR said:
Hi, Bhabesh,
I totally understand what you're saying, and it was actually my intention to make an android app in the first place I started this project.
However, I've hardly no experience of developing android apps as of the last time I did it was years ago.
Specifically, it apparently will take a lot of time for me to re-learn it, get my knowledge up to date, and maintain such a project.
The problem is, I'm currently busy working on another project which consumes most of my free time, and have no time to pay attention to this.
For these reasons, I'm not likely to get into this shortly, but I will, finally make it an app.
Hope you can understand my situation, if I made it, eventually, I'll as soon update this thread and let you know.
Click to expand...
Click to collapse
I ll wait till then ?... Goodluck ?
Related
Hi All,
The Ash shell provides a few advantages over the Android default sh shell such as command history and cursor handling at the prompt. There are other benefits, but these are the first that come in most handy (to me).
The following tutorial will get you ash as the login shell with as yet no ill effects:
Note: that in my case, I'm using my android2sd construct and thus this modification is being done to my active overlay profile setup, thus to undo it I can simply boot into "safe\\normal" mode and undo the changes without possibly locking me out of the console should it have failed (which it didn't) But you can edit the Android /system/bin/sh file in this manner directly.
Ash as Login Shell:
OK, make the /system fs read-write:
mount -o remount,rw /system
Click to expand...
Click to collapse
Note: that the fs type is not needed, and in my case is not yaffs but ext3, Android will figure it out proper.
Next,
cp -a /system/bin/sh /system/bin/sh0
Click to expand...
Click to collapse
(this is for backup purposes and allows us to undo the change if so desired, or delete it if no longer needed).
Note: I'm using JF1.51 roms, so busybox ash is available as /system/xbin/bb/ash, so that is what I am using here; use ash however you are able to access it.
echo "#!/system/xbin/bb/ash">/system/bin/sh
echo "/system/xbin/bb/ash \[email protected]">>/system/bin/sh
Click to expand...
Click to collapse
Please note the use of (redirect\\overwrite)> and (redirect\\append)>>.
This will overwrite sh with a script to load the desired shell, executing any command-line arguments passed, and preserve the permissions of the original sh file. You can manually set the permissions the same as they are for our sh0 backup if the permissions (root.shell)(0755) don't seem to keep.
Finally reset the read-only state of /system:
mount -o remount,ro /system
Click to expand...
Click to collapse
Now if you shell-in\\telnet-in you should get the ash prompt which unlike the Android sh default prompt, includes the present working directory(pwd) ie: '/#' instead of just '#'.
Note: A reboot should not cause the loss of the modification, but if does, copy the new sh script to your /data/local/bin location or something and copy it back via boot script or something.
Shell Scripts:
If you're like me, you discovered that Android didn't need the interpreter declaration comment in scripts, and thus may not have used them...Well, you will need to update your scripts to include them by adding something similar to the following as the first line of your scripts:
#!/system/xbin/bb/ash
Click to expand...
Click to collapse
Again, please note that I am using JF1.51 roms and the location of the busybox ash shell is what I'm listing; put the full location to the shell you intend to use as this location.
Without the interpreter declaration, ash simply complains 'not found' at the first command, as ash doesn't know how to interpret the script, and doesn't seem to default to the login shell.
Hope someone finds this helpful!
sweet. This is going to be very useful
BAM. thats sexy. i just did this on CM3.6.7.1. works like a charm.
scratches head. i'm lost. what does this do and how does this make my g1 better?
temporizer said:
scratches head. i'm lost. what does this do and how does this make my g1 better?
Click to expand...
Click to collapse
im not sure about the other features, but the one i installed it for is to have your working directory in front of ur prompt. ex:
Code:
/# cd /sdcard
/sdcard # cd /system/sd
/system/sd #
etc...
EDIT: Also, if you use ConnectBot, you'll notice with the regular sh, if u scroll up with tracball, you get BS characters on the prompt. with THIS one, when you scroll up, you get last command entered. VERY handy for when you mistype one character on a long-ass command.
I love you
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
great job, i'm going to get ash working on my G1 (CM-3.6.7.1)
Thanks.
kanstin said:
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
Click to expand...
Click to collapse
I tried this and it worked even after a reboot...
Sweet, I love the scroll back with trackball in the terminal!!! Me thinks this should get absorbed into the next Cyan release.
kanstin said:
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
Click to expand...
Click to collapse
Yes, I reckon you could. Though I had done a few experiments where the symlink failed, but I'm fairly sure it was do to the link: /system/xbin/bb/ash -->../busybox and /system/bin/../busybox not existing...so I did it via script. Many ways to skin a cat they say.
Thank you all... this is fricken awesome!!
temporizer said:
scratches head. i'm lost. what does this do and how does this make my g1 better?
Click to expand...
Click to collapse
It gives a more advanced shell for when you use the command line interface or telnet into your G1. If you don't use the command line a lot, it won't help you.
As for specific benefits to the advanced version, it was listed in the first post.
Hi,
imho this is rather a hack that exposes you to the risk at least on CM to loose your
shell during boot as xbin.sqf the compressed squashfs filesystem containing
busybox is mounted rather late in the boot process. A cleaner solution would be to
move busybox to system/bin and link it to sh. That way you ensure that sh will
always be accessible during boot and also later on, thus not interfering with
further developments. A alternative could be to compile a standalone version
of busybox containing only ash (for size reasons, as size in /system/bin is precious)
copy that to /system/bin and link sh to it.
Seems to work fine on Dude's. Not really sure how it should open, but I type "ash" at the prompt and I get the /$ and /# if superuser. I also get the command history by rolling the trackball, which is a very nice feature.
Can i install this without using my PC?
temporizer said:
Can i install this without using my PC?
Click to expand...
Click to collapse
Should work using terminal.
Tried it on JACHero 2.7.1
I tried the hard link one and I get a read only fs error on the first move command. What should I chmod to get past that?
mugafuga said:
I tried the hard link one and I get a read only fs error on the first move command. What should I chmod to get past that?
Click to expand...
Click to collapse
Do this first before the mv and the symlink.
mount -o remount,rw /system
farmatito said:
Hi,
imho this is rather a hack that exposes you to the risk at least on CM to loose your
shell during boot as xbin.sqf the compressed squashfs filesystem containing
busybox is mounted rather late in the boot process. A cleaner solution would be to
move busybox to system/bin and link it to sh. That way you ensure that sh will
always be accessible during boot and also later on, thus not interfering with
further developments. A alternative could be to compile a standalone version
of busybox containing only ash (for size reasons, as size in /system/bin is precious)
copy that to /system/bin and link sh to it.
Click to expand...
Click to collapse
Is this in any way accurate? I dedicate my g1 to cyan's roms and wouldn't want anything to hinder any of the goodness that is cyanogenMod. Advice?
Load ash when terminal is started?
temporizer said:
Is this in any way accurate? I dedicate my g1 to cyan's roms and wouldn't want anything to hinder any of the goodness that is cyanogenMod. Advice?
Click to expand...
Click to collapse
Safest method will be to change to ash shell once terminal app is started (same as typing "ash" to switch shell from sh to ash). I don't know how to do it in android (in linux you could add it to your login script).
So if someone knows how to execute a command when we login using the terminal app, then switching to ash shell would work without fear of breaking any other functionality.
hi,
i compiled bash and added support for executing file /sdcard/bash_profile, so you can set PATH and PS1 variables there, for example...
if someone is interested, there it is for download
http://pub.mzet.net/bash
for become default shell copy bash to /system/bin/bash a then run:
Code:
cd /system/bin
chmod 0755 bash
mv sh sh0
ln -s bash sh
mzet said:
hi,
i compiled bash and added support for executing file /sdcard/bash_profile, so you can set PATH and PS1 variables there, for example...
if someone is interested, there it is for download
http://pub.mzet.net/bash
for become default shell copy bash to /system/bin/bash a then run:
Code:
cd /system/bin
chmod 0755 bash
mv sh sh0
ln -s bash sh
Click to expand...
Click to collapse
NICE! Good job mzet. I missed bash and its wonderful auto complete. This should help spur better scripting with all the functionality that bash supports. No more semicolons at the end of each line in a shell script.
On a side note, we should be able to add the following to init.rc rather than symlinking sh -> bash
export SHELL /system/bin/bash
here is example of my /sdcard/bash_profile
Code:
PATH=/sbin:/system/xbin/bb:/system/xbin:/system/bin
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
else
PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi
it shows localhost in green color when user is logged or in red color when root is logged...
shafty023 said:
On a side note, we should be able to add the following to init.rc rather than symlinking sh -> bash
export SHELL /system/bin/bash
Click to expand...
Click to collapse
strange. is this variable used? when i execute "echo $SHELL" it writes "/bin/sh", but it does not exists, it should write /system/bin/sh, i think
"/bin/sh" is ok. It's in boot.img...(respectively in ramdisk). Check out some ramdisk
mzet said:
strange. is this variable used? when i execute "echo $SHELL" it writes "/bin/sh", but it does not exists, it should write /system/bin/sh, i think
Click to expand...
Click to collapse
Ya I noticed that after posting my last message. Perhaps it's not used. I'll try and find some time to change that in init.rc and reboot to see if it takes effect
shafty023 said:
Ya I noticed that after posting my last message. Perhaps it's not used. I'll try and find some time to change that in init.rc and reboot to see if it takes effect
Click to expand...
Click to collapse
I tried adding that to my init.rc and not doing the symlink and lost my shell, which I expected. I figured a reboot would fix it, but got stuck @ boot image. No problem...recent nandroid.
EDIT: Using the symlink works fine for now. Thank you!
Very cool. Thanks for giving us bash for Andriod! While we're thinking of low level tools, anyone have a version of busybox with colorized 'ls'?
Anyone know when /system/sd is mounted in the cyano ROMs? If it's available early enough, we could copy bash to /system/sd and avoid taking up 2.5MB in /system/bin.
it's too big, because everything is built statically
You know, before going off and compiling things (wasting your time), it is not too bad an idea to do a search... http://forum.xda-developers.com/showpost.php?p=3839562&postcount=4 to see if what you want is already done.
mzet said:
hi,
i compiled bash and added support for executing file /sdcard/bash_profile, so you can set PATH and PS1 variables there, for example...
if someone is interested, there it is for download
http://pub.mzet.net/bash
for become default shell copy bash to /system/bin/bash a then run:
Code:
cd /system/bin
chmod 0755 bash
mv sh sh0
ln -s bash sh
Click to expand...
Click to collapse
lbcoder said:
You know, before going off and compiling things (wasting your time), it is not too bad an idea to do a search... http://forum.xda-developers.com/showpost.php?p=3839562&postcount=4 to see if what you want is already done.
Click to expand...
Click to collapse
In that version of bash from the link you provided, the dev had an issue with the <enter> key working. This issue does not exist in this version. There's nothing wrong with someone compiling and providing their own version of something. This is exactly the same reason ROM developers on here create their own (and for the most part identical) ROMs as the next guy. We shouldn't hamper innovation, we should support it. Progress is measured by how well someone can build off another's innovation.
Plane->Jet->Space Shuttle. Imagine if we told the guy who invented the jet, hey retard, someone already made an F16, take your stealth bomber and shove it
shafty023 said:
in that version of bash from the link you provided, the dev had an issue with the <enter> key working. This issue does not exist in this version. There's nothing wrong with someone compiling and providing their own version of something. This is exactly the same reason rom developers on here create their own (and for the most part identical) roms as the next guy. We shouldn't hamper innovation, we should support it. Progress is measured by how well someone can build off another's innovation.
Plane->jet->space shuttle. Imagine if we told the guy who invented the jet, hey retard, someone already made an f16, take your stealth bomber and shove it
Click to expand...
Click to collapse
well said shafty!!
that's big!
That had nothing to do with the bash, it had to do with "better terminal emulator".
And your analogies are wrong since the end result is the SAME THING.
If you want to contribute to things, invent something NEW. Don't keep on reinventing the wheel, we already know that its round.
shafty023 said:
In that version of bash from the link you provided, the dev had an issue with the <enter> key working. This issue does not exist in this version. There's nothing wrong with someone compiling and providing their own version of something. This is exactly the same reason ROM developers on here create their own (and for the most part identical) ROMs as the next guy. We shouldn't hamper innovation, we should support it. Progress is measured by how well someone can build off another's innovation.
Plane->Jet->Space Shuttle. Imagine if we told the guy who invented the jet, hey retard, someone already made an F16, take your stealth bomber and shove it
Click to expand...
Click to collapse
Shafty, you've created a better product. Good Job.
lbcoder said:
You know, before going off and compiling things (wasting your time), it is not too bad an idea to do a search... http://forum.xda-developers.com/showpost.php?p=3839562&postcount=4 to see if what you want is already done.
Click to expand...
Click to collapse
Actually, I'm using mzet's version instead because it was built using a newer glibc and it's slightly smaller.
So thank you, mzet.
PS: using uclibc might result in smaller executables.
lbcoder said:
That had nothing to do with the bash, it had to do with "better terminal emulator".
And your analogies are wrong since the end result is the SAME THING.
If you want to contribute to things, invent something NEW. Don't keep on reinventing the wheel, we already know that its round.
Click to expand...
Click to collapse
Being a senior member you should know better than to put people down. Let's not go down this road, there's plenty of development to do and no time to do it.
shafty023 said:
Ya I noticed that after posting my last message. Perhaps it's not used. I'll try and find some time to change that in init.rc and reboot to see if it takes effect
Click to expand...
Click to collapse
did this end up working?
ttabbal said:
Anyone know when /system/sd is mounted in the cyano ROMs? If it's available early enough, we could copy bash to /system/sd and avoid taking up 2.5MB in /system/bin.
Click to expand...
Click to collapse
It won't work as default shell but if you use better terminal just make it the initial command and it can be on sd. Also it makes it persistent even through wipes.
in better terminal:
Code:
su -c "/system/sd/bin/bash --rcfile /system/sd/bashrc"
then in /system/sd/bashrc:
Code:
export PATH=${PATH}:/system/sd/bin
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
else
PS1='\[\033[01;32m\]\[email protected]\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi
Hi guys, just to let you know, i successfully compiled ettercap for android!
This is a command-line tool only(for now) so if you never used ettercap, try it first on your PC.
What is working now (that i've tested):
- Text only support
- ARP spoofing
- ...
Not Working:
- Plugin Loading (should be easy to fix)
- Curses (is it really necessary?)
Sample usage on my galaxy S:
Code:
./ettercap -i eth0 // // -qT -M ARP
Now, use with care
I'd appreciate if someone write a how-to for "non-geeks", and a better mirror.
Download 0.11
Mirror (courtesy of a1Pha)
Cheers
How did You do that?
Hi,
How did you cross compile it, and did you upload the diff back to ettercap project ? They would benefit from the changes.
I did the following to get it to work so I could execute the file from the sdcard.
# mount -o remount,rw,dirsync,nosuid,nodev,exec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro -t vfat /dev/block/vold/179:1 /mnt/sdcard
# ./ettercap -i eth0 // // -qT -M ARP
Can you reupload the file. Thanks.
Link updated.
There is only one line of code modified from the original project, which sets the uid and gid to another than root, and prevents ettercap from working correctly, so i commented it and now it works well. Later ill make a tutorial on how to build it.
Cheers
Great work onaips. But how to install it? Do you have any guide ready?
I can not find out a way to install it.
Great job here, I use Ettercap on my laptop pretty frequently, and have been waiting for an Android port. The only problem is that I keep on getting a permission error using my personal terminal emulator.
After getting su permissions, I type:
# ./ettercap -i eth0 // // -qT -M AR
Then, it just spits out:
./ettercap: permission denied
Any thoughts?
Try to give it executable permissions,
chmod 777 ettercap
onaips said:
Try to give it executable permissions,
chmod 777 ettercap
Click to expand...
Click to collapse
No luck, but thanks for the suggestion. It still gives the same permission denied error. None of the other files in the folder have permission as well, not even with the chmod command.
Still no luck with the plugins? Can someone help?
@skafan2 you probably are trying to run it from your sdcard, on a fat partition. Try to move it to the /system directory, or any other place formatted as ext-*
dazdaz said:
Hi,
How did you cross compile it, and did you upload the diff back to ettercap project ? They would benefit from the changes.
I did the following to get it to work so I could execute the file from the sdcard.
# mount -o remount,rw,dirsync,nosuid,nodev,exec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro -t vfat /dev/block/vold/179:1 /mnt/sdcard
# ./ettercap -i eth0 // // -qT -M ARP
Click to expand...
Click to collapse
Hey.... Many many many thanks, but i have a question..
i run debian-ubuntu-bt5 on my HTC DesireZ and i can not run ettercap because of some Fatal error with the Layer 3 (wich is the internet layer). Then, i was suspicious with the interface (eth0). Eth0 refers to ethernet connection and i am connected wireless (is this the problem)????? i tried to change my eth0 interface with the wlan0 but without luck.... please help me how to make it work....
Thank u again
thank you!
ettercap layer 2 error
come on guys please someone answer me, i really need this to work
dude on most mobiles wifi= eth0 or tiwlan0 so quit trying to change it to wlan0. Also, are you talking about the android ettercap binary or the debian chroot version? also post exactly what it says if you can
working but not package received, cant put in promicious mode...
Hi, the binary is working but is telling me 0 plugins, any one knows how to deal with the plugins
links dead
Both links are dead. Can you fix it?
You can mail me the app, i can mirror it for you if you'd like.
Reup please ....
Jah. reup please
I'm also interested in testing this on an android phone, but the links are dead.
I just made an alarming discovery. There are some duplicate binaries installed on our system. rm is one example. I found this out using the rm command. Here is what I found. It exists in BOTH /system/bin AND /system/xbin. If you need proof, I can show you that too.
*********************************************************
Busybox installs its binaries to /system/xbin. Your $PATH is constructed from the /system/etc/mkshrc file that gets executed at boot. The path construct outputs PATH=/system/bin:/system/xbin. Notice that /system/bin comes before /system/xbin in your PATH.
So then the problem with duplicate binaries is that when commands are run from the terminal (without a full path specified to the command call), they are executed from the first directory found in the $PATH which is /system/bin not /system/xbin.
I could do some more **** Tracy and find all the duplicate binaries but I have an easier solution. The solution (for me) is to edit my mkshrc file, and force /system/xbin to come before /system/bin in the $PATH construct. That way I'm not getting jipped with a full Busybox installed by using their less functional Android counterparts. I will post the edited file here in case anyone needs it.
[Edit] On second thought after reviewing some feedback, I will not post this file modification. It has other unintended consequences. Read. Oops, I thought this was posted in the Help & TS section.
elfaure said:
I just made an alarming discovery. There are some duplicate binaries installed on our system. rm is one example. I found this out using the rm command. Here is what I found. It exists in BOTH /system/bin AND /system/xbin.
Click to expand...
Click to collapse
Well, the one in /system/bin is part of stock Android, and the one in xbin is from busybox. No surprise here. In many cases it does not matter which one you actually call, but the versions from busybox are usually more feature-rich. If you need the busybox version, the easiest and safest way to ensure you get the correct one is to explicitly call "busybox rm".
If you modify your PATH, you risk writing scripts that don't work on other devices.
_that said:
If you modify your PATH, you risk writing scripts that don't work on other devices.
Click to expand...
Click to collapse
Please explain.
[Edit] I just discovered other unintended problems with changing my $PATH in mkshrc. Because I have multiple superusers installed [I like to switch between them sometimes; one in /system/bin (active) and the other in /system/xbin (other one)] and by doing that when I rebooted it changed my superuser app. Interesting. So I will not post up the file then - bad idea.
[Edit] It just gets worse. After doing that I now can't sign into my Google account, and I just got a suspicious sign-in email from Google. Really bad idea.
[Edit] Yup. Just verified that my Google account was disabled due to suspicious activity and I had to reset my password. That email was not spam.
elfaure said:
Please explain.
Click to expand...
Click to collapse
I think I get what _that is saying.
For the same reasons that rm was causing some unexpected behavior in your Brower2Ram script, the same thing could happen if a system binary is not as feature-rich as the busybox version. It just so happens for the case of rm that the system binary has more switches than busybox, but who can say for other binaries?
shardsx said:
[Snipped] It just so happens for the case of rm that the system binary has more switches than busybox, but who can say for other binaries?
Click to expand...
Click to collapse
I think you have that backwards. Busybox binary is more feature rich, has more switches, and is the one we want to use. That is why I am suggesting pointing the PATH to busybox (/system/xbin) rather than Android (/system/bin). The one that does NOT have the -f option is the Android one; the default one that gets called from a terminal or my script.
elfaure said:
Please explain.
Click to expand...
Click to collapse
Just think what could happen:
1. You have modified your PATH.
2. You write a script that works on your device.
3. You publish your script.
4. I try running your script and it calls the wrong binary because my PATH is not modified.
elfaure said:
I think you have that backwards. Busybox binary is more feature rich, has more switches, and is the one we want to use. That is why I am suggesting pointing the PATH to busybox (/system/xbin) rather than Android (/system/bin). The one that does NOT have the -f option is the Android one; the default one that gets called from a terminal or my script.
Click to expand...
Click to collapse
Oops, you're right!
_that said:
Just think what could happen:
1. You have modified your PATH.
2. You write a script that works on your device.
3. You publish your script.
4. I try running your script and it calls the wrong binary because my PATH is not modified.
Click to expand...
Click to collapse
Gotcha. This is what I didn't understand @shardsx how modifying my local path in any way could affect anyone else running my script but @_that clearly shows why above. If I can't test it on the user's binary then I'm only testing it for operation on MY device which would be different than YOUR device. So like you said @_that, I need to specifically call the busybox binary for the rm command if I want to use the -f option by either:
1. /system/xbin/rm
or
2. busybox rm
instead of just simply rm (which calls /system/bin/rm). Drama concludes with effective solution.
Find duplicate binaries script
Here is a script to find all the duplicate binaries between /system/bin and /system/xbin. There are quite a few.
[Edit] The attached script was REMOVED because it is WRONG. Once I fix the problems and @_that has approved of the corrections I will post it back up.
elfaure said:
Here is a script to find all the duplicate binaries between /system/bin and /system/xbin.
Click to expand...
Click to collapse
Nice, short and sweet ... and wrong. You should test your scripts before publishing.
Read this: http://en.wikipedia.org/wiki/Test_(Unix) to find how to fix it.
This line is wrong:
Code:
if [ "OBJ"="$XBIN" ]; then
The "[" command (yes, that's a command also called "test") does not understand "=". In this invocation it will simply return true if the string between [ and ] is not empty, which is always. Edit: It does understand " = " though.
Even if test did understand "=" in the normal way of comparing for equality it wouldn't work. First, you forgot the $ before OBJ - you want to compare with the current file name, not with the fixed name "OBJ". Then, if you compare the current $OBJ with the whole list of the files in xbin, it will always be false.
You don't even need the list of all files in xbin - you only need to check for each file in bin if an equally named file in xbin exists. "test" (or "[") has an operator for that.
a working solution:
Code:
for OBJ in $(ls /system/bin)
do
if [ -e /system/xbin/$OBJ ]; then
echo $OBJ
fi
done
_that said:
Nice, short and sweet ... and wrong. You should test your scripts before publishing.
Read this: http://en.wikipedia.org/wiki/Test_(Unix) to find how to fix it.
This line is wrong:
Code:
if [ "OBJ"="$XBIN" ]; then
The "[" command (yes, that's a command also called "test") does not understand "=". In this invocation it will simply return true if the string between [ and ] is not empty, which is always.
Even if test did understand "=" in the normal way of comparing for equality it wouldn't work. First, you forgot the $ before OBJ - you want to compare with the current file name, not with the fixed name "OBJ". Then, if you compare the current $OBJ with the whole list of the files in xbin, it will always be false.
You don't even need the list of all files in xbin - you only need to check for each file in bin if an equally named file in xbin exists. "test" (or "[") has an operator for that.
a working solution:
Code:
for OBJ in $(ls /system/bin)
do
if [ -e /system/xbin/$OBJ ]; then
echo $OBJ
fi
done
Click to expand...
Click to collapse
Ouch! Busy at day job now but I felt that slap all the way from the E. Coast. Is _that called SIP - slap over IP?.
Agreed, I'm still too much of a newb to be QCing my own work. Won't publish anything else without your approval. I will investigate and fix it but it seemed to work when I ran it. Maybe it just listed all the contents of /system/bin?
[Edit] I just wanted to say until I look this over that I did run it and the output looked reasonable for matching binaries. I did not check more than a few.
Note: I have not opened your solution because I am not yet convinced I need to or this structure is wrong. But historically speaking you've never been wrong so I expect to be wrong and learn something from this, but for now I just don't see your point, I believe these work, so I will hold my ground.
Here is a simple test example with identical structure. I see no difference (besides forgetting the $). Comment?
Code:
#!/bin/sh
string1="blah"
string2="blah"
if [ $string1=$string2 ]; then
echo "$string1 $string2"
fi
and here is the code block from my sniper method script after which you called for a cleanup. This code compared a single variable (like $OBJ) to a list variable (like $XBIN).
Code:
If [ -d "${CACHE_NAME1}"=${BROWSER_LIST} ];
then...
[Edit] I put the $ infront of OBJ and re-ran my script and it produces identical output as without it. So every file in /system/bin is getting echoed and the script does not work you are (always) correct. But the test example script I provided does work. Hmm...thats a single variable not a list. But my sniper method worked. Hmm...hmm...
Nor did this make any difference
Code:
if [ "${OBJ}"="${XBIN}" ]; then
Conclusion: My sniper method never worked as intended. It just mounted all of the browser list without ever making the match to all /cache dirs. But it seemed to work as intended. Again, I state that it is difficult to impossible to know when you are doing something wrong in the code when you get your desired output thru a flawed code block which further substantiates your point about needing review. Because then we convince ourselves something worked and try to use the same method again and again only later to find out the method is flawed.
I'm going to follow your links and read up a bit before I take the bait and peek at your solution.
elfaure said:
Here is a simple test example with identical structure. I see no difference (besides forgetting the $). Comment?
Code:
#!/bin/sh
string1="blah"
string2="blah"
if [ $string1=$string2 ]; then
echo "$string1 $string2"
fi
Click to expand...
Click to collapse
Try these variants and observe the result:
Code:
if [ a=a ]; then echo yes; fi
if [ a=b ]; then echo yes; fi
if [ a ]; then echo yes; fi
if [ ]; then echo yes; fi
(I actually did the same to find out what's going on)
elfaure said:
The one that does NOT have the -f option is the Android one; the default one that gets called from a terminal or my script.
Click to expand...
Click to collapse
This seems to have changed between 10.4.4.25 and 10.6.1.14.4 (below, respectively):
Code:
rm [-rR] <target>
Code:
Usage: rm [-rR] [-f] <target>
Welcome to the world of code portability.
---------- Post added at 07:01 AM ---------- Previous post was at 06:48 AM ----------
elfaure said:
Here is a simple test example with identical structure. I see no difference (besides forgetting the $). Comment?
Code:
#!/bin/sh
string1="blah"
string2="blah"
if [ $string1=$string2 ]; then
echo "$string1 $string2"
fi
Click to expand...
Click to collapse
1. You need a space between the comparison operator and the variable names for this to work like you expect.
2. Get into the habit of always quoting variable names when performing such tests (i.e. if [ "$string1" = "$string2" ]; then). Not doing so may bite you when you're not expecting it.
becomingx said:
1. You need a space between the comparison operator and the variable names for this to work like you expect.
2. Get into the habit of always quoting variable names when performing such tests (i.e. if [ "$string1" = "$string2" ]; then). Not doing so may bite you when you're not expecting it.
Click to expand...
Click to collapse
1. I started out with these spaces and tested the script with and without the spaces and it did not make any difference (output was the same) so I removed them thinking they weren't needed. But I did question this. I observed other examples that had this space and was wondering why they were there. Also the spaces between the [ ] and the arguements are required. I did actually know that [=test was a command (from prior readings).
2. Why is this important for variables with no special characters? I thought that was only a grouping thing for variables like "${OBJ}_Cache"
[Edit] Wiki: The quotation marks around $1 ensure that the test works properly even if the value of $1 is a null string. If the quotation marks are omitted and $1 is the empty string, the test command displays the error message "test: argument expected"
_that said:
Try these variants and observe the result:
Code:
if [ a=a ]; then echo yes; fi
if [ a=b ]; then echo yes; fi
if [ a ]; then echo yes; fi
if [ ]; then echo yes; fi
(I actually did the same to find out what's going on)
Click to expand...
Click to collapse
But you may need the spaces around the "=" and quotes around the variables that @becomingx points out for accurate results. As the variable names become more complex this may fail.
Code:
if [ "a" = "b" ]; then echo yes; fi
elfaure said:
2. Why is this important for variables with no special characters? I thought that was only a grouping thing for variables like "${OBJ}_Cache"
[Edit] Wiki: The quotation marks around $1 ensure that the test works properly even if the value of $1 is a null string. If the quotation marks are omitted and $1 is the empty string, the test command displays the error message "test: argument expected"
Click to expand...
Click to collapse
Not only for that reason, but also for things like spaces.
Code:
THIS="and that"
if [ $THIS == "and that" ]; then
...
fi
== `[: too many arguments'
becomingx said:
Not only for that reason, but also for things like spaces.
Code:
THIS="and that"
if [ $THIS == "and that" ]; then
...
fi
== `[: too many arguments'
Click to expand...
Click to collapse
So I followed @_that's link to the Wiki for [=test, and there is absolutely no discussion at all about using "=" or "==" for testing comparisons between variables, only strings. Why?? These examples and your Firefox code for B2R script use the equal operator for comparison and that is what i am trying to do here but I can't yet make it work.
I have failed to figure this out. Here is my test code citing due dilligence. I will now peek at @_that 's solution.
Code:
#!/system/bin/sh
#This script finds duplicate binaries in /system/bin and /system/xbin and prints them to the screen
BIN="$(ls /system/bin)"
#XBIN="$(ls /system/xbin)"
XBIN="$(find /system/xbin -iname "{$OBJ}")"
for OBJ in $BIN
do
#if [ "${OBJ}" = "${XBIN}" ]; then
#if [ "${OBJ}" ] && [ "${XBIN}" ]; then
if [ "${OBJ}" == "$XBIN" ]; then
echo $OBJ
fi
done
I have failed to figure this out. Here is my test code citing due dilligence. I will now peek at @_that 's solution.
[Edit] Short, sweet, simple, works, brilliant. What cereal do you eat in the morning @_that? I think I need to change mine.
Question: Is there any way to make this work with my original structure??? I need a comprehensive method for test matching a string variable to a list variable AND a list variable to another list variable. I would think the latter could be reduced to the former thru the use of a for-do loop "for OBJ in $LIST_VARIABLE1 do ...something to...$LIST_VARIABLE2".
Code:
#!/system/bin/sh
#This script finds duplicate binaries in /system/bin and /system/xbin and prints them to the screen
BIN="$(ls /system/bin)"
#XBIN="$(ls /system/xbin)"
XBIN="$(find /system/xbin -iname "{$OBJ}")"
for OBJ in $BIN
do
#if [ "${OBJ}" = "${XBIN}" ]; then
#if [ "${OBJ}" ] && [ "${XBIN}" ]; then
if [ "${OBJ}" == "$XBIN" ]; then
echo $OBJ
fi
done
:::BRIEF DESCRIPTION:::
mksh is the official, currently-developed shell used for Android. It is not an app nor a virus (lol) like some people seem to think, looking at a quick xda search. And as the core shell for android, it is used to shell superuser, so if you're rooted and get a message saying "mksh requests root", that basically just means that superuser is being run correctly and is using the default Android shell that is in every Android device. (GOOD)
If you get a message saying bash(or any other shell) requested root, and you're NOT in the terminal interactively. That most likely is NOT GOOD! Almost all bash scripts I've seen will run shelled with mksh, so be safe and shebang with mksh. You'll have better performance and features, and when you see bash requesting root, you'll know when your security is likely compromised.
::: mksh Resources/links/info :::
mksh author: mirabilos (on xda forums)
mirbsd mksh main page: https://www.mirbsd.org/mksh.htm
mksh man page: https://www.mirbsd.org/htman/i386/man1/mksh.htm
edited 15Aug2014
Now that that's out of the way, I've attached a few zips in the 2nd post. The first contains my personalized mkshrc (startup mksh script), the full original mkshrc it's based on, and a diff for anyone who's interested. **This file belongs at /system/etc/mkshrc.** The rest of this first post details what I've cooked up in my mkshrc (and fpath functions). The other zips' contents are described in the 2nd post.
Features scripted into mkshrc:
--sudo: basic su executor
e.g.:
Code:
sudo mount -o rw,remount -t f2fs /system /system
sudo cat <<< $'\n' >> /system/build.prop
sudo 'sysrw; for i in /system/*; do chown 0 "$i" ; done; sysro'
--suid: (set user id) Uses chpst to run a prog setsuid, this is broken in most busyboxes so I included one with a working chpst. Usage:::
e.g.:
Code:
suid 1000 sh
--Rebind tab completion: unjams clustered words:
e.g.: <[cursor]> is cursor position
Code:
bind -m -- '^I= ^B^[=^D'
<<EXAMPLE USAGE>>
ec<[cursor]>12345 + tab ---> echo 12345
--Rebinded "control + u" to "cut-to-beginning of line" like bash. (As mirabilos points out, this is ksh incompatible behaviour since "control + u" is "kill-line" in *ksh shells. This can be removed from the (/system)/etc/mkshrc shell startup file if it presents any problems in editing.) The exact binds are:
Code:
bind -- '^[W=kill-region'
bind -m -- '^U=^[ ^A^[W'
<<EXAMPLE USAGE>>
ec<[cursor]>12345 + ctrl + u ---> <[cursor]>12345
--TMPDIR: mounts a tmpdir at /tmp for all users and random generates subdirs for individual secured tmpdirs. This fixes here-docs, here-strings, and here-executions.
e.g.:
Code:
su << 'eof'
sysrw; chgrp 2000 /system/bin; sysro
! (( $? )) && print -- -changed them bin group-
eof
--Basic "help" command: Android lacks this and the doc is still under development I believe. I added all the basic info/command-forms for mksh bultins to a command help(aliased to h):
e.g.:
Code:
help mkn
> mknod [-m mode] name b|c major minor
> mknod [-m mode] name p
or
Code:
help
(all help is printed, grep from here if you want)
--Complicated-programmed and colorful PS1 prompt, it looks good and I thought it through. Programming shows mksh potential for rich shell programming. It auto-turns off xtrace within itself (to 3 lines) so that 50 lines don't get printed each return with set -x. mksh small (R43 mksh) will be autodetected and give a different white and black classic ksh prompt.
--ton of ultra lazy aliases, got my android scripting speed up to ~70% my normal pc speed.
--dot.mkshrc functions from official mkshrc like pushd, popd, dirs, more, hd, Lb64encode, Lb64decode, hash optimizations
The scripting in this gets pretty complex, especially the inherent mkshrc functions. It would make a good scripting learning tool to say the least. I know I've learned twice what I knew from bash scripting back 3 months ago.
I've been working on modding the mkshrc a while, so I appreciate any error reports if you give mine a try. Shouldn't be any problems though.
Modifying the mkshrc file / mksh shell has system-wide effects, so PLEASE nandroid backup as usual!!! This should be COMPATIBLE with all androids, but has only been tested on my Galaxy Nexus thus far. **The binary is compatible with androids using an ARM cpu, but the steps in the 3rd post will generate a binary for whatever ARCH you're running.**
EDIT: reprogrammed sudo with pexec, so it can do parallel executions. pexec, grep, and a full busybox are included in a zip with some other bins.
For Jack Palevich's terminal emulator or connectbot, telnet, etc, I use this as my su'd "shell" command under >>Options>>Shell:
Code:
/system/xbin/su --shell /system/bin/mksh --command exec /system/bin/pexec -z -15 --shell /system/bin/mksh -m '/system/bin/mksh'
What's safer though is to just use a non-su shell command:
Code:
/system/bin/mksh -
...and then use sudo for your su commands. This is more linux'y.
EDIT2 (big update): Got static mksh R50 compiled. Ended up booting ubuntu in Android to compile instead of cross-compiling. mksh's Build.sh compiler script works great. I just had to "sudo apt-get install gcc" and bam it built with "LDSTATIC=-static ./Build.sh".
EDIT3 - Changed main.c source mkshrc file to /system/etc/mkshrc, perfect static mksh R50 now.
EDIT4 - Changed compiler to klcc to get size way down, now at 196KB with -O2 LTO speed optimizations.
EDIT5 - Binary is updated to R50d, compiled with CFLAGS=-Os, and stripped to get size down to ~140KB. (This is even smaller than the R43 dynamic mksh binary that is currently used in roms.)
EDIT6 - Added a mksh trunk (latest and greatest) binary with the printf builtin compiled in. Use with caution. Btw, if you read all the way down here, then yes, these binaries work in lollipop since they're statically compiled.
:ownloads:: (#7 or #8 is the static binary by itself)
(1) mksh R50 source, binary, manual
(2) Highly compressed pack of extra bins/libs that are mentioned in my mkshrc (zsh, lz4c, grep, busybox, bash, nano, vim, curl, etc) and some other cool ones like macchanger and ed. Download #3 to extract on Android.
(3) 7za in case you need it to extract (2) on Android.
Code:
7za x name_of_archive.7z
(4) Classic unix text editor "ed" which mksh uses for edit functionality. (Copy to /system/bin along with mksh.)
(5) Official mkshrc (unzip and copy to /system/etc, set permissions to 0444)
(6)
My personalized mkshrc startup mksh shell script based on the official full mkshrc 2014/01/11 release. Described in first post. If you try this, make sure to symlink /system/xbin/busybox to /system/bin/busybox.ndk.
Official mkshrc 2014/01/11 release
"diff -ur /system/etc/dot.mkshrc--official.mkshrc mkshrc" (diff patch set from official mkshrc to my personalized mkshrc)
(7) mksh static binary! (Just unzip, "chmod +rx" it, and copy to /system/bin or run from anywhere, no libs required )
(8) mksh R50e with printf builtin (I know some people were looking for this)
::: Building mksh Static On Android (really Ubuntu though..):::
This is just for anyone who wants to try, and especially those without access to a PC.
Things we'll need besides your phone:
-"Android Terminal Emulator" app {get it from (http://jackpal.github.com/Android-Terminal-Emulator/downloads/Term.apk) or fdroid or gplay}
-"Complete Linux Installer" app {get it from (http://sourceforge.net/projects/linuxonandroid/?source=typ_redirect) or gplay or maybe fdroid}
-internet/wifi
-mksh source {download from (https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R50.tgz) or link in first post or DL in second post}
1) We need to get Ubuntu or Debian booted for a sufficient build environment. I've used both on Android but I like the better stocked terminal in the Ubuntu images. I used the app Complete Linux Installer which is free and works beautifully, very simple and easy too. In the app you want to follow the short instructions to download an Ubuntu image, rename it to ubuntu.img, and place it in a folder named ubuntu in /sdcard. Then hit menu in the app and click the terminal screen icon that says "Launch". An Ubuntu terminal will now open in Android Terminal Emulator. Super quick and easy.
2) Let's download GCC and ed so we can build and test with zero errors.
Code:
apt-get install -y gcc ed
3) Now the cool thing about this chroot Ubuntu environment is that we still have access to the sdcard to transfer files between Android environment and the chroot jail. Extract your downloaded mksh source to your Ubuntu home with something like:
Code:
cd
tar -xf /sdcard/Download/mksh*.tgz
cd mksh
4) Since we're building this for Android, the mkshrc file is at /system/etc/mkshrc instead of ~/.mkshrc, so we can change this with:
Code:
sed -i 's|~/.mkshrc|/system/etc/mkshrc|' ./main.c
Now we can build mksh statically:
Code:
chmod +x Build.sh
MKSHRC_PATH=/system/etc/mkshrc LDSTATIC=-static ./Build.sh -r -c lto && ./test.sh
Let the build script crank out the binary for a couple minutes and run the test suite. There should only be an error on a "mkshrc" test since we changed it for android. The "-r -c lto" flags/opt aren't needed but recommended.
Edit: (size optimization): Strip the compiled mksh binary to make it super small (~150KB with a CC="klcc" or CC="diet gcc" compile).
Code:
strip --strip-unneeded ./mksh
5) Now let's copy it to /system/bin to replace your old one.
Code:
cp ./mksh /sdcard
(Open a new terminal tab to get into Android Environment)
sysrw
cp -f /sdcard/mksh /system/bin
chmod 0555 /system/bin/mksh
sysro
.. and done. Run some scripts and enjoy your static mksh!
*** OPTIONAL EXTRA STEPS TO USE klcc or other compiler ***
In step (1), also do
Code:
apt-get install -y libklibc-dev
to get the klibc development tools, and then...
In step (4), this is how you specify to use klcc (aka build against klibc using the klcc wrapper):
Code:
CC="$(which klcc)" MKSHRC_PATH=/system/etc/mkshrc LDSTATIC=-static ./Build.sh -r -c lto && ./test.sh
:::Compile mksh in Android (for ARM):::
1) Download the attached cross-compiler and mksh source (https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R50.tgz). Copy them to /data/media. If you don't have 7za, download that as well from the previous post but place it in /system/bin and "chmod +x" it
2) Extract contents:
Code:
cd /data/media
7za x -so 2014-10-01__simple-cross-compiler-armv4tl.stripped.tar.7z | tar -xf -
tar -xf mksh*.tgz
3) Compile the source with:
Code:
cd mksh
chmod +x Build.sh
LDFLAGS=-static CC=../simple-cross-compiler-armv4tl.stripped/bin/*gcc ./Build.sh -r -c lto
../simple-cross-compiler-armv4tl.stripped/bin/*strip -s mksh
4) Replace old mksh and mkshrc
Code:
mount -o rw,remount /system
cp mksh /system/bin
cp dot.mkshrc /system/etc/mkshrc
chmod 0555 /system/bin/mksh
chmod 0444 /system/etc/mkshrc
mount -o ro,remount /system
@7175 : Hello! Look like a bunch of hard work there. Very nice.
1. Would you have any clue to what's going on HERE?
2. Would you know if I can just install over my old mksh binary to get this working, or do I need "everything"?
3. And since I've heard that /system/bin/mksh will soon be permanently only /system/bin/sh perhaps this need to be changed?
Hey E.VA. thanks for checking out the thread. If you want to just test out R48 mksh, just copy(from zip root directory) the lib*.so from /data/media/shell to /system/lib and then copy /data/media/shell/mksh to /system/bin (and chmod 0555 /system/bin/mksh; chmod 0444 /system/lib/*.so). Then you'll have your whole system running full mksh R48.
As far as the ssh problem with android, this definitely becomes grey-zone material to my knowledge, which is limited in this area. I'm pretty sure android has udev amputated so it lacks a fully working /dev/tty. This could probably be patched over though with some terminal work, mknod action. I've gotten ssh working under "terminal ide", but haven't used the stock ssh stuff in /system/bin. Now that you mention this though, I will try and get stock ssh going as well as openssh which had a similar problem last time I tried (thx for mentioning your support thread, I'll be checking that out).
Here's what I searched to shed a little light on that ssh /dev/tty issue: duckduckgo.com/html5/?q=ssh+%27dev%2Ftty%27+error.
It looks like you've done a ton of searching though.
For su commands, I would try using, e.g.,
Code:
su exec [i]command[/i]
...opposed to "su -c", or better e.g.,
Code:
su -c exec /system/bin/sh -c '[i]command[/i]'
...and see if that gives any different results.
I just know from experience "su -c" hasn't always cut it.
*edit: Couple other things worth trying:
1) preappend command with environment variable: global TTY=/dev/pts/0 ...
2) use the -T option when calling mksh, i,e. ssh ... -e mksh -T /dev/pts/0 ...
@7175 : Hey thanks for looking into this. I will definitely try your suggestions.
However, I've already tried the -T flag to ssh, but never by specifying the pts to use, as it should be dynamically allocated by the ptmx. (As it could be already in use, by something else, like ATE.) Also, what does "global" do?
You also mentioned "stock ssh" in /system/bin. I've never seen that. Perhaps that could be a better solution, unless its' even more crippled. Does it also support sshd (i.e. ssh -D)?
In the mean time, is there any particular reason why you decided to dynamically link mksh? (I assumed it would have been more portable with static linking?)
I see that you did a huge amount of work on that mkshrc script. Looks crazy (in a good way)!
Finally, and aside, I also noticed that when I start mksh from ssh session, there are some aliases in there, that is not specified in the mkshrc, nor the .profile of my SSH server, so where the heck do they come from?
Code:
[SIZE=2][email protected]:home # alias
autoload='typeset -fu'
functions='typeset -f'
hash='alias -t'
history='fc -l'
integer='typeset -i'
local=typeset
login='exec login'
nameref='typeset -n'
nohup='nohup '
r='fc -e -'
source='PATH=$PATH:. command .'
type='whence -v'[/SIZE]
Perhaps they're hardcoded or sourced from somewhere? Have you seen this?
E:V:A said:
@7175 : Hey thanks for looking into this. I will definitely try your suggestions.
However, I've already tried the -T flag to ssh, but never by specifying the pts to use, as it should be dynamically allocated by the ptmx. (As it could be already in use, by something else, like ATE.) Also, what does "global" do?
You also mentioned "stock ssh" in /system/bin. I've never seen that. Perhaps that could be a better solution, unless its' even more crippled. Does it also support sshd (i.e. ssh -D)?
In the mean time, is there any particular reason why you decided to dynamically link mksh? (I assumed it would have been more portable with static linking?)
I see that you did a huge amount of work on that mkshrc script. Looks crazy (in a good way)!
Finally, and aside, I also noticed that when I start mksh from ssh session, there are some aliases in there, that is not specified in the mkshrc, nor the .profile of my SSH server, so where the heck do they come from?
Code:
[SIZE=2][email protected]:home # alias
autoload='typeset -fu'
functions='typeset -f'
hash='alias -t'
history='fc -l'
integer='typeset -i'
local=typeset
login='exec login'
nameref='typeset -n'
nohup='nohup '
r='fc -e -'
source='PATH=$PATH:. command .'
type='whence -v'[/SIZE]
Perhaps they're hardcoded or sourced from somewhere? Have you seen this?
Click to expand...
Click to collapse
Thanks man lol it's a big rc. It was 50KB before I converted a bunch of the functions to fpath functions in /etc/fpath and stripped most of the comments. It should give a pretty quick shell in terminal though with the ulimit and renicing tweaks. The PS1 prompt is pretty awesome, probably the best thing in the mkshrc I included.
"global" is a function just like "typeset" or "declare" in bash. The difference is that global prevents an accessed variable from being localized/ different than the global value in a function. This is a mksh function, bash will use "declare -g". There are a couple of example usage in the mkshrc, like with the set -x spam fix for the command prompt.
I checked and stock ssh in /system/bin has the "-D" flag. I would also check rolo's zshaolin zsh project which comes with some afterstock ssh stuff, ssh keygen, ssh keysearch, different ssh etc.
Yeah I just symlinked sh to save space really and for portability to try out other shells like bash and zsh(this works!) to run the system. Recently I switched to using a copy of mksh as sh since "chattr +i" wasn't protecting the symlink from being over-linked.
The aliases you posted are in fact hard-coded. If you do "strings /system/bin/mksh | grep -C7 autoload" or something similar, you'll see them in the binary. I always wondered where those came from too until I read through the mksh manual over a couple months, that's some pretty dense reading lol. mksh is a superb shell though, so it's definitely well worth it.
Sorry I can't be of more help with the ssh /dev/tty problem. I will keep my eyes open though, and try not to be so lazy using telnet for all my remote connections. I mean that's basically using the internet without a condom lol.
(*Also, just something I should mention about the install zip contents: not all the /etc/fpath functions are finished yet. I still gotta tweak the ssh ports from /etc/ssh and finish my xargs. Most should work though and are safe and won't interfer with shell usage, even if autoloaded.)
@mirabilos :
Hi, why did you choose to hardcode the aliases (shown in post#6) into the mksh binary?
Also, do you have a later version than the R48 Android binary above?
The "r" alias is particularly disturbing as it is masking the native toolbox use of "r" to read a memory location.
7175 said:
with the ulimit and renicing tweaks.
Click to expand...
Click to collapse
Why do they need to be tweaked?
I checked and stock ssh in /system/bin has the "-D" flag. I would also check rolo's zshaolin zsh project which comes with some afterstock ssh stuff, ssh keygen, ssh keysearch, different ssh etc.
Click to expand...
Click to collapse
Sorry my bad, I was sleepy and mistakenly understood "-D" as running SSH in daemon mode, when in fact it does the opposite and prevents it. Seem like his links are dead or I'm just looking in the wrong place.
Recently I switched to using a copy of mksh as sh since "chattr +i" wasn't protecting the symlink from being over-linked.
Click to expand...
Click to collapse
Not sure what you're saying here...
Sorry I can't be of more help with the ssh /dev/tty problem. I will keep my eyes open though, and try not to be so lazy using telnet for all my remote connections. .
Click to expand...
Click to collapse
Thanks, but if telnet works with tty/pts jobcontrol and vi etc, then I'm fine with that for now. I tried your command variations above and got this:
Code:
[SIZE=2]#ssh -2 [email protected] -p 2222 -T su -c exec /system/bin/sh -i # This worked!
#ssh -2 [email protected] -p 2222 -T su -c exec /tmp-mksh/tmp-mksh -T /dev/pts/0
/tmp-mksh/tmp-mksh: chvt: can't find tty /dev/pts/0
#ssh -2 [email protected] -p 2222 -T su -c exec /tmp-mksh/tmp-mksh -T /dev/ptmx
/tmp-mksh/tmp-mksh: chvt: new shell is potentially insecure, can't revoke /dev/ptmx
[/SIZE]
The fist one is good to get direct root prompt, the second fails, since pts/0 has not been created yet, and if it has, it fails with permission issue, since another process is trying to steal the pts. The reason why the third one fails, is very cryptic and I don't understand the error message and neither the code generating it.
Do you think one could use the ATE app to get a working root shell by the use of a more complex ssh command? Any suggestions how that would look?
Finally, I'm a bit worried about replacing the libc.so dependency, since the whole system depend upon it, and would probably not boot if an incompatible libc.so is used. This is why I asked about a static binary. I'd much rather have a bloated mksh than having to add library files. (We have plenty of memory and space these days.)
Regarding compiling, I would recommend using Linaro a build, rather than the crappy and often broken/outdated Code Sourcery junk.
Check this thread:
[LINARO GCC] Cross Compiler Toolchains [Linaro GCC 4.9 2014.07, 4.8 and 4.7 2014.04][19/07/2014]
Cheers!
7175 said:
--Better tab completion: unjams clustered words:
--Added "control + u" to "cut-to-beginning of line" like bash.
Click to expand...
Click to collapse
Hi! As the author of mksh, I am hereby explicitly requesting you to add a suffix to the shell version, similar to what the PLD Linux guys do here, because this changes the behaviour of the shell in an incompatible way. (Just add your own string there after a space, the @distro@ is just a placeholder that gets replaced with the PLD Linux package version.)
Do note that ^U in Korn Shell (and others) is “delete entire line”.
7175 said:
--Very complicated-programmed and colorful PS1 prompt, it looks good and I thought it through. Programming shows mksh potential for rich shell programming. It auto-turns off xtrace within itself so that 50 lines don't get printed each return with set -x. mksh small will be autodetected and give a different white and black classic ksh prompt.
Click to expand...
Click to collapse
Interesting idea, I think I will pick up the “set +x” thing.
Do you mind sharing a patchset of all your changes, so I can incorporate those I feel would be good to have in general?
7175 said:
EDIT: It appears the libc required for full mksh isnt always friendly
Click to expand...
Click to collapse
Just link the shell statically, then.
E:V:A said:
1. Would you have any clue to what's going on HERE?
Click to expand...
Click to collapse
You are annoying me. I've told you times and times again to disable SEAndroid, or to fix its SELinux policies.
E:V:A said:
2. Would you know if I can just install over my old mksh binary to get this working, or do I need "everything"?
Click to expand...
Click to collapse
Define “everything”. mksh in AOSP is /system/bin/mksh plus mkshrc.
E:V:A said:
3. And since I've heard that /system/bin/mksh will soon be permanently only /system/bin/sh perhaps this need to be changed?
Click to expand...
Click to collapse
I'm working with enh of Google on that. I would like for mksh to be installed as /system/bin/mksh and /system/bin/sh to be a link/copy of it, always. He said he'd agree I could change that back.
E:V:A said:
Hi, why did you choose to hardcode the aliases (shown in post#6) into the mksh binary?
Click to expand...
Click to collapse
These are part of the shell, and have always been, even in pdksh times.
E:V:A said:
Also, do you have a later version than the R48 Android binary above?
Click to expand...
Click to collapse
I do not deal in binaries normally. I'm somewhat working on updating AOSP to mksh CVS HEAD, in tandem with enh from Google, but when I had the time for that, it appears they changed the build system requirements. But it will be there.
It's not as if a newer mksh version would fix your SELinux problem, though…
E:V:A said:
The "r" alias is particularly disturbing as it is masking the native toolbox use of "r" to read a memory location.
Click to expand...
Click to collapse
The “r” alias is especially required for the Emacs command line editing mode. Interesting that toolbox uses it too. Thanks for bringing this to my attention, I will ask enh to change “r” in toolbox.
@E:V:A : Glad the first execution you mentioned worked. I would try messing with quotes/double quotes around the shell command, i.e. ssh ... -T su -c 'exec ...' or try ssh ... -T su -c exec "...", as something to test out further. This can make a lot of difference.
The ulimit shell function can control all sorts of performance related stuff, priority, max niceness, etc. You can see all values with "ulimit -a".
I understand your hesitance about the libc.so replacement. I would keep a copy of the old one and twrp backup before trying out a new one. I get what you're saying about statically linked binaries. I just fixed my i7 desktop that had a blown power supply, so I'll be looking into this. Thanks for the linaro link!
@mirabilos : Thanks for taking a look at this and providing us with mksh! I updated my OP with the specifics about the rebinds for "control I" and "control U" that you mentioned, and I added a suffix to the beginning comments of the file. Something like:
Code:
# $MirOS: src/bin/mksh/dot.mkshrc,v 1.88 2014/01/11 18:09:39 tg Exp $Android_mod by [email protected] 2014/08/04$
Not sure if that's what you wanted me to add in. I included an extra zip to download in the 2nd post that contains the official mkshrc 2014/01/11, my personal mkshrc, and a "diff -ur" patch (also attached to this post).
I will look into getting a statically linked mksh compiled, that sounds like something really handy to keep around.
edit: Here's basically what I added to the beginning and end of PS1 to trim down its "set -x" verbosity to 3 lines. I'd like to get it down more but haven't figured it out.
Code:
PS1=$'\001\r'; PS1+='${|
local e=$?
[[ -o -x ]] && set +x && global -x XTR_DBG=1 || global -x XTR_DBG=0
...
...
...
(( XTR_DBG )) && set -x
return ${e}
} '
7175 said:
@mirabilos : Thanks for taking a look at this and providing us with mksh!
Click to expand...
Click to collapse
You’re welcome!
7175 said:
Not sure if that's what you wanted me to add in.
Click to expand...
Click to collapse
Ah, so you did not patch the mksh binary, only the mkshrc file?
But then, that’s okay as you wrote, sure.
7175 said:
I included an extra zip to download in the 2nd post that contains the official mkshrc 2014/01/11, my personal mkshrc, and a "diff -ur" patch (also attached to this post).
Click to expand...
Click to collapse
OK, thanks. Will have a look at it within the next weeks (August is going to be a busy month for me).
I’m assuming you are okay with me adding some of your changes back to main mksh?
7175 said:
I will look into getting a statically linked mksh compiled, that sounds like something really handy to keep around.
Click to expand...
Click to collapse
Indeed, it is.
The first mksh run on Android actually was statically compiled against µClibc, though that’s cheating. (Also, dietlibc and klibc are better than µClibc). I think it should work against Bionic, too.
7175 said:
edit: Here's basically what I added to the beginning and end of PS1 to trim down its "set -x" verbosity to 3 lines. I'd like to get it down more but haven't figured it out.
Click to expand...
Click to collapse
I don’t think it works in less, considering you have to save the previous $?. There are a few handy tricks around. I tried these four:
#1 is:
Code:
local e=$?
[[ -o -x ]]; local x=$?; set +x
(( e )) && REPLY+="$e|"
[…]
(( x )) || set -x
return $e
This is about what you did. #2 is:
Code:
local e=$? x=$([[ -o -x ]]; echo $?); set +x
(( e )) && REPLY+="$e|"
[…]
(( x )) || set -x
return $e
This only looks different (I’d prefer #1 over this.) #3 is:
Code:
set +x $? $([[ -o -x ]]; echo $?)
(( $1 )) && REPLY+="$1|"
[…]
(( $2 )) || set -x
return $1
This reduces visual clutter. #4 is:
Code:
set +x $? $([[ -o -x ]]; echo $?)
(( $1 )) && REPLY+="$1|"
[…]
(( $2 )) && return $1
(( $1 )) && set -x && return $1
set -x
This reduces visual clutter even more, in that, when $? is 0, one line less is shown. But it makes the number of lines shown be not always the same. YMMV on whether to use this, #3 or #1.
This could be made even nicer *iff* mksh had the EXIT trap when leaving a function. The manpage says it’s TODO. This part of the manpage is from 1999 or older. (I started mksh in late 2002, early 2003.) Go figure… But now I have a reason to add it ☺
Another thing you could do is “set +o inherit-xtrace”, which makes functions not run with “set -x” when the main body runs with it. But wait, I see now that it does not affect ${|…;} blocks. This is a bug, which I’ll fix ☻
@mirabilos:
You Wrote:
1. Would you have any clue to what's going on HERE?
Click to expand...
Click to collapse
You are annoying me. I've told you times and times again to disable SEAndroid, or to fix its SELinux policies.
Click to expand...
Click to collapse
Well, you can be as annoyed as you like. First of all, that question was not aimed at you, and second, as I have also said repeatedly, I have already tried using SELinux in Permissive mode and it doesn't work either. In addition, your suggestion to "fix its SELinux policies" is rather ridiculous as there are no tools available to do so. At least nothing out of the box and no available binaries anywhere, and surely no instructions how to do so. So if you know how to do it, why don't you just explain for us how to do so. (My policies are updated to latest according Androids policy update tools.)
In addition there is no such thing as "disable SEAndroid". It's either in Permissive or Enforced mode. That is, unless you flash a new custom FW, which is out of the question. In addition, ATE works just fine, in Enforcing mode.
So believe me, I am far more annoyed by Googles lack of SELinux/SEAndroid developer support, than you will ever be from me asking these questions.
Thanks for explaining and helping with everything else above.
@7175:
The ulimit shell function can control all sorts of performance related stuff, priority, max niceness, etc. You can see all values with "ulimit -a".
Click to expand...
Click to collapse
Yes, I know about all those things, but I was asking why you think they need to be tweaked? The defaults, seem to work just fine.
@mirabilos : Thank you for your detailed replies, and I would be more than happy to contribute if you see anything from the content I posted.
It is interesting to see the other possibilities for turning off xtrace within the PS1. I didn't even realize you could set positional parameters after the set -x... I think I like that one the most. It just seems more array-like and streamlined, although I guess the same number of variables is still used. I look forward to seeing what updates you'll have on the exit trap and localization. This is something I'd like to toy around with.
I took your advice and set out to get a mksh static built. I ended up compiling with GCC, running "LDSTATIC=-static ./Build.sh" in the mksh source directory. I'm pretty new to cross compiling, so I didn't really get that far or try that hard before chrooting to a fresh Ubuntu terminal on my Nexus, installing GCC, and compiling there. The only thing I changed in the source code was ${ENV:-~/.mkshrc} to ${ENV:-/system/etc/mkshrc} in the "main.c" source file. I can include this in the OP though as you mentioned before. (edit: just saw this as a compiler option with Build.sh)
Edit: I see the option now in the Build.sh for changing the mkshrc path. Also, got R50 rebuilt static with klibc. Damn that got the size way down from using glibc, 684K to 204K.
R50e is released
R50e is released -- see https://www.mirbsd.org/mksh.htm#clog
Hi @7175, good stuffs here man :good:
I've been using your modded mkshrc, and I can see a hell of a lot of work you put into it. Looks really cool. Plus it's really a good place to learn for someone like me, I definitely had learnt a lot for the past few days. Tons of aliases too, and I'm getting used to using it now. I really appreciate your stuffs here, hope to see more of it
alanthehat said:
R50e is released -- see https://www.mirbsd.org/mksh.htm#clog
Click to expand...
Click to collapse
Thanks for the heads up. Updated the binaries posted in the 2nd OP to mksh R50e.
Reinkaos said:
Hi @7175, good stuffs here man :good:
I've been using your modded mkshrc, and I can see a hell of a lot of work you put into it. Looks really cool. Plus it's really a good place to learn for someone like me, I definitely had learnt a lot for the past few days. Tons of aliases too, and I'm getting used to using it now. I really appreciate your stuffs here, hope to see more of it
Click to expand...
Click to collapse
Thanks for the feedback man! Glad it's been a good learning experience like it has been for me.
7175 said:
Thanks for the feedback man! Glad it's been a good learning experience like it has been for me.
Click to expand...
Click to collapse
Well, thanks for the updated binary! Anyway, anything you can recommend me to read other than the man page in OP? And I have one more question, what's the difference between the busybox (I got one from your other thread) and yours busybox.ndk?
While I’m the upstream developer of mksh, hacking it has also been a good learning experience for me.
So it is for a friend of mine, who has taken some fundamental script frameworks I wrote, and extended it to an impressive management system, learning to code good shell while doing so.
I’m always happy when my stuff helps other people, and they share their joy! ☺
By the way: new mksh release announcements are sent over the miros-mksh mailing list (send an eMail to postmaster at mirbsd dot either org or de to subscribe).
---------- Post added at 08:40 PM ---------- Previous post was at 08:34 PM ----------
Well, we have https://www.mirbsd.org/ksh-chan.htm which collects lots of Korn Shell-related resources, although most of it is for AT&T ksh93 (the “original” Korn Shell), much also applies to mksh, though the Android OS has some special handling (especially caused by the different user-space tooling) obviously.
The shell itself behaves exactly the same across *all* supported platforms though, so (once you have set $TMPDIR to something writable for your current user) you can write Pure mksh code exactly like on Unix or Cygwin or the Macintosh or even Haiku.
mirabilos said:
While I’m the upstream developer of mksh, hacking it has also been a good learning experience for me.
So it is for a friend of mine, who has taken some fundamental script frameworks I wrote, and extended it to an impressive management system, learning to code good shell while doing so.
I’m always happy when my stuff helps other people, and they share their joy!
By the way: new mksh release announcements are sent over the miros-mksh mailing list (send an eMail to postmaster at mirbsd dot either org or de to subscribe).
---------- Post added at 08:40 PM ---------- Previous post was at 08:34 PM ----------
Well, we have https://www.mirbsd.org/ksh-chan.htm which collects lots of Korn Shell-related resources, although most of it is for AT&T ksh93 (the “original” Korn Shell), much also applies to mksh, though the Android OS has some special handling (especially caused by the different user-space tooling) obviously.
The shell itself behaves exactly the same across *all* supported platforms though, so (once you have set $TMPDIR to something writable for your current user) you can write Pure mksh code exactly like on Unix or Cygwin or the Macintosh or even Haiku.
Click to expand...
Click to collapse
Thanks for the link, and for your works on mksh too! I'm really new to shell, I'm not even that familiar with unix/linux either. But I always have been interested in shell scripting, so I'm glad that I stumbled upon this thread
Whew, that's a lot of stuff in that link you gave, definitely gonna make use of it, thanks again!