[Q] Text editor within (not for) Android 2.3? - Android Software/Hacking General [Developers Only]

Does the OS itself include a text editor? I want to be able to ssh into my phone (a Samsung Galaxy SII running stock 2.3 if it's in any way relevant) and edit configuration files on the command line.
I have already installed an ssh server and have poked around in the OS and the only option I could find was sed which, although excellent for its intended task, is far from user friendly for editing config files.
I'm not surprised that there is no emacs, or even vi (my favourite) but I thought that at least ex would be available.
Just to make it absolutely clear, I am not looking for a marketplace type app, I am looking for command line editor within the OS itself.

lotus49 said:
Does the OS itself include a text editor? I want to be able to ssh into my phone (a Samsung Galaxy SII running stock 2.3 if it's in any way relevant) and edit configuration files on the command line.
I have already installed an ssh server and have poked around in the OS and the only option I could find was sed which, although excellent for its intended task, is far from user friendly for editing config files.
I'm not surprised that there is no emacs, or even vi (my favourite) but I thought that at least ex would be available.
Just to make it absolutely clear, I am not looking for a marketplace type app, I am looking for command line editor within the OS itself.
Click to expand...
Click to collapse
If you root, you can install busybox, which includes vi.

Excellent, that's what I needed to know.
I thought busybox was already installed because I remember seeing all the binaries in /system/bin linked to the same binary but having checked I see it's something called toolbox, which is presumably something similar but not as good.

Since I had already rooted my phone and in the process, installed busybox, I thought I was home and dry.
Unfortunately, when I tried running busybox, it appears that it doesn't include vi or at least the version I have doesn't.
Code:
# busybox vi
vi: applet not found
It looks like my problem is still unsolved after all .

Root Checker will verify if it's installed correctly. Advanced mode will list all the commands included. You can use this to install or update it.

Thanks for your help. The first app verified that I do have busybox installed but as I thought, my version doesn't include vi.
The second suggestion did try to install a newer (and more complete) version of busybox. It didn't appear to succeed but I'm reasonably confident of being able to debug this myself without further help.

Related

JFv1.31 Released! (updated 01-03-09)

Update (01-03-09)
v1.31 is out! This is a minor bugfix release to fix a few issues that had cropped up in v1.3.
The changes from v1.3 include:
Fixed the nandroid backup so that it works on sdcards with a raw fat32 filesystem (with no partition)
Added the telnetd binary from RC28
Fixed an issue with SuperUser where it was displaying the wrong processes in the su request popup
SuperUser should allow root to use su without displaying the popup (though there's not much point.. )
Added /system/modules and /system/xbin to fstab in normal and recovery mode
Minor fix for the update-script, so the progress bar acts more sanely
I have the usual RC30 and RC8 versions, and new for v1.3 is an ADP1 version.
ADP1: (md5: 96b2abd9a1da2852bc33b2052ea51b2a)
http://android-dls.com/forum/index.php?f=24&t=223&rb_v=viewtopic
http://www.gotontheinter.net/content/new-images-jf (at bottom of page)
RC30: (md5: 0f2e6a4244410e00028db55b4fbf808c)
http://android-dls.com/forum/index.php?f=24&t=223&rb_v=viewtopic
http://www.gotontheinter.net/content/new-images-jf (at bottom of page)
RC8: (md5: e008bbe1d93abd0c2e5e6218f012f20d)
http://android-dls.com/forum/index.php?f=24&t=223&rb_v=viewtopic
http://www.gotontheinter.net/content/new-images-jf (at bottom of page)
These updates are installed the normal way. Save them to your sdcard named update.zip, boot into recovery mode (home + power), and then press alt+l and alt+s. If you are switch between versions, e.g. from RC30 to ADP1, then it's usually a good idea to perform a wipe. You can try booting up without a wipe, but if it doesn't boot, or you get strange errors once it boots up, go back into recovery and perform a wipe (alt+w)
Note: To install these updates, you need to have a recovery image that uses test keys. If any of the following are true, you most likely have a recovery image that uses test keys
- you have installed my modified recovery image in the past
- you have an ADP1
- you currently have one of my modified firmwares installed
What's new?
The coolest new functionality in v1.3 is a new backup utility that allows you to perform a backup directly from recovery mode with alt+B. This is done using infernix's and brainaid's nandroid script, which they kindly modified to work in recovery mode. Let them know what you think . The backups are stored in a subfolder in the nandroid folder on your sdcard. To restore them, you have to copy them to your computer, and then flash them with the fastboot tool (sorry, no integrated restore yet).
If you get errors when making a backup, first make sure you have enough free space on the sdcard. it needs around 85-90mb. If you have enough space, then try reformatting the sdcard (fat32 is your best bet).
Other changes of note include
This version includes a new busybox binary that I compiled against uclibc, making it much smaller (1.8mb vs 700kb).
All busybox applets are linked at /system/xbin/bb, which is also in the path. So there are many more standard unix commands available in the terminal.
Many more modules and binaries are included in /system/xbin and /system/modules. They were also optimized for size, so even though there are more modules and binaries, they actually take up much less space than they did on v1.2
I added the terminal emulator application to /system/app. (don't worry, it won't, or at least shouldn't , cause any problems if you already have it installed)
got rid of the normal su binary, in favor of koush's su and SuperUser application. See details here
when you boot up into recovery, it will automatically show the text. You can press alt+L to turn off the text and ogle the background. (did I mention there's a new background? shhh. it's a secret )
fixed the annoying uptime bug, where the uptime is shown incorrectly in the settings
added /data/local/bin to the path. Feel free to add your own binaries/scripts here.
includes the /dev/mtd/mtd6 and /dev/mtd/mtd6ro devices, which allow access to the entire flash chip (other than certain restricted areas used by the radio)
new "ro.modversion" property, that is set to "JFv1.3". The intent of this property is so you can know you are running a modified version, as well as identify which version
added a modified /system/etc/security/cacerts.bks file, which contains additional certificates for cacert.org (courtesy of Disconnect)
added a /system/etc/resolv.conf file with the 4.2.2 family of DNS servers, to allow busybox's ping, wget, etc. to resolve host names
See the attached change logs for a complete list of changes with respect to the corresponding "official" firmware.
---------------
Update (01-03-09): Updated the links to point to the v1.31 versions
In addition to the updates themselves, I am also releasing a build environment that can use to build each update from scratch. You can use these to easily make your own custom updates. It includes some utilities that were built from git source. The binaries are for 32bit x86 linux. If you want to run it on a different platform, you're on your own.
NOTE: You don't need these to use my update. Just download one of the updates from above and install it. The build environments are only if you want to make your own customized update.
The general idea of the build environment is that it extracts the original files from the official update (or from my original ADP1 update), and then copies over anything from the various ModifiedFiles folders, then packages it all back up into a ready-to-be-applied update.zip. It does this for the boot image, recovery image and system folder. You can also specify files to delete in the various OriginalFilesToDelete.mk files.
Consider anything new that I created for the build environments (the makefiles, etc.) to be in the public domain. Everything else retains its original license of course.
Instructions:
- extract the build environment into a folder
- download the official update that the update is based on, and put it in the root of the build environment. (note: use my original ADP1 update for the ADP1 build environment. available on this page)
- run make as root. yes, it has to be with root, because the binaries in the 2 cramfs images should be owned by root. (note: I plan on using fakeroot in the future, to workaround the need to be root)
- after make finishes, assuming there are no errors, the update should be in Workspace/update.zip.
Download the build environments here:
ADP1: (md5: 2d116b334515d4d702776b9d74d2e658)
http://android-dls.com/forum/index.php?f=24&t=223&rb_v=viewtopic
http://www.gotontheinter.net/content/new-images-jf (at bottom of page)
RC30: (md5: 29ced6e7601bac47252e51e5ac4f0ca4)
http://android-dls.com/forum/index.php?f=24&t=223&rb_v=viewtopic
http://www.gotontheinter.net/content/new-images-jf (at bottom of page)
RC8: (md5: b26f3cd244da9b8662766db69734000e)
http://android-dls.com/forum/index.php?f=24&t=223&rb_v=viewtopic
http://www.gotontheinter.net/content/new-images-jf (at bottom of page)
Sweet! great timing JF works like a dream!
Btw, love the new recovery background...I feel seizures coming on...
Stericson
Fantastic! Been waiting for your update, looking forward to it. THanks JF and others who made this possible!
Thanks for the great work!!!
Awesome, thanks!
So what would we need to do to replace the browser with Koush's auto-rotating version and how about replacing the alarm clock with Klaxon?
This is awesome! a little pre 2009 present! thanks JF for all that you do !!!
Just posting to say this update worked a-ok for me. Thanks JF for changing busybox and for the new su.
s0niqu3 said:
Awesome, thanks!
So what would we need to do to replace the browser with Koush's auto-rotating version and how about replacing the alarm clock with Klaxon?
Click to expand...
Click to collapse
Download the build environment for the version you want, extract it, put the klaxon and browser apk into system/ModifiedFiles/system/app, put in a delete entry into system/ModifiedFiles/OriginalFilesToDelete.mk for the alarm apk and odex, then run make as root.
JesusFreke said:
Download the build environment for the version you want, extract it, put the klaxon and browser apk into system/ModifiedFiles/system/app, put in a delete entry into system/ModifiedFiles/OriginalFilesToDelete.mk for the alarm apk and odex, then run make as root.
Click to expand...
Click to collapse
Will this work on windows vista with cygwin as opposed to a full linux VM?
Are there any specific binaries I need to install?
thanks again!
one last comment... love the Alt+B i know B is supposed to be for backup, but in my mind it stands for BADASS!!!!!!
s0niqu3 said:
Will this work on windows vista with cygwin as opposed to a full linux VM?
Are there any specific binaries I need to install?
thanks again!
Click to expand...
Click to collapse
JesusFreke said:
The binaries are for 32bit x86 linux. If you want to run it on a different platform, you're on your own.
Click to expand...
Click to collapse
You might be able to get it to work. You'll need to replace the linux binaries in the tools folder with windows equivalents.
But tbh, you're best bet is to install vmware and get an ubuntu VM running.
Did a quick search and could not find what ADP1 is. Is this the developer version?
JesusFreke said:
In addition to the updates themselves, I am also releasing a build environment that can use to build each update from scratch. You can use these to easily make your own custom updates. It includes some utilities that were built from git source. The binaries are for 32bit x86 linux. If you want to run it on a different platform, you're on your own.
The general idea of the build environment is that it extracts the original files from the official update (or from my original ADP1 update), and then copies over anything from the various ModifiedFiles folders, then packages it all back up into a ready-to-be-applied update.zip. It does this for the boot image, recovery image and system folder. You can also specify files to delete in the various OriginalFilesToDelete.mk files.
Consider anything new that I created for the build environments (the makefiles, etc.) to be in the public domain. Everything else retains its original license of course.
Click to expand...
Click to collapse
I applaud you, sir.
momentarylapseofreason said:
Did a quick search and could not find what ADP1 is. Is this the developer version?
Click to expand...
Click to collapse
ADP1 stands for Android Dev Phone 1.
jashsu said:
ADP1 stands for Android Dev Phone 1.
Click to expand...
Click to collapse
What I figured.... thanks!
JesusFreke said:
You might be able to get it to work. You'll need to replace the linux binaries in the tools folder with windows equivalents.
But tbh, you're best bet is to install vmware and get an ubuntu VM running.
Click to expand...
Click to collapse
Ah, thanks for the confirmation.
Is there anyone out there that can tackle this for me? I'm visiting family through the 5th, and don't feel right installing a linux VM on their computer.
If so, PM me, and I can give you the specifics, but really all I'd like is for the alarm clock to be removed and replaced with Klaxon, and for the browser to be replaced with koush's build that auto-rotates.
This would be for a G1 RC30 build.
Cheers, and thanks in advance!
jashsu said:
I applaud you, sir.
Click to expand...
Click to collapse
I stand.. applauded?
Thanks!
Thanks JF, I just flashed the ADP1 version and it is working great so far.
Have you attempted to add in the MyFaves app to the ADP build? I had tried a couple of things previously, but I was running into some errors. I may try it with your new build environment later if it is something you haven't attempted.
BTW - for those looking for a virtualized Linux environment, I also recommend Sun's Virtualbox (http://www.virtualbox.org/). It is free for personal use and provides a lot of the functionality that you get from the paid versions of VMWare. In fact, some things seem to run smoother when running Linux virtualized on Vista 64bit; i.e. I can get copy/paste between OSes and auto-resizing guest screens without a lot of extra hassle. Just make sure that you read up on how to use the USB virtualization so you can create the filter for the phone as a USB device.
Great work once again JesusFreke!
-Brint
s0niqu3 said:
Ah, thanks for the confirmation.
Is there anyone out there that can tackle this for me? I'm visiting family through the 5th, and don't feel right installing a linux VM on their computer.
If so, PM me, and I can give you the specifics, but really all I'd like is for the alarm clock to be removed and replaced with Klaxon, and for the browser to be replaced with koush's build that auto-rotates.
This would be for a G1 RC30 build.
Cheers, and thanks in advance!
Click to expand...
Click to collapse
You can always do it manually of course. Install the update, then remount the system as rw, then delete the alarm apk and odex and the browser apk and odex from /system/app, and copy the klaxon and modified browser apk to /system/app
JF!!! You... are a scholar and a gentleman... A happy new year to you...
s0niqu3 said:
Is there anyone out there that can tackle this for me? I'm visiting family through the 5th, and don't feel right installing a linux VM on their computer.
Click to expand...
Click to collapse
Couldn't you also use an Ubuntu LiveCD just as easily? That would allow temporary access to a 'nix environment without touching the existing drive, mount one of the partitions temporarily for your make environments. Just a thought...

[ROM] myTouch 3G: Nothing but Netfilter 1.6 - Donut Update

Download link: MT3GV1.5_NBN1.5.zip
MD5:
1c962a4767659f86776fe6daf3052cf7 MT3GV1.5_NBN1.5.zip
This is the result of the work/messing around I did in this thread.
I started with the T-Mobile OTA stock ROM available here:
signed-opal-ota-150449.95700137.zip
I then:
1. Rebuilt the kernel with the same config as the ROM, except with the addition of the netfilter features required for tethering. (Kernel source is slightly newer than in the ROM as yesterday there were a few security related patches added to the repo.) The wlan.ko driver was rebuilt to match the new kernel as well.
2. Added the Superuser app and the Tethering app.
3. Removed the T-Mobile recovery and radio images. They are redundant at best, bricks waiting to happen at worst.
4. Re-packed and re-signed the ROM. (Only the ROM zip was signed so it would install via our recovery images. The internal apks were left alone.)
The result should be an experience identical to the stock software you had out of the box, but with the possibility of running apps that require root as well as tethering. Speed is the same, features are the same, apps are the same, etc.
There are plenty of great custom ROMs here if you're looking for more, but this will work if you're going for simple with no surprises.
UPDATE: Donut /1.6 update is on page 3.
UPDATE: Donut /1.6 DMD64 update is on page 4.
Is this for 32B or 32A?
This is for 32B.
awesome
hey man great job this is exactly what i want!!! great job!!!
atomtom, thank you for doing that. It's been working great the last 24 hours, no hidden gotchas or surprises from the updated kernel/wifi driver.
Thank you!!!...This is EXACTLY what I was looking for ..expecially for my friends who want root for wifi tether!!
Clean and Stock
Thanks for this ROM. I like clean and simple builts and this fullfill my tethering needs with my Viliv S5. I installed it today on MyTouch 3G.
Hi there
I installed this rom last night and by morning the phone was complaining about memory and had a bunch of processes force close.
Is there a mem leak or anything with this rom?
Not that I know of, but I only tested it for a few hours and then went on to Cyanogen for my daily use. Considering how similar this is to the stock ROM I would be very surprised if there was a memory leak.
Standard debugging questions: What SPL and radio are you running? Did you do a wipe before installing? Do you have a log we could look at?
I'll put this ROM back on my phone and see how well it's doing tomorrow.
Noticed an issue. The SU you are using isn't ideal. With tethering it was fine but as soon as I typed Su in terminal emulator, it starts the superuser permissions app, but it comes up blank. If I go back, its stuck waiting for Su permission. Zenthought.org has/had one I used, its from the JF and cyanogen builds. If u decide to use it make sure u change the Su binary too.
atomtom said:
Not that I know of, but I only tested it for a few hours and then went on to Cyanogen for my daily use. Considering how similar this is to the stock ROM I would be very surprised if there was a memory leak.
Standard debugging questions: What SPL and radio are you running? Did you do a wipe before installing? Do you have a log we could look at?
I'll put this ROM back on my phone and see how well it's doing tomorrow.
Click to expand...
Click to collapse
Hi there
I am running SPL 2005 (aman_ra mytouch root guide)
32B radio from htc site for google ion 2.22.19.26I
recovery 1.2.0G (aman_ra)
I have been going back and forth trying to find the rom that works best for me so yes i have done the format/wipe. Also since i want to be sure i might even run the following ontop of the format/wipe
fastboot erase system -w
fastboot erase boot
I dont erase recovery since i dont think i need to.
Please let me know.
Also - I would LOVE it if you could provide the same rom but with HTC keyboard/dialer.
flamingblue8z said:
Noticed an issue. The SU you are using isn't ideal. With tethering it was fine but as soon as I typed Su in terminal emulator, it starts the superuser permissions app, but it comes up blank. If I go back, its stuck waiting for Su permission. Zenthought.org has/had one I used, its from the JF and cyanogen builds. If u decide to use it make sure u change the Su binary too.
Click to expand...
Click to collapse
Yeah, the one that is available stand-alone is older than the one that comes with other ROMs. When I tried installing the newer apk pulled from Cyanogen 4.0.1 it would fail due to the key used to sign the ROM internals.
adb install Superuser.apk:
Code:
159 KB/s (14979 bytes in 0.091s)
pkg: /data/local/tmp/Superuser.apk
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
adb logcat:
Code:
E/PackageManager( 58): Package org.zenthought.android.su has no signatures that match those in shared user android.uid.system; ignoring!
W/PackageManager( 58): Package couldn't be installed in /data/app/org.zenthought.android.su.apk
If anyone knows how to sort this out let me know and I'll update it.
That said, su still worked perfectly when I installed Better Terminal Emulator. (Of course, Better Terminal Emulator doesn't work to begin with. Try typing in a number.)
hmm interesting. when I was using just the stock ROM, then used 1click root, went into CM-recovery, followed by your directions, adb mount -a, then adb push the SU in reference, zenthought's, I had no issue. I then pushed the wlan.ko you put up, and flashed boot.img, rebooted, and finally installed the Superuser.apk, and I had NO issues whatsoever. i've got a nandroid backup of that system setup, in case there is anything of interest in there. I would have to boot back into it and remove my txts/mms/contacts, but i'd gladly share it for analysis.
I noticed the myTouch NBH appeared earlier, im going to try downloading that on my WinMo Wing (it connects to the wifi at the college im at but my G1 and myTouch won't.) i'll try flashing the NBH then your ROM, see what happens... oh and yes, I obviously wiped before installing ur ROM.
ROM has Superuser Permissions and Superuser Whitelist? Whats the difference and are they both needed?
Superuser Whitelist is the name of the apk that manages which app gets root access, su is the command line tool that actually performs the actions requested as root.
speedyls91 said:
Hi there
I installed this rom last night and by morning the phone was complaining about memory and had a bunch of processes force close.
Is there a mem leak or anything with this rom?
Click to expand...
Click to collapse
After last night and today of normal use, and leaving it on overnight, I haven't seen any behavior out of the ordinary.
I spent the last hour or so playing around with the donut update, but there are problems.
I downloaded the COC10 to DRC92 update zip and looked through it. Appears to be a new boot.img, a handful of files, and a bunch of binary patches. I made the following changes:
1. New kernel with the netfilter features enabled, but otherwise same sources and config.
2. Replaced the wlan.ko patch with the full file that goes with the new kernel since the one we're upgrading isn't the original and the patch won't apply.
3. Changed the update script to not try to patch the wlan.ko and skip over the version/key checks.
The update (applied manually via the recovery image) went fine, but there are problems with one of or both of WiFi Tether and Superuser. When attempting to start tethering there is just a general failure error but nothing bad in the log screen. In addition the Superuser app no longer honors the "always yes" setting. There are newer versions of both apps so I'll check those out later tonight/tomorrow.
Wow, doesn't sound good. Maybe leave out Wifi tether? I have been using a better su whitelist app, I think u may want to use it. I am using stock Donut at the moment, runs GREAT, so if I can help this would be great. What I am going to do is load my nandroid backup, clear out some garbage, and if you want I can send u my system.img and u can pick it apart appropriately to take a look at the SU I have along with the whitelist app. Perhaps that will solve the problems.
Wifi Tether is kinda the whole point so leaving it out isn't an option (or rather, having the user install it manually won't help). I think getting the new Superuser app working is a higher priority though. Unfortunately a system image of a stock ROM won't do any good. The problem is that the Superuser app ties in to the system in a way that requires them to be signed with the same key (or a shared key, something I haven't looked in to yet.)
Code:
I/PackageManager( 78): /system/app/Superuser.apk changed; collecting certs
E/PackageManager( 78): Package org.zenthought.android.su has no signatures that match those in shared user android.uid.system; ignoring!
My guess that the system is signed with T-Mobile's production key but Superuser is signed with a test key that is used on the fully custom builds. So it works fine with stock Android, Cyanogen, etc., but not here since I only changed the kernel, not the keys.
Obviously I can't re-sign Superuser.apk with T-Mobile's key so I have to re-sign the system with the test key. Unfortunately I have no idea 1) which file this is specifically, or 2) how to do it even if I knew.
Any suggestions are of course appreciated.
You mentioned that before. But even on the stock COC10 ROM, I pushed THAT su (from the last JF ROM,1.51) into /system/bin and then installed the apk into /data/app and it worked previously. If you wouldn't mind, plz send the new boot.img and I'll try flashing it through fastboot, as well as cm-recovery so I can use the root access adb to push the su into the stock donut. Which spl has fastboot enabled? I'll PM u my email.

[SCRIPT] BarebonesAndroid

Hello everyone! My name is geeksunny and I am fairly new to the community. Been a lurker for a quite a while now but I finally have something to share!
BarebonesAndroid
What it is
What I have here is a Bash script to automate backing up your /system/app directory and then steps through a list of packages offering to remove them from your device. It runs on your Linux PC and uses ADB to interface with your device.
I wrote this for myself to automate the process of trimming my system down after I flash a new ROM. I recently bought a Nook Color and have been flashing CyanogenMod 7 nightlys to it pretty frequently. I also use a Motorola Droid phone and this comes in handy for the same reason on that device as well.
Seeing as how this was written with CyanogenMod 7 in mind, I am not sure how well it will work with other ROMs. I think it would work as it uses generic uninstall commands. It is based off of the packages that come in CM7 so those packages are the only ones considered by this script.
Note: I'm pretty rusty with my Bash scripting and kinda threw this together in my spare time. It may not be the prettiest script in the world but it gets the job done!
Requirements
To use this script you must...
- Be running a Linux/Unix based OS. (I use Ubuntu for my SDK machine. I don't have a Mac and do not know for sure if this will run on OSX.)
- Have ADB set up correctly and talking with your device.
- Have read/write access to your device's /system folder. (Be rooted.)
How to use it
Unzip and run ./BarebonesAndroid.sh in your terminal.
if ./BarebonesAndroid.sh is not executable, run this command:
Code:
chmod 775 BarebonesAndroid.sh
- It will first ask you to confirm that the device is connected and recognized by ADB.
- It will then ask if you want to back up your /system/app directory before removing any packages. If yes, you can specify a directory for the script to back them up to. It will default to ./apkBackup
- After this it will begin ask you one-by-one if you want to remove a given package. Enter Y or N for each package.
- When the script is finish it will reboot your device.
Future plans
I originally wrote this for myself but thought this could be useful to others out there. Right now the requirements aren't all that accessable to the average user (Linux OS with ADB set up). If there is a demand for it, I may write a Windows batch script version, or maybe convert it into a cross-platform command-line application. Let me know what you think of this idea!
I do have a book on Android development and my eventual goal is to turn this in to a native app!
Regarding the script...
- Add support for multiple devices. Right now it asks that you only have one device connected at a time. This is because I haven't had experience with multiple devices hooked up at once. I plan to fix that in the future.
- Add more error checking and failproofing.
- Streamline the experience. Make things a little more graceful than going through a set list one-by-one.
- Sort the apps. Perhaps add categories.
- Check installed packages and only offer to remove them if they are installed.
Thats it! Thanks for looking!
Thanks dude, good work!

[Q] Various android-related queries

I have managed to compile (from source) and install CM7.2 on my HTC dream, but my questions below are related to Android:
1. Is there a way to find out which packages (.apk) were installed on my system and if so, how do I do that?
2. Is there a way to find out each package dependencies (I need to figure out this as I am bent on removing the vast amount of guff installed on the phone - I won't need 90% of this stuff)?
3. Similarly to 2 above - is there a way to look at dependencies of a package not yet installed on my system (i.e. the .apk file)?
4. How do I actually remove a package for good from the system?
5. Similarly to 3 above, how do I actually install a package from within the root system - I know I can do this via adb, but is there a way to do this inside the, say, command line terminal?
6. Is there a way to alter (understand remove) certain program permissions which I could see "granted" to a particular program/package? I know there are various ways to look at these, but I wish to remove permissions I am not happy being granted to that particular program/package.
And one last a bit more advanced query: I would like to build a single package from the source tree and then install the resulting .apk file on my system.
Basically, I will try to upgrade a package with a new revision and add a few patches to the package source of my own before compiling it and building it again.
I usually build the whole lot (all packages + the rootfs image itself) with "mke bacon", but if I want to alter the source and build a single package how do I do that?
I am not very familiar with the Android make system, so I don't want to go heads-first into something and make a real mess of it.
Thanks a lot for any assistance given.
Small addition as apparently I cannot post a reply (too few posts) in this thread: http://forum.xda-developers.com/showthread.php?p=9055790#post9055790
Question to ezTerry (if he is reading this!): the advice given in that post above was absolutely splendid! I followed it religiously and it worked an absolute treat!
There is one exception though - I've LOST all of my IMEI, IMEI SV and Baseband information after applying these fixes. As soon as I installed the radio updates and then installed my newly-compiled kernel + CM7.2 (successfully!) I then checked the above fields from Settings and they were all gone!
After a while, the baseband, IMEI and IMEI SV appeared, but the IMEI and IMEI SV stuff have now different values than what I've had previously (I've had T-Mobile IMEI, now it appears that I was "assigned" O2 IMEI & IMEI SV values - very bizarre!).
Is this something I need worry about and (I don't yet have a sim card, but I plan to get one soon after I fix my phone), more importantly, how the hell do these IMEI numbers appeared on my phone - where did they came from?!
josh36 said:
Small addition as apparently I cannot post a reply (too few posts) in this thread: http://forum.xda-developers.com/showthread.php?p=9055790#post9055790
Question to ezTerry (if he is reading this!): the advice given in that post above was absolutely splendid! I followed it religiously and it worked an absolute treat!
There is one exception though - I've LOST all of my IMEI, IMEI SV and Baseband information after applying these fixes. As soon as I installed the radio updates and then installed my newly-compiled kernel + CM7.2 (successfully!) I then checked the above fields from Settings and they were all gone!
After a while, the baseband, IMEI and IMEI SV appeared, but the IMEI and IMEI SV stuff have now different values than what I've had previously (I've had T-Mobile IMEI, now it appears that I was "assigned" O2 IMEI & IMEI SV values - very bizarre!).
Is this something I need worry about and (I don't yet have a sim card, but I plan to get one soon after I fix my phone), more importantly, how the hell do these IMEI numbers appeared on my phone - where did they came from?!
Click to expand...
Click to collapse
Any takers?
@1 Check out the respective directories, i.e. for system apps /system/app
@2 Trial and Error, or someone might have made such a list for your device already
@3 No simple way, you would have to look through the decompiled code i guess
@4 Remove the apk from the folder (for example /system/app) and reboot your device, after wards you might have to clean up some extra folders, i.e. settings of that app. (you can use SD Maid from my signature for that)
@5 Some can just be installed the usual way, by opening it. Some .apk files have to be put in the system folders, afterswards reboot and the app should be "installed". To put those apps there use a rootcapable file explorer of your choice. To edit /system you will need to remount it as it is read only by default, you can do that through command line, but most good file explorers have an option for that.
@6 Yes thats possible, there was an app to do that, just not sure what it was called... It is very likely though, that those apps will not work correctly or just FC.
For the make system, if you just change a package, and build again, it will most likely just rebuild the changed files. I'm not so sure either though... damn make system can be pretty messy... and get upset real fast if you change something ;-).
Dark3n said:
@1 Check out the respective directories, i.e. for system apps /system/app
Click to expand...
Click to collapse
Yep, that indeed helped - I didn't realise that the .apk files are "intact" and do not behave in the "standard" (in Linux terms) way a "package" behaves - the app is "installed" as soon as .apk is placed in /data/app or /system/app. The PacketManager does the rest on reboot.
It also cleans up the mess "automagically" if I delete .apk file and reboot, which is nice.
Dark3n said:
@2 Trial and Error, or someone might have made such a list for your device already
Click to expand...
Click to collapse
Yeah, that's a real bugger - I can't see a way of finding the dependencies, but I haven't looked properly at "pm" (the Package Manager command line tool) - maybe I could use something there.
Dark3n said:
@6 Yes thats possible, there was an app to do that, just not sure what it was called... It is very likely though, that those apps will not work correctly or just FC.
Click to expand...
Click to collapse
A very simple example will issustrate my point - my calendar application is installed and needs some sort of GOOGLE_MAIL and access to the internet permissions, neither of which I am happy to grant, because 1) I won't be using online calendars; and 2) I won't use (google) mail.
The truth is, I deliberately did not install any google apps as I won't be using any of them - ever!
Now, every time I boot up and look at my log files with logcat I see a bunch of error messages that this application (the calendar) needs a bunch of permissions which do not exist (naturally, as I haven't installed a single google app on my phone).
So, I wish to wipe out these permissions from the calendar so that logcat is not filled with junk every time I start my phone.
As I already pointed out above, there are also some installed apps who are listed to "need" permissions I am not happy to grant - like the internet access to calendar for example (there are more apps, but I think you get the point).
Dark3n said:
For the make system, if you just change a package, and build again, it will most likely just rebuild the changed files. I'm not so sure either though... damn make system can be pretty messy... and get upset real fast if you change something ;-).
Click to expand...
Click to collapse
Yeah, that was my plan B - there must be another - easier - way though.
I wish to update a lot of stuff (I will be recompiling/refreshing existing packages as well as adding new things I developed for "standard" Linux), but with this Android make system I am blind - it is very different to what I am used to in the Linux world.
To top it all off, I can't post in any of the devs forums yet as I do not have 10 posts!
Further to my previous post - I just found out a superb article about stripping out Android and removing unnecessary packages from it - http://wiki.cyanogenmod.com/wiki/Barebones
It lists various dependencies and shows what could be deleted and what cannot be - what I wanted really.
My only remaining problem - at least for now - is the making of specific packages without building the whole image.

[TOOL] SimpleSU v0.7

So.
As i was slowly preparing DSC v2.0 i met a hard decision: what root tool to include
Both Superuser and SuperSU are nice, but quite heavy
I decided to take my own way - rewrite su executable itself to suit my vision:
I've aknowledged that i have not modified my root access list for half a year. I don't need and don't want a separate Java process to control root access. I want a simple way to allow root access for application (via whitelist), but block unwanted (i.e. all not in list). Still, it should allow end-user to install either SuperSU or Superuser.
In short - ideal su solution for myself that should also work good for depersonalized custom ROM (with predefined access list), leaving it to end-user to decide which app he will install for superuser access.
And i didn't find a ready solution, so decided to write my own.
Here it is (attached):
SimpleSU
Simplest and lightest superuser solution (with access control)
How it's done:
Same as usual SU for Linux with control access list read from /system/etc/dsc.su_list
dsc.su_list structure is very simple:
One line per android app (case sensitive), windows and unix line breaks should be supported fine.
Current proposed list for DSC 2.0 (and an example):
dsc.SimpleSU.acl
dsc.settings
dsc.uv
dsc.levels
dsc.mugen
jackpal.androidterm
ru.org.amip.ClockSync
eu.chainfire.supersu
eu.chainfire.supersu.pro
com.ryosoftware.adbw
com.googlecode.droidwall.free
com.noshufou.android.su
de.schaeuffelhut.android.openvpn
de.schaeuffelhut.android.openvpn.installer
com.elsdoerfer.android.autostarts
com.speedsoftware.rootexplorer
com.geeksoft.screenshot
com.rerware.android.MyBackupPro
com.ghostsq.commander
ws.plattner.cifsmanager
mobi.pruss.superdim
com.force.timezonefixer
com.bigtincan.android.adfree
Caller process tree is walked till init, if match is found, access is granted.
How to install?
Via adb shell:
Code:
adb push su /system/xbin/
adb shell chmod 6755 /system/xbin/su
adb push dsc.su_list /system/etc
adb shell chown root.root /system/etc/dsc.su_list
adb shell chmod 644 /system/etc/dsc.su_list
Note that you have to manually add entries to white list (/system/etc/dsc.su_list) to grant root access in form of app full Java class name. For example, it's com.keramidas.TitaniumBackup for Titanium Backup.
As pointed by dr911, works in multiuser environment (being a linux binary).
Currenly SimpleSU supports two command formats:
Usual: su -c 'make me a sandwich'. Note that only "-c" works now. Seems to be enough though. Command simply passed to the shell.
Legacy (as seen in Google/Android su source): su username make me a sandwich. Shell is not executed in this case, so no environment variables right now in this format.
Have fun,
Sergei.
Changelog:
02.04.2013: v0.7. ":service" suffix granted root access for already granted app, more logging on reject. (0.6 had only more logging)
27.11.2012: GUI updated - forgot about remounting /system in rw mode. Attached to this post.
21.11.2012: GUI done. http://forum.xda-developers.com/showpost.php?p=34439975&postcount=41
14.11.2012: v0.5. LD_LIBRARY_PATH fixup (taken from ChainsDD), pointed by Rupert Rawnsley. Also some legacy format command-line handling changed. Also, insecure version added (no checks made, asked=granted).
11.11.2012: v0.4. Code cleanup, no longer beta, revised and fixed code with potential string overflows.
09.11.2012: v0.3b. Code changed to allow legacy format command execution.
09.11.2012: v0.2b. Fixed call with multiply parameters. OpenVPN installer works. Dynamic linking, so very small binary. Logging to system log.
07.11.2012: Fixed segmentation fault on reject, added version and build date, removed debug info.
A request:
If somebody owns Pro/Elite/other commercial Superuser or SuperSU - would you provide it's full Java class name?
For example, it's
eu.chainfire.supersu
com.noshufou.android.su
for free versions.
eu.chainfire.supersu.pro
Sent from my Amazon Kindle Fire using Tapatalk 2
Can I avoid these little delays (the appearing popup of SuperSU or Superuser) with this alternative?
And if I have Superuser preinstalled can I delete it and are there other files which belongs to it and can be deleted?
Thank you for sharing your work
com.noshufou.android.su.elite for Superuser Elite
Hi
Have you noticed any improvement in terms of speed etc? Is superuser really that heavy? How much RAM can i get by using this and ditching the superuser app? We can use this in our Galaxy 3 forum !
Get the list of all android activities from here
http://activities.droidicon.com/
Androidmarketuser said:
Can I avoid these little delays (the appearing popup of SuperSU or Superuser) with this alternative?
And if I have Superuser preinstalled can I delete it and are there other files which belongs to it and can be deleted?
Thank you for sharing your work
Click to expand...
Click to collapse
Delete system/xbin/su and uninstall your superuser app from the system.
Oh. Looks SimpleSU got in news
Androidmarketuser said:
Can I avoid these little delays (the appearing popup of SuperSU or Superuser) with this alternative?
And if I have Superuser preinstalled can I delete it and are there other files which belongs to it and can be deleted?
Thank you for sharing your work
Click to expand...
Click to collapse
You won't experience any delays - but in cost of manually editing the list. And no popups, it's simply a linux binary. After replacing su binary you may uninstall Java part.
Shree_Jamdar said:
Have you noticed any improvement in terms of speed etc? Is superuser really that heavy? How much RAM can i get by using this and ditching the superuser app? We can use this in our Galaxy 3 forum !
Click to expand...
Click to collapse
I did experience lags when using Superuser and SuperSU. I don't think modern device would benefit from SimpleSU. I expect to free 15-20MB. Good for Streak with 512MB.
I may eventually write a list editor, but most probably won't.
Again, this tool would do as preinstalled SU solution in Custom ROM (though i can't test >2.3 compatibility):
Grant predefined (and included in ROM) apps the superuser rights.
Allow end-user to choose and install he's preffered SU solution right from Play Store.
--
Have fun,
Sergei
_n0p_ said:
You won't experience any delays - but in cost of manually editing the list. And no popups, it's simply a linux binary. After replacing su binary you may uninstall Java part.
I did experience lags when using Superuser and SuperSU. I don't think modern device would benefit from SimpleSU. I expect to free 15-20MB. Good for Streak with 512MB.
I may eventually write a list editor, but most probably won't.
Again, this tool would do as preinstalled SU solution in Custom ROM (though i can't test >2.3 compatibility):
Grant predefined (and included in ROM) apps the superuser rights.
Allow end-user to choose and install he's preffered SU solution right from Play Store.
--
Have fun,
Sergei
Click to expand...
Click to collapse
Exactly what I searched, thanks :good:
I will test it on my old Desire with Android 4.1, I can tell you whether it's compatible or not.
nice tool...very lite. i m using this in extreme barebone roms for my galaxy mini. really nice, but the problem is only some apps r being granted permissions, some denied.
i hope u increase the list of activities. then this is a hit for me
good luck..
Android_United said:
nice tool...very lite. i m using this in extreme barebone roms for my galaxy mini. really nice, but the problem is only some apps r being granted permissions, some denied.
i hope u increase the list of activities. then this is a hit for me
good luck..
Click to expand...
Click to collapse
Can you provide an example of app you have added to the access list, but it didn't work?
i looked in the op and still dont understand how to install?? flash the simple SU zip in recovery.. then what???
evo401 said:
i looked in the op and still dont understand how to install?? flash the simple SU zip in recovery.. then what???
Click to expand...
Click to collapse
if you couldnt read/understand the OP, then your probably better off sticking with SuperSU or SuperUser...
Heres my non-developer understanding (potentially flawed):
Its a binary, with manual entry's (IE text editing) of pre-approved apps, it doesnt have a frontend/gui like SuperSU or SuperUser which allow you to graphically chose what to allow and what to deny...
OP: I like it so far, as for your thoughts on a graphical editor, I for one would love to see one, and before I get jumped for saying then whats the difference between the other options, an editor would be short and sweet, open, edit list, close, ram once again free (since that is the concern), instead of having it stay resident in RAM...
On that note, if I may, there are tools like Rays Toolbox and Android Tuner (formerly system tuner), that I would like to put in a feature request for them to add an editor in the app (Android Tuner already has a few editor's, adding a SimpleSU editor would just add to the overall completeness of the toolkit) to edit the list for SimpleSU, with your permission of course!
Thanks again!
Latest version working on Galaxy fit !!! It really imporves performance on low ram(We got 256mb) devices maybe OP might consider sharing it by moving thread to a more general location on xda rather than on a device forum my thoughts.
Dark Passenger said:
Latest version working on Galaxy fit !!! It really imporves performance on low ram(We got 256mb) devices maybe OP might consider sharing it by moving thread to a more general location on xda rather than on a device forum my thoughts.
Click to expand...
Click to collapse
Yes, exactly.. it works on galaxy y duos and galaxy yseries.. its better to move it to android app development section may be? as it will get more support there i feel.. Please do consider op.. And thanks for this cool app.. Its awesome. And i dont think it needs an editor, as we can have editors from many apps .. i have around 4-5 apps which has editors.. surely users who use this app will be bit advanced users..
and i bet all of them will have file editors.. and all file explorer apps comes with editors nowadays.. well , just my thoughts.. but if you can keep the file browser to bare minimum and keep size of apk less.. then i would surely like to see it too
i am hoping to use this from now on.. so i will give review for new updates.. have you pushed it to play store? i think you should do that.. many will like this idea!
Thanks again..
As far as i understood we can edit it to add new apk names to give permission.. Because Android_united kinda confused me.. So, asked this again.. i did use it and it did worked.. its just may be he didnt see that?
Works like a charm! The only problem I had is that I was doing this through Terminal Emulator, and for some reason, when i did all this, superuser perrmisions were not granted for Terminal Emulator. After a little digging i found that i have to add this line
Code:
jackpal.androidterm2
and leave the one that's there by default
Code:
jackpal.androidterm
to the dsc.su_list
Now it works, i have SU for Terminal Emulator, Adfree, and i added SetDNS (Impossible to use Google play on CM7.2 without it )
I like the idea of this but be extra careful to only whitelist activities you really use.
I could imagine a malware somehow managing to enter your system and masquerading as one of the prepopulated entries in dsc.su_list, though of course no such vulnerability exists so far.
Thank you for feedback.
--
I cannot publish it on Play Store - it's not an Android app. To publish it, i need to write SimpleSU Installer, or something like that (see below).
--
Regarding editor - it would be nice if someone else would write it I really don't expect to have enough free time required.
--
A 0.4 version i consider as stable (revised potentially bad code with possible string overflows) attached to first post.
--
Malware that could act as Java class - i thought of several scenarios, but any requres root access beforehand. And if you install an app - it's your responsibily to be careful.
--
Have fun,
Sergei
_n0p_ said:
Can you provide an example of app you have added to the access list, but it didn't work?
Click to expand...
Click to collapse
titanium backup, es-file explorer. i tested wit only these 2. as these 2 weren't gaining root access, so i stopped using this. if u want me to test wit more apps, i can help u out.
will be using this surely once it receives more updates :good:
:good: gud luck..

Categories

Resources