[TOOL][WIP] nandroid-mobile recovery for SGY - Galaxy Y GT-S5360 General

guys,
this 2009 vintage script is too cool to not have it on SGY.
it's an advanced BACKUP / RESTORE nandroid system shell script.
we needa kinda recompile this stuff
http://forum.xda-developers.com/showthread.php?p=3736979
download
# nandroid v2.1.1 - an Android backup tool for the G1 by infernix and brainaid
# restore capability added by cyanogen
# pensive modified to allow to add prefixes to backups, and to restore specific backups
# pensive added the ability to exclude various images from the restore/backup operations, allows to preserve the newer
# recovery image if an older backup is being restored or to preserve user data. Also, saves space by not backing up partitions which change rarely.
# pensive added compressing backups and restoring compressed backups
# pensive added fetching system updates directly from the web into /sdcard/update.zip
# pensive added moving *update*.zip from /sdcard/download where a browser puts it to /sdcard/update.zip
# pensive added deletion of stale backups
# Requirements:
# - a modded android in recovery mode (JF 1.3 will work by default)
# - adb shell as root in recovery mode if not using a pre-made recovery image
# - busybox in recovery mode
# - dump_image-arm-uclibc compiled and in path on phone
# - mkyaffs2image-arm-uclibc compiled and installed in path on phone
# - flash_image-arm-uclibc compiled and in path on phone
# - unyaffs-arm-uclibc compiled and in path on phone
# - for [de]compression needs gzip or bzip2, part of the busybox
# - wget for the wireless updates

SS please
mai77 said:
guys,
this 2009 vintage script is too cool to not have it on SGY.
it's an advanced BACKUP / RESTORE nandroid system shell script.
we needa kinda recompile this stuff
http://forum.xda-developers.com/showthread.php?p=3736979
download
# nandroid v2.1.1 - an Android backup tool for the G1 by infernix and brainaid
# restore capability added by cyanogen
# pensive modified to allow to add prefixes to backups, and to restore specific backups
# pensive added the ability to exclude various images from the restore/backup operations, allows to preserve the newer
# recovery image if an older backup is being restored or to preserve user data. Also, saves space by not backing up partitions which change rarely.
# pensive added compressing backups and restoring compressed backups
# pensive added fetching system updates directly from the web into /sdcard/update.zip
# pensive added moving *update*.zip from /sdcard/download where a browser puts it to /sdcard/update.zip
# pensive added deletion of stale backups
# Requirements:
# - a modded android in recovery mode (JF 1.3 will work by default)
# - adb shell as root in recovery mode if not using a pre-made recovery image
# - busybox in recovery mode
# - dump_image-arm-uclibc compiled and in path on phone
# - mkyaffs2image-arm-uclibc compiled and installed in path on phone
# - flash_image-arm-uclibc compiled and in path on phone
# - unyaffs-arm-uclibc compiled and in path on phone
# - for [de]compression needs gzip or bzip2, part of the busybox
# - wget for the wireless updates
Click to expand...
Click to collapse
can you give the ScreenShoots result sir ???

not yet.
depends on whether above script is better than CWM or not.

Related

[SCRIPT] changelist - Firmware changelist generator

I've created a small *nix shell script which tries to generate a nicely formatted list of changes between the /system portion of two firmwares. It also produces a 'diff' file containing the changes between text files it encounters.
It tries to present the information in a compact way, keeping the most pertinent information (like changes in build.prop/default.prop) on top. File changes are grouped together by directory, again keeping additions and deletions on top, followed by modifications.
You can see some example output in this thread
The script requires a few utilities to be available: grep, fmt, diff, filterdiff and interdiff.
grep and fmt are probably available on any *nix system, diff is part of the basic development package set.
filterdiff and interdiff are part of the 'patchutils' package in Debian and Ubuntu.
On Ubuntu you can install the dependencies with:
$ sudo apt-get install diffutils patchutils
To use the changelist script, simply run it with two directories into each of which you have extracted a factoryfs.rfs from the corresponding firmware, e.g.:
$ # Extract I9000XWJPI's factoryfs.rfs into I9000XWJPI/system
$ # Extract I9000XWJS3's factoryfs.rfs into I9000XWJS3/system
$ # then run
$ ./changelist I9000XWJPI I9000XWJS3
The script will produce two output files in the current directory, in this example they are:
I9000XWJPI-I9000XWJS3.txt (containing the formatted changelist)
I9000XWJPI-I9000XWJS3.diff (containing the textual changes in 'diff' format)
I hope you like it, please post any suggestions, bugfixes etc., in this thread.

Maybe this can help for rooting the new sbf

1. How can I root my phone?
1.1 General information/Basic adb-commands
Rooting a phone enables you to do things, which normally aren't possible for the average user like:
- Removing apps which were preinstalled by the provider (like Orange, Vodafone, etc.). My Tattoo had Vodafone apps for buying music and other sh*t, which was installed on the system partition (to which a "normal" user has no rights to write to, including deleting).
The Tattoo was successfully rooted by a bunch of guys here, namely -bm-, mainfram3 and Coburn64 (maybe, I don't remember quite correctly ). Also the Tattoo was the first phone having a security mechanism hindering a user to mount the filesystems as read/write, which had to be overridden by remapping the read only memory region to a read/write one. This is done by the module Tattoo-hack.ko, also made by mainfram3. He also created the first boot.img, which enabled su directly from adb and loading Tattoo-hack directly from boot on.
A few words about adb:
ADB is a tool for communicating from the PC with the mobile phone. For this a service is running on the phone enabling the communication via Terminal Emulator. Here are the most useful adb-commands:
Code:
adb push localFileFromPC /path/on/mobilephone
-> pushes a file "localFileFromPC" to a specified location on the phone
adb pull /path/to/file pathFromPC
-> receives a file from the phone and stores it to "pathFromPC"
adb remount
-> This is only possible in custom ROMs, remounts the file system to r/w automatically
adb shell "command"
-> executes "command" and returns to the computer shell
adb shell
-> opens a shell session on the phone (from here on you have to be very careful! Also you can execute now normal linux commands like rm, mv, ls, chmod and so on, but not cp (this can done through busybox)). You will have to use this more often, so get used to it
1.2 Do I have to create a goldcard?
I read this question quite often. For rooting, you don't need it, but for SIM-locked phones you can't flash custom unbranded ROMs (I think).
A guide to create a goldcard follow this link: http://forum.xda-developers.com/show...88&postcount=1 (thanks to MiSSigNNo to this point)
1.3 Tools you need
A complete set of tools can be found here Feel free to mirror it:
http://rapidshare.com/files/403766494/Tattoo.rar.html
Mirror(s):
http://www.bild-ton.net/Tattoo.rar
http://www.megaupload.com/?d=CI9AW83F
This package contains:
- adb binaries for Windows (sorry Linux users )
- su (Please note: use the su-binary attached in this post, not the one in the archive!!!!!)
- m7 exploit
- Amon_RA recovery.img
- mainfram3 boot.img
- flash_image binary
- tattoo-hack.ko
1.4 The automated way
This method was created by maverixx and can be found here. This basically consists of a package doing everything you need by itself. It roots the phone and flashes maverixx recovery.img, which (no offense) I don't like as much as I like Amon_RA's one!). Just click the batchfile and it does the rest (you have to connect your phone via USB to your PC though ).
If you want to use the automated way, but flashing Amon_RA's recovery, just replace the recovery.img from maverixx' package with the recovery.img provided in my archive file (see 1.3 for the link).
In my time here I noticed quite a few users experiencing problems either with a fully functional su or with the recovery image not flashing certain update.zip packages. It seems to be a matter of luck.
1.5 The manual way (recommended by the author)
I personally like what is done when and how, that's why I recommend the manual way. So let's get down to business Let's see if you know all the adb-commands I wrote here:
1. Let's say you have everything unpacked into C:\Tattoo
2. In your terminal (on your PC) type:
- adb shell "mkdir /data/local/bin" (if it returns an error it means that the directory already exists, just proceed)
- adb push m7 /data/local/bin/
- adb push su /data/local/bin/
- adb push flash_image /data/local/bin/
- adb push tattoo-hack.ko /data/local/bin/
- adb push recovery.img /sdcard
- adb push boot.img /sdcard
3. We have every needed file on the phone now. Type now (we are still in your terminal):
- adb shell
$ cd /data/local/bin
$ chmod 766 m7 (I don't retain this step as mandatory, so if this process fails, just proceed)
$ while ./m7 ; do : ; done
lots of text until you see something like "wrote shell code", press enter 2 or 3 times enter to see:
#
4. Then perform this:
- # export LD_LIBRARY_PATH=/system/lib
- # export PATH=/system/bin
- # insmod ./tattoo-hack.ko
- # mount -o rw,remount /dev/block/mtdblock5 /data
- # mount -o rw,remount /dev/block/mtdblock3 /system
- # cat ./su > /system/bin/su
- # chmod 4755 /system/bin/su
- # chmod 755 ./flash_image
Questions?
1.6 Problems and (hopefully good) solutions
Q: How do I execute my command line tool?
A: On your Windows host, go to Start->Run...->type "cmd"
Q: Where is my adb? When I type it in my shell it says that it was not found!
A: The adb binary is found in the archive I supplied above or in the Google SDK. As my archive-file is quite smaller than the Google SDK you should take mine. Let's suppose your adb binary is unpacked in C:\Tattoo, then type:
Code:
Your\Current\Location> cd C:\Tattoo
C:\Tattoo> adb <command>Q: adb says "error: device not found" when I try to launch the shell on the phone!
A: Connect the phone with the usb cable and make sure the sd card is not mounted as drive on your PC!!!
Q: When I want to copy something the phone returns that "cp" is not found! Also when I try to move a file, it says "cross-link device".
A: Well, copying from one partition to another is only possible either via busybox or via
Code:
cat file > /location/filename
Example:
cp /data/su /system/bin
is realized by typing
cat /data/su > /system/bin/suAlso make sure that system is r/w!!!
Q: flash_image returns write errors when flashing recovery/boot image!
A:
For boot: Try to redo the flash procedure
For recovery: Note that you can't flash the same recovery.img as the one already installed, so install another recovery.img first (like maverixx) and then Amon_RA's again. If it still doesn't work reboot, remount the partitions r/w, insmod tattoo-hack.ko and retry flashing.
Q: How can I unroot my device?
A: Just delete su from /system/xbin and restore the old boot.img. Alternatively see here for retrieving a stock ROM to flash it on your phone.
i hope someone try this i don't have time

(Q) Best recovery?

What is the most reliable recovery currently? I'm using twrp at the moment. It's probably an older version so I'm curious what is recommended before i update it.
Sent from my Kindle Fire using Tapatalk 2
pwned3 said:
What is the most reliable recovery currently? I'm using twrp at the moment. It's probably an older version so I'm curious what is recommended before i update it.
Sent from my Kindle Fire using Tapatalk 2
Click to expand...
Click to collapse
My suggestion would be for you to stay with TWRP. Version 2.1.1 is the latest.
kinfauns said:
My suggestion would be for you to stay with TWRP. Version 2.1.1 is the latest.
Click to expand...
Click to collapse
I agree
Sent from my Galaxy Nexus using XDA
pwned3 said:
What is the most reliable recovery currently? I'm using twrp at the moment. It's probably an older version so I'm curious what is recommended before i update it.
Click to expand...
Click to collapse
You already know that TWRP is intuitive and easy to use. I'm using TWRP 2.1.1 and I have used recovery many times when trying out new ROM builds. Occassionally with 2.1.1 I find that the operation that you want to do just fails with either an error outright or will fail during the recovery process. It even failed on me once while creating a backup. I didn't pay much attention to the backup output log text once and I did want to recover that backup and could not due to an image file being zero bytes in size. I have my own app and data backup script that I wrote that keeps me current so recovery in such a failed case is simply flashing a new ROM and executing my recovery script; couldn't be simpler.
If you pay attention to TWRP's output and not just make an assumption that the backup or recovery succeeded then you can just repeat the operation until it's successful. This is rare but has happened to me more than once but even with that issue, I still like TWRP 2.1.1 (plus my own app backup script).
I'll include my app backup and recovery script here in case others can find it useful (I make no claims that will work to your liking however or that it will even work for you)
rebaseline.sh
Code:
#!/system/xbin/bash
cd /sdcard/BACKUP/
for i in `/system/bin/pm list packages -3 -f`
do
read junk apk pkg <<< =`echo $i | sed -e 's/[=:]/ /g'`
echo "Processing $pkg..."
echo " backing up $apk..."
cp $apk baseline/
touch /sdcard/BACKUP/baseline/`basename $apk`
echo " backing up data..."
busybox tar czf /sdcard/BACKUP/baseline/$pkg.tar.gz --exclude lib --exclude cache /data/data/$pkg 2>/dev/null
done
echo "Processing accounts..."
echo " backing up data..."
busybox tar czf /sdcard/BACKUP/baseline/accounts.tar.gz /data/system/accounts.db 2>/dev/null
Here is my recovery script:
restore-from-baseline.sh
Code:
#!/system/xbin/bash
cd /sdcard/BACKUP
pm set-install-location 1
chmod 777 /data/data
for i in baseline/*apk
do
X=${i/-[0-9].apk}
Y=`basename $i`
Y=${Y/-[0-9].apk}
echo $X
pm install -r $i
# Find out what the new app ID is for the package
OWNER=`/system/bin/ls -l /data/data | grep $Y | awk '{print $3;}'`
echo $OWNER
# Restore data as the app owner ID
chmod 777 /data/data/$Y
su --command "tar xvf /sdcard/BACKUP/$X.tar.gz -C /" $OWNER
echo "tar rc=$?"
chmod 751 /data/data/$Y
echo
done
chmod 771 /data/data
echo "Restoring accounts.db - reboot will be required"
tar xvf /sdcard/BACKUP/baseline/accounts.tar.gz -C /
There is one limitation that I haven't worked into the script yet. Any time there is an app update you will see a duplicate app in the baseline folder differentiated by -1 or -2. Before recovery you can just get rid of the oldest version of the apk file; the data is always current.
I'm sure that there are a lot of apps that this script would not work with but it does work very well with mine and cuts down recovery to a minute or two. I don't use Titanium Backup myself.
I've been sticking with TWRP 2.1.1, simply because I really like how it can compress backups, meaning more space for music and videos. Haven't had any issues with it, but I do prefer the look of CWRecovery, particularly Hashcode's latest release.

[Q] adbd always starts up! How do I have it start up only when required?

Hi,
I have a nexus one running PA-3.99rc2 with the following superuser modifications:
* replaced stock superuser app with SuperSU (system app)
* installed adbtoggle (system app)
* I do have the exposed framework and xprivacy installed, with no restrictions on the settings app, the adbtoggle app and the supersu app.
In the developer options, I have
* "Root Access" set to disabled.
* USB debugging" unchecked
* "select debug app" -> no debug app selected
However, what happens is that whenever I connect a USB cable, I can just run 'adb shell' and get a root prompt.
C:\> adb shell
[email protected]:/
Click to expand...
Click to collapse
This is possible irrespective of the adb toggle setting or the root access setting or the USB debugging setting.
I am simply handed a shell even when USB debugging is turned off, whether I asked for it or not.
I haven't tried it over wifi but I have reason to believe that it would be accessible all the same.
When I toggle ADB using the app or the settings panel, I do see the notification that usb debugging was turned on or off - but in reality it has no effect on the actual state of the debug bridge (which is permanently on.)
I did notice:
[email protected]:/ # cd /
cd /
[email protected]:/ # grep -e 'start adbd' init*
grep -e 'start adbd' init*
init.mahimahi.usb.rc: start adbd
init.mahimahi.usb.rc: start adbd
init.mahimahi.usb.rc: start adbd
init.mahimahi.usb.rc: start adbd
init.mahimahi.usb.rc: start adbd
init.rc: start adbd
init.usb.rc: start adbd
init.usb.rc: start adbd
init.usb.rc: start adbd
init.usb.rc: start adbd
Click to expand...
Click to collapse
All the init scripts in "/" have exec, and are owned by root: "-rwxr-x--- root root", unmodified since the ROM's installation.
Are the init scripts starting up adbd irrespective of my settings? Or am I having/doing something wrong?
Has anyone else observed this behaviour?
Is there any way to fix this behaviour and have adbd run only when asked to?
Thanks in advance,
fruit-salad
===================
[email protected]:/ # uname -a
uname -a
Linux localhost 2.6.38.8-evervolv-02117-g69a13bd #1 PREEMPT Sat Sep 28 03:33:41
PDT 2013 armv7l GNU/Linux
I'm running Paranoid Android 3.99.1-RC2- Release 2 from (d-h.st/BuG)
gApps not installed yet.
boot, system and cache were wiped before install, however I did retain my sd-ext partition.
I don't have any old odex files on the sd-ext, a2sd re-optimized the apps on my sd-ext when enabled.
UPDATE:
========
my default.prop has:
#
# ADDITIONAL_DEFAULT_PROPERTIES
#
persist.sys.usb.config=mass_storage,adb
persist.service.adb.enable=1
persist.sys.strictmode.disable=true
ro.secure=0
ro.allow.mock.location=1
ro.debuggable=1
Click to expand...
Click to collapse
but trying to change
persist.service.adb.enable=1 to persist.service.adb.enable=0
and
persist.sys.usb.config=mass_storage,adb to persist.sys.usb.config=mass_storage
isn't helping. Changes are lost after an update.
According to ?t=2209401 build.prop isn't editable -- is default.prop also not editable?
I did remount / "rw" before editing.
Help?

Reeder A7ix generic x86 turkish tablet rooted using only adb successfully

This has been a great forum so I thought I'd share my experience rooting another misc tablet from china. A reeder A7IX from Turkey. It has a nice 1920x1200 display, crappy z2520 processor.
*
Possible Problem 1: 'fastboot oem unlock' does not work and I could only connect with fastboot under windows using the provided manufacturer flash tool from reeder. This lets you install a custom recovery.
Problem 2: there is no obvious custom recovery available for this device
Problem 3: most google searches for installing supersu require custom recovery
Problem 4: SRSroot, the first google hit, reports it is already rooted,as do root checking apps but it apps that require root do not work.
*
Solution: since the 'adb root' command is successful, you can manually execute commands with adb to install SuperSU.
1. Go to http://forum.xda-developers.com/showthread.php?t=1538053
Click CWM / TWRP / MobileODIN installable ZIP: http://download.chainfire.eu/supersu
(At this point you could try adb sideloading the zip, maybe it works? I didn't try it)
Extract the zip file to a place where you can access with ADB.
2. In the zip file there is a folder /META-INF/com/google/android/update-binary
Open update-binary in a text editor
At the top it has instructions on how to manually root. I followed the ones for API 7+ and 17+ and 19+ but not 20+ since it is android 4.2
Here is my copy from update-binary for example:
# To install SuperSU properly, aside from cleaning old versions and
# other superuser-type apps from the system, the following files need to
# be installed:
#
# API** source*********************** target***************************** chmod** chcon********************** required
#
# 7-19* common/Superuser.apk********* /system/app/Superuser.apk********** 0644*** ubject_r:system_file:s0** gui
# 20+** common/Superuser.apk********* /system/app/SuperSU/SuperSU.apk**** 0644*** ubject_r:system_file:s0** gui
#
# 17+** common/install-recovery.sh*** /system/etc/install-recovery.sh**** 0755*** *1************************* required
# 17+******************************** /system/bin/install-recovery.sh**** (symlink to /system/etc/...)******* required
# *1: same as /system/bin/toolbox: ubject_r:system_file:s0 if API < 20, ubject_r:toolbox_exec:s0 if API >= 20
#
# 7+*** ARCH/su********************** /system/xbin/su******************** *2***** ubject_r:system_file:s0** required
# 7+********************************* /system/bin/.ext/.su*************** *2***** ubject_r:system_file:s0** gui
# 17+******************************** /system/xbin/daemonsu************** 0755*** ubject_r:system_file:s0** required
# 17+******************************** /system/xbin/sugote**************** 0755*** ubject_r:zygote_exec:s0** required
# *2: 06755 if API < 18, 0755 if API >= 18
#
# 19+** ARCH/supolicy**************** /system/xbin/supolicy************** 0755*** ubject_r:system_file:s0** required
# 19+** ARCH/libsupol.so************* /system/lib(64)/libsupol.so******** 0644*** ubject_r:system_file:s0** required
#
# 17+** /system/bin/sh or mksh *3**** /system/xbin/sugote-mksh*********** 0755*** ubject_r:system_file:s0** required
# *3: which one (or both) are available depends on API
*
What does it all mean? Basically you need to transfer files from the zip file using 'adb push' and then 'adb shell chmod' as per the above list. There is one 'ln -s' as well for install-recovery.sh. I found the chcon is not required and I ignored it. (ARCH is x86).
e.g. for the first line
# 7-19* common/Superuser.apk********* /system/app/Superuser.apk********** 0644*** ubject_r:system_file:s0** gui
you need to use the commands (where (ZIP/) is from where you extracted the ZIP file):
adb root
adb push (ZIP/)common/Superuser.apk /system/app/Superuser.apk
adb shell chmod 0644 /system/app/Superuser.apk
*
The exception is
# 17+******************************** /system/bin/install-recovery.sh**** (symlink to /system/etc/...)******* required
adb shell ln -s /system/etc/install-recovery.sh /system/bin/install-recovery.sh
*
Have fun! and of course at your own risk.
Do you think this same procedure would work with the Reeder A10iX?

Categories

Resources