[Q] Switching back to TW from AOSP - T-Mobile, Samsung Galaxy SIII

Hey everyone, just had a quick question to make sure I'm not doing anything wrong before I do this... But am i supposed to Odin back to stock to before I flash a tw rom from aosp or can I just wipe everything and flash as normal... Sorry if it's noobish just wanted to make sure I'm safe before I do this. Thanks!
Sent from my SGH-T999 using xda premium

There is talk about GPS not working 100% between 4.2.2 back to TW, I would remove all contents from sdcards (Both) and then fully wipe and Odin and then go back to ensure no issues. Then restore the the sdcard contents.

mt3g said:
There is talk about GPS not working 100% between 4.2.2 back to TW, I would remove all contents from sdcards (Both) and then fully wipe and Odin and then go back to ensure no issues. Then restore the the sdcard contents.
Click to expand...
Click to collapse
Good looking I'll stick with liquid lol that's a lot of work but once again thanks
Sent from my SGH-T999 using xda premium

Hey when switching back to stock
Can I use root66 to revert or would you recommend flashing the stock Odin tar?
Sent from my SGH-T999 using Tapatalk 2

Not necessary to Odin stock. Wipe system, dalvik, and factory reset (wipes data and cache).
Stock flashed with Odin updates your modem, bootloader, etc. Custom roms never do this. Operation is therefore pointless. Custom roms write to the system partition.
You can format your SDs, but not necessary. I advise fixing the file structure manually.

Aerowinder said:
Not necessary to Odin stock. Wipe system, dalvik, and factory reset (wipes data and cache).
Stock flashed with Odin updates your modem, bootloader, etc. Custom roms never do this. Operation is therefore pointless. Custom roms write to the system partition.
You can format your SDs, but not necessary. I advise fixing the file structure manually.
Click to expand...
Click to collapse
So, the WhoopBlaw about GPS being broken when going back to TW, from 4.2.2 is just mumbo jumbo? I never use GPS maybe once in a while to find a new bar or restaurant but nothing like some users here will, so I've never looked into it besides reading people rant about it being messed up... that and all the sdcard drama.

I believe those people with GPS issues are being honest. It's a problem easily solved with that dialer code. I've gone from 4.2.2 to 4.1.1 more than once and never had issues, however.
But, by simply looking at the zip file before a flash, one can see only system is formatted and rewritten. The Odin packages have everything but data.
The sdcard drama, as you say, I feel, is mostly people in panic mode.

Aerowinder said:
I believe those people with GPS issues are being honest. It's a problem easily solved with that dialer code. I've gone from 4.2.2 to 4.1.1 more than once and never had issues, however.
But, by simply looking at the zip file before a flash, one can see only system is formatted and rewritten. The Odin packages have everything but data.
The sdcard drama, as you say, I feel, is mostly people in panic mode.
Click to expand...
Click to collapse
I am on LiquidSmooth RC2 and I want to try Darthstalker X2, So can you suggest how to do it properly in order to avoid trouble.
I have CWM (5.5.0.4) backup before flash LS. Should I go restore that before flash Darthstalker? I also want to backup my Imei since I have problem with LS, I can't use Gsiprt,
Please advice. Thanks.

Use a terminal emulator. Type
su
reboot nvbackup
Phone will reboot. IMEI is backed up.
Update CWM. Use the link in my signature. Or if you want a zip, I can link one.
Make a nandroid.
Then flash the new rom like you normally would.

Aerowinder said:
Use a terminal emulator. Type
su
reboot nvbackup
Phone will reboot. IMEI is backed up.
Update CWM. Use the link in my signature. Or if you want a zip, I can link one.
Make a nandroid.
Then flash the new rom like you normally would.
Click to expand...
Click to collapse
Thanks, Done with terminal emulator IMEI backup. I am just wondering if something happen how do I restore back the IMEI using terminal emulator. I don't even can find the backup by looking on storage or plug USB to computer. Can I save the IMEI backup to computer?

nvbackup writes backups of two partitions to 2 empty partitions already on the phone. You should never need to manually restore it. It should happen automatically if needed. But to force a restore, the command would be reboot nvrestore. So, you can't see them while browsing your phone.
There are some tools to backup the IMEI to your sdcard, but I use the one I wrote adapted from the Synergy guys:
Code:
# EFS/IMEI Backup script version 2.
# All credit to Team Synergy for the original script.
# Rewritten by Aerowinder.
echo "";
echo "Creating backup directory: /data/media/IMEI Backup.";
mkdir -p "/data/media/IMEI Backup/temp/";
cd "/data/media/IMEI Backup/temp/";
echo "Commencing backup...";
echo "Copying mmcblk0p11: efs";
dd if=/dev/block/mmcblk0p11 of=p11_efs.img > /dev/null 2>&1;
echo "Copying mmcblk0p12: modemst1";
dd if=/dev/block/mmcblk0p12 of=p12_modemst1.img > /dev/null 2>&1;
echo "Copying mmcblk0p13: modemst2";
dd if=/dev/block/mmcblk0p13 of=p13_modemst2.img > /dev/null 2>&1;
echo "Copying mmcblk0p20: backup";
dd if=/dev/block/mmcblk0p20 of=p20_backup.img > /dev/null 2>&1;
echo "Copying mmcblk0p21: fsg";
dd if=/dev/block/mmcblk0p21 of=p21_fsg.img > /dev/null 2>&1;
echo "Copying efs folder...";
cp -pr /efs/ efs/;
echo "Copying radio folder...";
cp -pr /data/misc/radio/ radio/;
datetime=$(date +'%Y%m%d_%H%M');
echo "Compressing backup (backup_$datetime.tar.gz)...";
tar -chzf "/data/media/IMEI Backup/backup_$datetime.tar.gz" *;
echo "Cleaning up...";
rm -rf "/data/media/IMEI Backup/temp/";
echo "Backup complete!";
echo "";

Aerowinder said:
nvbackup writes backups of two partitions to 2 empty partitions already on the phone. You should never need to manually restore it. It should happen automatically if needed. But to force a restore, the command would be reboot nvrestore. So, you can't see them while browsing your phone.
There are some tools to backup the IMEI to your sdcard, but I use the one I wrote adapted from the Synergy guys:
Code:
# EFS/IMEI Backup script version 2.
# All credit to Team Synergy for the original script.
# Rewritten by Aerowinder.
echo "";
echo "Creating backup directory: /data/media/IMEI Backup.";
mkdir -p "/data/media/IMEI Backup/temp/";
cd "/data/media/IMEI Backup/temp/";
echo "Commencing backup...";
echo "Copying mmcblk0p11: efs";
dd if=/dev/block/mmcblk0p11 of=p11_efs.img > /dev/null 2>&1;
echo "Copying mmcblk0p12: modemst1";
dd if=/dev/block/mmcblk0p12 of=p12_modemst1.img > /dev/null 2>&1;
echo "Copying mmcblk0p13: modemst2";
dd if=/dev/block/mmcblk0p13 of=p13_modemst2.img > /dev/null 2>&1;
echo "Copying mmcblk0p20: backup";
dd if=/dev/block/mmcblk0p20 of=p20_backup.img > /dev/null 2>&1;
echo "Copying mmcblk0p21: fsg";
dd if=/dev/block/mmcblk0p21 of=p21_fsg.img > /dev/null 2>&1;
echo "Copying efs folder...";
cp -pr /efs/ efs/;
echo "Copying radio folder...";
cp -pr /data/misc/radio/ radio/;
datetime=$(date +'%Y%m%d_%H%M');
echo "Compressing backup (backup_$datetime.tar.gz)...";
tar -chzf "/data/media/IMEI Backup/backup_$datetime.tar.gz" *;
echo "Cleaning up...";
rm -rf "/data/media/IMEI Backup/temp/";
echo "Backup complete!";
echo "";
Click to expand...
Click to collapse
Thanks, so What you mean I don't need to worry losing IMEI after nvbackup. :good:
For your code, can I just copy everything paste it to gscript and run it from there.

Related

[Script] Flash recovery from Terminal v1.0 [2012_0513]

I have create a script file that will flash a recovery from the terminal in the Galaxy Nexus.
I got the command from xda but I could not remember it when I wanted to flash a recovery,
so I wrote a script to do it.
AS WITH ANY FLASHING OR MODDING OF "YOUR" PHONE, I AM NOT RESPONSIBLE FOR ANY DAMAGES YOU MAY CAUSE!
I have tested this on my:
Unlocked Galaxy Nexus 4.1.1 takju (flashed from yakju)
Sprint Galaxy Nexus 4.0.4
Thanks to -viperboy- for help.
Code:
Created by Smurph82 2012_0512 (c) v1.0
flashr [-h] [-r] [-m] [-s s] -- Flash a recovery
to the Galaxy Nexus.
where:
-h show this help text
-r will reboot after flashing is complete.
-m image is in the root of the sdcard
-s source of the recovery image (/sdcard/recovery.img).
To use the script:
Download and Flash the script file from your current recovery
Or download the zip file and move the flashr file in the /system/bin folder to /system/bin with RootExplorer
or other root level file manager.
If you manually add the file you must
Code:
chmod 0755 /system/bin/flashr
or change the permissions from RootExplorer
Then open Terminal and type
Code:
su
first, yes you have to be rooted to do this!
Next type
Code:
flashr
or
Code:
flashr -h
to get the help
If you want to flash a recovery you must have the recovery.img
somewhere on your device that you can remember. Like the root of the sdcard.
To flash a recovery type
Code:
flashr -s /sdcard/recovery.img
or if the recovery is in the root of the sdcard type
Code:
flashr -ms recovery.img
If you want to reboot after the flashing is complete next use
Code:
flashr -mrs recovery.img
In the code examples above I used recovery.img as an example.
This should be "what ever you named the recovery".img it does not have to be recovery.
Reserved
Change Log:
v1 - Initial Release
i know you might think that im trolling, but im really not. what id like to know is what makes that better than just flashing the recovery, via the terminal, the old-fashioned way..
su(press enter)
flash_image recovery /sdcard/recovery.img(press enter)
reboot recovery(press enter, if you want to go to the recovery)
providing ithe file is on the main fs in the sd storage.
flash_image does not work with ics, that I have found. So I wrote my own. If there is a new flash_image that works with the galaxy nexus then I could not find it. Maybe it is because I'm still using the stock rom and kernel. I took the flash_image out of cm9 but it didn't work for me.
Sent from my Galaxy Nexus using XDA Premium HD app
Would you be willing to share the sources for this? It would be interesting to know how this works, since it may be useful also for other purposes than flashing recovery images. Or not?
I will post the source later today. It really is not much.
Sent from my Transformer Prime TF201 using XDA Premium HD app
E:V:A said:
Would you be willing to share the sources for this? It would be interesting to know how this works, since it may be useful also for other purposes than flashing recovery images. Or not?
Click to expand...
Click to collapse
Hope that this is helpful to someone.
Code:
#!/system/bin/sh
usage="Created by Smurph82 2012_0512 (c) v1.0
flashr [-h] [-r] [-m] [-s s] -- Flash a recovery
to the Galaxy Nexus.
where:
-h show this help text
-r will reboot after flashing is complete.
-m image is in the root of the sdcard
-s source of the recovery image (/sdcard/recovery.img)."
# Read in the options turn off verbose and require -s to have input
while getopts :hrms: opt; do
case $opt in
h) echo "$usage"
echo
exit;;
m) sdroot="/sdcard/";;
s) sourcedir=$OPTARG;;
r) reboot="t";;
*) echo
echo
echo "Invalid option: -$OPTARG" >&2
echo "$usage"
echo
exit;;
esac
done
shift $(($OPTIND - 1))
# This was for testing
#echo
#echo "Vars: m $sdroot: s $sourcedir: r $reboot: dir $sdroot$sourcedir"
#echo
# Check to make sure somthing was typed if not show help
if [ "$sourcedir" == "" ]; then
echo "$usage"
echo
exit
else
# Check that something is in that location if not dont flash
if [ -s $sdroot$sourcedir ]; then
echo "Flashing image from: $sdroot$sourcedir"
cat $sdroot$sourcedir > /dev/block/platform/omap/omap_hsmmc.0/by-name/recovery
else
echo "File not found at $sdroot$sourcedir"
exit
fi
fi
# Early in the morning I was getting cute
if [ "$reboot" == "t" ]; then
echo "Rebooting in 5.."
sleep 1
echo "Rebooting in 4.."
sleep 1
echo "Rebooting in 3.."
sleep 1
echo "Rebooting in 2.."
sleep 1
echo "Rebooting in 1.."
sleep 1
reboot recovery
fi
thank u very much for this! so easy now!!
It is just as easily done in a terminal by the following (assuming you downloaded the recovery you want to /sdcard and named it recovery.img):
su
dd if=/sdcard/recovery.img of=dev/block/platform/omap/omap_hsmmc.0/by-name/recovery
efrant said:
It is just as easily done in a terminal by the following (assuming you downloaded the recovery you want to /sdcard and named it recovery.img):
su
dd if=/sdcard/recovery.img of=dev/block/platform/omap/omap_hsmmc.0/by-name/recovery
Click to expand...
Click to collapse
Yes I know that but who wants to type all of that out. I just made it shorter more
or else. If you want to type the whole command then by all means have at it. I just
think that "flashr -mrs twrp.img" is a whole lot easier. Just my thoughts.
Hi
Nice enough script.
Although I feel I should warn people that it looks like this script will write anything you tell it. making no effort to verify that the file is a valid or correct for your phone. so be careful not to specify the wrong file.
fastboot flash recovery $file is much safer.
That is true if you are connected to a computer but this script is run on the phone from the terminal. If someone knows a way to check a file from the terminal running on the phone please tell me and I will update the script. I understand that there is currently no verification of the file that is being written so please make sure that you are writing the right file.
Sent from my Galaxy Nexus using XDA Premium HD app

(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.

[GUIDE] If your EFS is corrupt

When I first got SGS3 I made efs backup as suggested by xda. I didn't backup it as a folder, only as a dd block copy.
So if you are good today - make block copy of EFS and tar copy using adb:
adb shell
su
dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn
cd /sdcard
tar cvf efs.tar /efs
Also there is a way of saving NVRam into recovery. Do it now if you haven't yet:
adb reboot nvbackup
Then if you still don't feel safe download QPST tools from IMEI thread and backup your NVRam to PC.
My earpiece died and I got a replacement SGS3.
Something (CWM6?) caused IMEI corruption. I didn't know that, so I tried reflashing modems and ROMs. I was trying everything to restore my connectivity. It somehow didn't help that there are seversal guides on how to do IMEI restore.
While I was waiting for another tool download I decided to restore efs from my previous SGS3 on to current SGS3 (I was at my wits end). And I didn't backup current EFS - my huge mistake! But I already almost give up on the phone at that point.
QPST+Peoplearmy tool was able to restore my IMEI. But EFS is now corrupt (why? I cannot even mount it!). And I can only use one modem - the one I used when backing up EFS (UCALG1 modem).
On the good side - after formatting EFS and making it clean, I can run CM10.1 without any issues. My serial number is 000000, but who cares.
Here's how to format EFS:
1. Reboot into recovery (CWM 5.8.0.5 touch is my preferred)
2. You should be able to see phone connected to PC in adb (recovery mode)
3. Issue following commands:
adb shell
mke2fs -T ext4 /dev/block/mmcblk0p11
mkdir /efs
mount -w -t ext4 /dev/block/mmcblk0p11 /efs
Lesson learned - try not to mess with EFS at all. Do IMEI restore using QPST and Peoplearmy. I'll keep you posted on EFS restore efforts.
Assuming I made a block copy of my EFS partition using "dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn".
How would I restore it should I corrupt my EFS?
Like this?
dd if=/sdcard/efs.sbn of=/dev/block/mmcblk0p11
HiKsFiles said:
Assuming I made a block copy of my EFS partition using "dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn".
How would I restore it should I corrupt my EFS?
Like this?
dd if=/sdcard/efs.sbn of=/dev/block/mmcblk0p11
Click to expand...
Click to collapse
Correct.
Sent from my SAMSUNG-SGH-I747 using xda premium
---------- Post added at 03:19 PM ---------- Previous post was at 03:15 PM ----------
Or you can do the backup in one nice command:
dd if=/dev/block/mmcblk0p11 | gzip -9 > /sdcard/efs.gz
And to restore:
gunzip /sdcard/efs.gz - | dd of=/dev/block/mmcblk0p11
Oh, and you don't need to reformat the partition before restoring, that happens during the restore, because every bit gets overwritten.
Sent from my SAMSUNG-SGH-I747 using xda premium
bravomail said:
...make block copy of EFS and tar copy using adb:
adb shell
su
dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn
cd /sdcard
tar cvf efs.tar /efs
Click to expand...
Click to collapse
The TAR command failed for me on my i747, TAR not found.
d3athsd00r said:
Or you can do the backup in one nice command:
dd if=/dev/block/mmcblk0p11 | gzip -9 > /sdcard/efs.gz
Click to expand...
Click to collapse
This worked like a charm for me, thanks.

FIXED - [Q] N7100 Can't get out of Factory Mode! Help Anyone pls?

I Finally fixed the problem!
I had to give full permissions to the folder FactoryApp inside /efs/ in order for the 2nd method to work!
Thanks to everyone anyway and sorry for opening a new post! Hopefully it will help someone!
-------------------------------------------------------------------------------------------------------
Hi there. I have a problem with my Galaxy Note 2 (N7100).
First I was in Factory Mode, but after I flashed new 4.4.2 Stock Rom with Odin, I could get rid of it.
Then, I lost my IMEI, and I had the default 00049... one. So I could fix it by restoring my EFS backup (.tar.gz format) but now, after recovering my EFS and IMEI, I got into factory mode again (you know, when you start the phone and after booting up completely, get a window with yellow letters telling you about the phone, and a message in red letter saying "Phone in Factory Mode, some of the features might be disabled)
After reading uncountable forums, and trying this methods:
1.-Open the file “factorymode” in /efs/FactoryApp directory, it probably says OFF. Change it to ON then reboot your phone.
2.- using the command for adb shell - su - echo -n ON > /efs/FactoryApp/factorymode
3.- using terminal emulator -
su
echo -n ON > /efs/imei/keystr
echo -n ON > /efs/FactoryApp/factorymode
chown 1001:1001 /efs/imei/keystr
reboot
4.-su
rm /efs/FactoryApp/keystr
rm /efs/FactoryApp/factorymode
echo -n ON >> /efs/FactoryApp/keystr
echo -n ON >> /efs/FactoryApp/factorymode
chown 1000.1000 /efs/FactoryApp/keystr
chown 1000.1000 /efs/FactoryApp/factorymode
chmod 0744 /efs/FactoryApp/keystr
chmod 0744 /efs/FactoryApp/factorymode
reboot
And after trying all this methods, still when I reboot, i am stuck in factry mode. There must be a way to get rid of it and go back to user mode, right? Is there someone that can help me?
I am rooted and currently on Dr. Ketan Stock 4.4.2 rom.
Thank you very much in advance!!!

[Q] onandroid script going wrong..

Hello all!
I got my z1c 4 days ago and still trying to learn it's quirks (and problems like the camera button not taking a photo for some reason.. )
anyway.. I'm trying to setup onandroid again to run some nights and modifying the script from my old phone came to here:
Code:
#!/system/bin/sh
echo "sdcard is $EXTERNAL_STORAGE"
echo "sdcard1 is $SECONDARY_STORAGE"
NKSTORAGE=$SECONDARY_STORAGE/clockworkmod/backup
NKBAKNAME=NKZ1cCWM
cd $NKSTORAGE
echo "deleting old backup directory..."
rm -r $NKBAKNAME.old
sleep 2
echo "renaming latest backup directory..."
mv $NKBAKNAME $NKBAKNAME.old
sleep 2
rm -r $NKBAKNAME
sleep 2
echo "starting onandroid backup..."
echo "------------------------------"
echo "==============================="
onandroid -o -p -u -c $NKBAKNAME -e $NKSTORAGE -xd -xg -nd
with:
busybox: installed
onandroid 9.51 and patch for Z1c
trying to do backup to external storage
platform.xml for SD access edited..
still the onandroid script after it starts tries to write somewhere in emulated storage /obb/ etc..
any ideas?

Categories

Resources