Toolify / Backbone

A new file manager for Android 4.0+
Other
2 stars 3 forks source link

Busybox download utility #35

Open bkensey opened 11 years ago

bkensey commented 11 years ago

For when the user's phone is rooted but does not come pre-built with the standard xbin commands like those found in CM. The utility should only prompt the user to download busybox if the user enters root mode. I have no idea what the app currently does on non CM devices. Either crash or default to its internal Java operations console.

BrandoCommando commented 11 years ago

Any Android build should have the basics such as ls, cp, rm, which is all the app really needs. Sometimes the arguments differ. Detecting busybox is relatively easy. The latest RootTools repo from stericson has some simple methods for doing just that.

bkensey commented 11 years ago

The app uses several commands above and beyond the basics. Some of those are exclusive to the priviliged console, and some are used by both. I want to allow the user to download the full list of required commands to the appropriate system files, which would help out a lot of rooted oem phone users.

A full list of used commands can be found here: https://github.com/bkensey/Backbone/blob/gradle-test/res/xml/command_list.xml

bkensey commented 11 years ago

I should add that the problem isn't recognizing the existence of those commands. That is something the app already does, and if they are not present it will fall back to the java console from the various flavors of the shell console. We need the download utility to ensure that non-ROM users can use the shell console.

BrandoCommando commented 10 years ago

Ok, so I'm thinking we can offer a simple download/install of busybox when we find that it's not installed. Upon confirmation, we: 1) Check /proc/cpuinfo, grab the processor type 2) Download the corresponding binary of busybox over at http://busybox.net/downloads/binaries/latest/ 3) Request root (despite Safe mode being "on", we need this for the next step) 4) Remount system partition as RW 5) Copy downloaded binary to /system/xbin 6) Remount system as RO 7) Notify user 8) Call back to BB to say Busybox is installed

The only concern I have is symlinking all of the functions to busybox. I'm not sure if we should try doing that, as that may be out of the scope of our app. Also, I think we explicitly call busybox when needed (i.e. "busybox stat -f ").

BrandoCommando commented 10 years ago

Actually, it looks like "uname -m" gives a much better result than /proc/cpuinfo.

bkensey commented 10 years ago

Would there be any way to just download the needed commands instead of relying on the busybox package? These being the required commands: /system/bin/cat, /system/bin/chmod, /system/bin/chown, /system/bin/dd, /system/bin/df, /system/bin/gzip, /system/bin/id, /system/bin/kill, /system/bin/ln, /system/bin/ls, /system/bin/mkdir, /system/bin/mount, /system/bin/mv, /system/bin/ps, /system/bin/rm, /system/bin/sh, /system/xbin/awk, /system/xbin/bunzip2, /system/xbin/busybox, /system/xbin/bzip2, /system/xbin/cp, /system/xbin/cut, /system/xbin/dirname, /system/xbin/echo, /system/xbin/find, /system/xbin/grep, /system/xbin/groups, /system/xbin/gunzip, /system/xbin/pwd, /system/xbin/readlink, /system/xbin/stat, /system/xbin/su, /system/xbin/tar, /system/xbin/xargs, /system/xbin/md5sum, /system/xbin/sha1sum

BrandoCommando commented 10 years ago

Sure, but that would ultimately be a messier way to do it. Also, I'm pretty sure Backbone looks for BusyBox specifically.

bkensey commented 10 years ago

I see what you mean when you say it might be outside the scope of our app. I guess the question comes down to whether we're stepping on any other app's toes if we do all of that for the user, and whether any other apps even make use of that full set of commands like we do.