Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Busybox download utility #35

Open
bkensey opened this issue Apr 16, 2013 · 8 comments
Open

Busybox download utility #35

bkensey opened this issue Apr 16, 2013 · 8 comments

Comments

@bkensey
Copy link

bkensey commented Apr 16, 2013

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
Copy link

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
Copy link
Author

bkensey commented Jun 5, 2013

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
Copy link
Author

bkensey commented Jun 5, 2013

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
Copy link

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
Copy link

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

@bkensey
Copy link
Author

bkensey commented Oct 30, 2013

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
Copy link

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

@bkensey
Copy link
Author

bkensey commented Oct 30, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants