Prepare Your Nokia X2 for Battle with Nokia X2 Tools

Unveiled in June this year, the Nokia X2 is the Finnish companys second crack at an … more

Increase the Speaker Volume of Your Samsung Gear 2 with Tool and Tutorial

I think its pretty safe to say that any sound coming out of a … more

Unlock Hidden Camera Settings on Your Moto G

At one point in time or another, weve all gotten very fiddly with the camera settings on our … more

XDA Partners with LG for Developer Challenge

Many Android enthusiasts know the name LG. LG is the maker of some Google Nexus devices and some … more
Post Reply

[RECOVERY/BOOTSTRAP]Tweaked Safestrap v2.00a (ICS Leak) 06-13-2012

14th June 2012, 11:34 PM   |  #1  
OP Senior Member
Flag Victoria
Thanks Meter: 123
 
172 posts
Join Date:Joined: Mar 2009
More
************************************
************************************

Note: Please uninstall Hashcode's Safestrap before you try installing this one. To accomplish this properly, you have to do two things:

1. Open up the Safestrap app from your launcher, and choose "Uninstall Recovery". Let it finish. It'll tell you whether or not it worked.

2. Then, go to Settings - Apps and find Safestrap. Click "Uninstall".

************************************
************************************

Installation of this app requires root privileges. If the installation does
not work, it is likely because you either:

a) don't have busybox installed.

b) you do have busybox installed but it doesn't have the functions we
need.

No problem. Just do this through adb or a terminal on the phone:

Code:
$ su
# mount -o remount,rw /system
# cp /system/xbin/busybox /system/xbin/busybox.old
# cp /data/data/com.hashcode.droid4safestrap/files/busybox /system/xbin/
# chmod 755 /system/xbin/busybox
# exit
Now it should work without a hitch.

************************************
************************************

Those of you who came from the Droid 3 might remember my customized version of Hashcode's Safestrap, which included a console, improved user-interface, non-safe flashing, etc.

I've finally got it to the point where I think it would be okay to release out in the wild. That being said, I'm not responsible for anything dumb you do to your own device.

I wouldn't bother using the non-safe flashing capabilities yet, seeing as how there hasn't really been any official releases using the new ICS kernels that have been leaked as of late. This feature is handy if you're a developer testing out update.zips for /systemorig, but for the average person you'd best pay heed to the warnings and just use Safestrap as it was originally intended; that is, leaving your /systemorig partition intact and only mess around with your "safe" /system. (Or /preinstall, actually, but that's not really important.)

The console is beyond useful. Editing build.prop settings on the fly without having to boot up and do it in a terminal emulator or via adb on the phone is much easier. If you know what you're doing, you can even extract single files from your old backups, modify your old backups, etc. That's just a small fraction, but those of you who would care about this functionality don't need me to say how important it can be.

I've included statically compiled versions of "bash" and "vim" so that there aren't any dependencies on the libraries usually found in /system/lib. Thus, you can use all of these utilities without having either /system or /systemorig mounted. You're free to add your own binaries in your home folder, which is located at /cache/.safestrap/home, or just pop them onto your sdcard.

Also, I have a battery monitor running so it will tell you what level your battery is at, and have put a lot of work into the visual appearance of the user-interface. There are so many things I've modified that it would be impossible for me to list them all here.

Anyways, try it out and let me know what you guys think. I hope you like it!

For those of you who are interested, I always post my sources on Github. You can find my code repositories here:

https://github.com/buddyrich

The .APK can be downloaded from my DropBox via the link below:

http://db.tt/tZdmUHl1
Last edited by Rick#2; 15th June 2012 at 10:43 PM.
The Following 3 Users Say Thank You to Rick#2 For This Useful Post: [ View ]
14th June 2012, 11:40 PM   |  #2  
OP Senior Member
Flag Victoria
Thanks Meter: 123
 
172 posts
Join Date:Joined: Mar 2009
More
=========================
RECOVERY MENU REFERENCE
=========================

Select Highlighted Item - Enter or Power

Scroll Up - Volume Up or Left Arrow
**Note: The Left/Right Arrow keys may sound weird but since the menu is displayed in portrait mode, it just feels like you are pushing Up/Down.**

Scroll Down - Volume Down or Right Arrow

Direct Menu Selection - Hit the corresponding number/letter at the beginning of each menu item.
**ie: from the main menu, hit "6" to jump to the advanced menu.**

Go Back / Cancel - Caps Lock

===================
CONSOLE REFERENCE
===================

Keys:
--------------------
Tab - Tab
** Note: The Tab key is your best friend when using bash. It will auto-complete file/directory names for you, or list out the possible choices if you double-tap it after entering a few letters.

SYM - Alt

Shift - Shift

OK - Control

Caps Lock - ESC

OK+Shift - Toggle Caps Lock

OK+SYM - Toggle Alt Lock
** Note: The LED beside the Caps Lock button will illuminate when either Caps Lock or Alt Lock is enabled.

OK+Backspace - Force exit

OK+A - Home

OK+E - End

OK+C - Stop current process, ie: if a program you are running chokes up.

=========================

bash Commands:
--------------------

Here are a few of the more useful bash commands that you will use:

===========
ls, ls -a, ls -l, ll
===========

Code:
/ {}$ ls
- "ls" lists the files and directories within the current directory.
- You can also add a path after it to look for certain files or directories.

Code:
/ {}$ ls -a
- "ls -a" will list all files and directories, including hidden ones starting with a ".", ie: .bashrc in /cache/.safestrap/home. (The bash startup script).

Code:
/ {}$ ls -l
- "ls -l" will do a long listing, showing permissions, file sizes, etc.

Now, instead of using those parameters, I've made aliases within the .bashrc script so you will probably just want to type:

Code:
/ {}$ ll
- "ll" is an alias for "ls -a -l", so it will list all files/directories, hidden or not and list their properties.

Code:
/ {}$ ll
- By putting a path after "ll", it will single out the file. Add a "*" in there to act as a wildcard to list multiple files with the same first few characters.

- ie: "ll /system/lib/libc*" would display all the files and directories starting with "libc" within /system/lib as well as their properties.

========
cd
========

Code:
/ {}$ cd (path)
- Change directory. Pretty self-explanatory. Try doing:

Code:
/ {}$ cd ~/
- This takes you to the home folder. Pretty useless here but this is usually pretty handy in other scenarios.

Code:
/ {}$ cd ../
- Using "../" as your target will cause you to drop down a single directory in the tree.

**** Don't forget to hit tab to auto-complete directory/file names for you whenever you've already entered the first few characters. More accurate and much less typing. ****

=======
mv
=======

Code:
/ {}$ mv (source) (destination)
- "mv" is short for move. The source is the path to the file/directory you want to move, and I don't think i need to tell you what the destination is.

=======
rm
=======

Code:
/ {}$ rm (-r -f) (target)
- "rm" is used to delete the targetted files.
- "-r" means to recurse, or go into every inner directory automatically, erasing as it goes.
- You'll use the -r flag a lot, because you can't delete directories without it unless you use "rmdir", which is just more typing.
"-f" means force in case of permission errors, as long as you are root.

========
cp
========

Code:
/ {}$ cp (-f -a) (source) (destination)
- Copy the source file or directory to the destination.
- Use "-f" to force the copying, in the event of a potential overwrite.
- Use "-a" to maintain permissions of the original, you'll want to use this whenever you are copying anything important. I just use it all the time, but sometimes it won't work, such as when copying from an /sdcard to either the /system or /data partition.
-This is because the file system of your /sdcard doesn't care about permissions.

=========================


============
[VIM REFERENCE]|
============

Vim deserves, and has, entire websites devoted to it's use. Here are some of the basics.

------------
Using Vim|
------------
From the console, simply type:

Code:
/ {}$ vim
Where is obviously replaced by the name of the file you are editing.

Multiple files can be opened at once by just adding them as parameters to vim:

Code:
/ {}$ vim file1 file2 file3 file4 filen
---------------
Insert Mode |
---------------
This is the mode you want to be in to make any visible changes to the file you are editing.

- Enter Insert Mode by pushing "i" when vim opens.

- Exit Insert Mode by pushing Capslock.

Keys:
------
Backspace - In insert mode, deletes the previous character.

Capslock - Exits insert mode

---------------
Visual mode |
---------------
By typing in "v" instead of "i", you will enter visual mode; this is Vim's fancy way of saying you will be selecting text.

Keys:
------
- Copy or Cut text by hitting "y" or "d" after you've made a selection

- Paste with "p" or "P" (that is, Shift+p). Shift-"p" puts the text before the cursor whereas plain lowercase "p" will paste it after.

- When you're done highlighting what you want to either cut or copy, just hit Capslock to go back to Command Mode.

-------------------
Command Mode |
-------------------
Vim starts out in Command mode. It seems confusing but once you get used to it, you can't help but hate Notepad.

Some of the more common commands are listed below.

Keys:
------
u - Undo

Shift+r (Usually denoted as R) - Enter Replace Mode, where you are replacing text instead of inserting it.

[#]yy - Yank (copy) the current line if you just entered "yy", or copy "#" lines if you enter #yy, ie: 5yy to copy 5 lines.

[#]dd - Delete (cut) the current line, or delete # lines if preceded by a #.

p - Pastes after the cursor

Shift+p (usually denoted as P) - Pastes before the cursor

:[#] - (Ignore the square brackets; a colon followed by a number goes to that particular line in the text file you are editing. eg: ":5" goes to line 5. (Obviously, don't type the quotation marks in.)

Note: - If you are in Insert mode, you will have to push Capslock to exit and be allowed to enter Command Mode by entering a ":"
- It's fairly common practice to just hit Capslock twice whenever you're done inserting so that you are sure to be able to hit ":" and proceed to enter another command.

:w - Write (save) the currently open file.

:q - Quit. If you haven't saved since making any changes, it will prompt you to either save your changes or append a "!" after "q" to quit without saving. (See below)

:q! - Force quit without saving.

:wq - Save and then quit.

:e [path to filename] Opens up another file; you can use bash command-line completion to scan the current directory, or otherwise just enter another path.

:next or rev - Aptly named, move to the next or previous file if you opened vim with two or more files as parameters, ie:

Code:
/ {}$ vim file1 file2
:/[text] - Search for "text". ie: ":/search" will find instances of the text "search" in the current file and highlight them.

Note: You need to make sure you are aware of regular expressions/escape characters before using this reliably; it's not broken if you can't seem to search for a quotation mark or other special characters, you need to precede them by a \. ie: to look for a double-quote symbol " you would enter :/\". The \ tells it that the next character is meant to be taken literally and not symbolically.

:/[text]/[moretext]/gc - Replace "text" with "moretext" everywhere in the file and ask confirmation for each change. If you forget to type in the "gc" at the end, it'll just replace everywhere without asking you for confirmation.

That's all I'm going to put here. There are tons of guide out there and I've already preloaded a pretty awesome configuration (.vimrc located at /cache/.safestrap/home) and runtime files. If you want to quickly access the configuration file, you can type ",,e" in Command Mode and it will automatically pop open.

================
COLOR CHANGING
================

1. If you want to change the color scheme, you need to figure out what the RGB code for the color you want is. Here's a website that provides a large table of colors and their corresponding RGB color code:

http://web.njit.edu/~kevin/rgb.txt.html

For example, let's say we like the "SlateGray4" color from the table linked above want to use it for the menus in both Safe and Non-Safe mode. As you can see, in the "R;G;B; Dec" column, the three codes we are interested in are 108, 123 and 139.

2. Now that you know the color codes, in our case 108, 123 and 139, we simply do the following:

a) Push 7 from the main menu, or scroll down and select "console menu".
b) Push 1, or scroll down and select "open console"

(Don't panic if it takes a few seconds to load the console; on the first initialization or after wiping the /cache partition, it will take a few seconds to reconfigure itself.)

c) At the prompt, enter the following:

Code:
/ {}$ ns_rgb 108 123 139
/ {}$ s_rgb 108 129 139
/ {}$ cc
/ {}$ exit
Now, it'll take another second or two and when the menu pops back up, you'll see that it is the color we chose from the table. The "ns_rgb" command takes three parameters, each of which correspond to the R, G and B values of the color code, and uses them for the "Non-Safe" (hence the "ns") menu color.

Similarly, the "s_rgb" command, (well technically, it's a bash function but anyways...) takes the same three parameters. It is applied to the "Safe" menu color.

The "cc" command actually sets the color, so don't forget to enter it. Otherwise, you won't notice a change when you exit out from the console.

Feel free to experiment with different colors! If you don't what you've done and just want to reset it back to the way it way, just wipe the cache partition:

a) Push 3, or scroll down to "wipe menu".
b) Push 1, or just hit Enter on "wipe cache".
c) Confirm your selection by pushing 8 or scrolling down and selecting "yes - wipe cache".

=================================================

More to come as I have more time.
Last edited by Rick#2; 15th June 2012 at 12:55 PM.
15th June 2012, 01:36 AM   |  #3  
Recognized Contributor
Flag Toronto
Thanks Meter: 239
 
889 posts
Join Date:Joined: Sep 2011
Donate to Me
More
Awesome, just a couple questions:
1) where is the dropbox download
2) if I already have the hashcode safestrap installed, how does one install yours? And what happens if I am already running a custom ROM?

Sent from my XT894 running ICS
15th June 2012, 02:02 AM   |  #4  
OP Senior Member
Flag Victoria
Thanks Meter: 123
 
172 posts
Join Date:Joined: Mar 2009
More
Good call, I should make that clear.

Make sure you uninstall Hashcode's Safestrap, both inside the app and from the Android Settings menu before you install this .APK.
15th June 2012, 07:47 AM   |  #5  
Senior Member
Thanks Meter: 64
 
314 posts
Join Date:Joined: Sep 2008
More
- download the pimped apk, uninstalled safestrap recovery, uninstalled old safestrap
- installed pimped safestrap, install new safestrap recovery, reboot

looks fine :)

anyone who restorerd a full backup of ics leak with safestrap 2.0?
friend got a problem, and system was unbootable and lost root....
15th June 2012, 08:44 AM   |  #6  
OP Senior Member
Flag Victoria
Thanks Meter: 123
 
172 posts
Join Date:Joined: Mar 2009
More
Yeah, I've done it about four times today. No problems using either my modified version or Hashcode's original Safestrap v2.00.

It was no problem recovering from a busted /system partition either; just fastbooted the /system and /preinstall partitions only from the .219 leak, then rebooted the phone into the stock recovery and re-applied the .208 leaked update .zip file. Re-rooted with the technique I posted the other day without a hitch.

Didn't even lose any data... :P
15th June 2012, 08:50 AM   |  #7  
Senior Member
Thanks Meter: 50
 
312 posts
Join Date:Joined: Apr 2008
Quote:
Originally Posted by Rick#2

Yeah, I've done it about four times today. No problems using either my modified version or Hashcode's original Safestrap v2.00.

It was no problem recovering from a busted /system partition either; just fastbooted the /system and /preinstall partitions only from the .219 leak, then rebooted the phone into the stock recovery and re-applied the .208 leaked update .zip file. Re-rooted with the technique I posted the other day without a hitch.

Didn't even lose any data... :P

I mean full restore in safestrap, not advanced restore.
After restore from systemorig cames an "error while restoring systemorig!" And system damage.

...Tapatalk
15th June 2012, 01:01 PM   |  #8  
OP Senior Member
Flag Victoria
Thanks Meter: 123
 
172 posts
Join Date:Joined: Mar 2009
More
Quote:
Originally Posted by Rennert

I mean full restore in safestrap, not advanced restore.
After restore from systemorig cames an "error while restoring systemorig!" And system damage.

...Tapatalk

I'm not following you here, this happened to you using my version?

I've done it countless times while testing this before I released it and have been working with this code for a long time; it's pretty foolproof.
15th June 2012, 01:17 PM   |  #9  
Senior Member
Thanks Meter: 50
 
312 posts
Join Date:Joined: Apr 2008
Quote:
Originally Posted by Rick#2

I'm not following you here, this happened to you using my version?

I've done it countless times while testing this before I released it and have been working with this code for a long time; it's pretty foolproof.

No, this was tested with hashcodes safestrap. Restore in your version doesn't tested, but not need at time;)

...Tapatalk
17th June 2012, 09:56 PM   |  #10  
Member
Thanks Meter: 11
 
58 posts
Join Date:Joined: Feb 2008
Having some issues with getting safestrap installed in the 208 ICS leak. The app installs fine, click install and it says install complete, but I have no safestrap. Even after a reboot it still says "Not Installed" in the safestrap app. Anyone else experiencing this issue?

Sent from my DROID4 using Tapatalk

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes