[ICS-JB][Samsung] Safe No Brick Wipe Data/System/Cache/Dalvik from recovery

Search This thread

Phil3759

Inactive Recognized Developer
May 30, 2012
9,579
33,063
There's no updated binaries zip file for wiping dalvik right?

Sent from my GT-I9100 using xda premium

Wiping dalvik should be safe as there is no dalvik partition, so no format commands issued
Factory reset is wipe data (so dalvik too)
Sent from my GT-I9100 using Tapatalk 2
 
Last edited:

crixalis

Senior Member
Apr 24, 2009
172
10
Bucharest
I have a question. I flash with odin stock 4.0.4 then again with odin speedmode (safe kernel from description). Its safe for me to wipe data from CWM or from rom (factory reset) ?

Thanks
 

crixalis

Senior Member
Apr 24, 2009
172
10
Bucharest
With stock kernel 4.0.4 and speedmode kernel its safe to wipe data from recovery? Its chance to brick my phone ?

Sorry for my english
 

shoey63

Recognized Contributor
With stock kernel 4.0.4 and speedmode kernel its safe to wipe data from recovery? Its chance to brick my phone ?
Useing Philz wiping scripts or kernels wont brick your phone. If u want to know if Speedmod recovery is safe to wipe from directly, maybe u should enquire on that forum.





Sent from my GT-N7000 using xda app-developers app

---------- Post added at 05:42 PM ---------- Previous post was at 05:39 PM ----------

Wipe from stock recovery is safe....

....if Philz wiping scripts or temp recovery are used:)

Sent from my GT-N7000 using xda app-developers app
 
Last edited:

MontAlbert

Senior Member
Jan 10, 2007
2,655
198
Sorry, new to sgsii stuff..my mate wants me to update his phone so am reading now...if he is on a rooted stock ICS do I need this? Or is the easy fix just to flash a new cfroot kernel in Odin first and then all will be good?

When flashing a new rom how does this bug work? If he already has cwm on there can I just flash a new rom and kernel in cwm after wiping? Or should I flash these files first just in case?
Thanks

Sent from my Galaxy Nexus using xda premium
 
Last edited:

shoey63

Recognized Contributor
Go here http://xdaforums.com/showthread.php?t=1877270
Read OP and flash appropriate kernel. Cf-root is not 100% safe but Philz kernels are. After that you can wipe and flash without bricking, so no need for these scripts.
Sent from my GT-N7000 using xda app-developers app

---------- Post added at 09:18 PM ---------- Previous post was at 09:04 PM ----------

@Phil3759. Just noticed you have unleashed new 2.0 recovery for GSII.:beer: Does this mean you have reworked touch code already!?

Sent from my GT-N7000 using xda app-developers app
 

Phil3759

Inactive Recognized Developer
May 30, 2012
9,579
33,063
Go here http://xdaforums.com/showthread.php?t=1877270
Read OP and flash appropriate kernel. Cf-root is not 100% safe but Philz kernels are. After that you can wipe and flash without bricking, so no need for these scripts.
Sent from my GT-N7000 using xda app-developers app

---------- Post added at 09:18 PM ---------- Previous post was at 09:04 PM ----------

@Phil3759. Just noticed you have unleashed new 2.0 recovery for GSII.:beer: Does this mean you have reworked touch code already!?

Sent from my GT-N7000 using xda app-developers app

No, I am now on build 2.20 (internal)
On the i9100, the issue is present too, but not at default settings

By the way, I debugged it now:

- main cause is my "highlight on first touch function": selects menu on first touch and validates on finger lifted
- if I use easier implementation of "highlight on finger lifted", this will be fixed quickly (Koush Touch uses this way of highlight/validate on finger lifted)

If you scroll too fast, at end or start of scroll, your finger curves on the screen and even eventually touches it with or near your nail. If you try it slowly, you can see in that case that despite you scroll from top to bottom, at the end of movement your finger touches a previous position before it is lifted. This abuses my code checks.

The easiest solution is to put finger on screen, slide down maintaining same surface (not curving finger too much), and lift finger without curving it too much. That way, you get a very clean scroll that can be fast

Hope you get what I mean.

I like the highlight on first touch implementation unique to my code, so I am trying to fix the code using more robust one
If it ends up too hard to fix or not perfect, I would revert, or offer option, to use "easy scrolling mode" which toggles this highlight on first touch part and reverts to a select on finger lifted code. That way, scrolling will not cause too much issues even if you abuse with this fast scrolling

Fact is that cwm code is not something like ors file manager or your android apps. The gui is very rudimentary and should stay that way in my opinion as it is a recovery, not an OS

Most people would only care about functions. Few will find a real use of my GUI. I do it for fun and because I hated scrolling in default non touch cwm6
 

Top Liked Posts

  • There are no posts matching your filters.
  • 50

    <<< Built for the i9100 in mind, but fine on any Samsung phone >>>
    <<< check your mount points before using this on another phone >>>
    <<< Backup, Backaup and Backup your Data >>>
    <<< Never use it on a non Samsung Phone >>>
    <<< Read before flash, you are warned >>>


    Update 08.10.2012:
    Following Entropy512 recommendations, I updated the binary-update to a safe one.
    Now format commands are used in script instead of delete_recursive.
    This makes the wipe much clean if some file system errors are present

    Special thanks to shoey63 for his contribution :good:


    Since the superbrick bug story on 4.0.4 firmwares for the i9100 and the Note, wiping and factory reset became a tragedy for many.
    many users in N7000 forum asked me for these scripts. Here are they!

    shoey63 took my attention to a discussion by Entropy512, Elite Recognized Developer who contributed to a better knowledge of the superbrick bug.

    I quote him here:

    For a while, as there was little knowledge about the nature of the bug, it was suspected that deleting large files could be dangerous.

    However, after further knowledge and research:
    For ERASE commands to be caused by simple file deletion (a variation of "TRIM") - The filesystem must be mounted with the "discard" option. No ICS kernel/initramfs/firmware combo I've seen for our device, I9100, or I777 does this.

    In theory, an app with superuser permissions could issue erase commands - but I am unaware of any apps that do this.

    Root has zero effect despite her claim. When you are in recovery, the only thing that matters is the kernel initramfs - contents of /system do not matter. When you are in recovery, "root" is just another file in /system, indistinguishable from any other as far as wiping algorithms go. In fact, her claim that root voids your warranty is incorrect in many countries. For example, in the United States, her claim is in direct conflict with the Magnusson-Moss Warranty Act, which states that a manufacturer must prove that modifications were the cause of damage before denying warranty service. (This was passed decades ago due to lobbying efforts by SEMA, an association of vendors of aftermarket modifications for vehicles - but it applies to phones too.)

    CWM, if wipe isn't suppressed, can be more dangerous than Samsung stock recovery - Samsung believes that only secure erase (done by default in Google-originated source code) is dangerous. However the experiences of Robotu and others have me convinced that while non-secure erase (done by stock recovery) is less dangerous, it is not 100% safe. Also note that even CWM's secure erase doesn't always cause damage - some I777 developers wiped multiple times using CWM on the UCLD3 leak without issues, and Gokhanmoral tested wiping with SiyahKernel 3.1rc6 on the I9100 multiple times without issue - but plenty of users suffered damage. One example of what appears to be damage due to wiping on stock ICS is at http://xdaforums.com/showthread.php?t=1752468 - The Tab 7.7 gets to join the party now.



    To sum it:

    - wipe / factory reset from CWM is extremely risky on broken chipsets and vulnerable kernels
    - wipe / factory reset in stock recovery is not without risks, even if probably less
    - delete operations, even on big data packets is safe

    So, here comes the idea: build some wipe scripts that can run in recovery (be it stock recovery or CWM) to complete the wipe operations using safe delete command to avoid brick risks on these affected phones

    I attach these scripts to just run in recovery (will work in stock recovery)

    • Samsung_Factory_Reset-signed.zip: will delete data and cache partitions
    • Samsung_Wipe_Cache-signed.zip: will delete cache partition
    • Samsung_Wipe_Dalvik-signed.zip: will delete dalvik-cache
    • Samsung_Wipe_Data_System_Cache-signed.zip: will delete the data, cache and system partition. After this one, phone will not boot, only recovery and download mode are accessible. You need to flash a full ROM in Odin after that

    Here's the edify code used, for teach purpose (in v2.0, delete_recursive is now replaced by format commands)

    Code:
    ui_print("***************************");
    ui_print("Wipe data-cache-system");
    ui_print("Samsung Phones Only");
    ui_print("***************************");
    show_progress(1.000000, 0);
    
    ui_print("Checking Samsung Phone...");
    assert(getprop("ro.product.manufacturer") == "samsung");
    set_progress(0.100000);
    
    ui_print("Mounting partitions");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p7", "/cache");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");
    set_progress(0.200000);
    
    ui_print("Delete Cache Partition");
    delete_recursive("/cache");
    set_progress(0.400000);
    
    ui_print("Delete Data Partition");
    delete_recursive("/data");
    set_progress(0.600000);
    
    ui_print("Delete System Partition");
    delete_recursive("/system");
    set_progress(0.900000);
    
    ###############################################################################
    ############################ Formatting partitions ############################
    #### You need to unmount (ALL?) partitions before formatting one partition ####
    # unmount("/cache");
    # unmount("/data");
    # unmount("/system");
    # format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0");
    
    #### Then remount if you intend to use it later in teh script ####
    # mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
    # mount("ext4", "EMMC", "/dev/block/mmcblk0p7", "/cache");
    # mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");
    
    #### wipe dalvik-cache ####
    # mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");
    # delete_recursive("/data/dalvik-cache");
    # unmount("/data");
    #### wipe dalvik-cache done ####
    
    #### Mount in busybox ####
    # run_program("/sbin/mount", "/dev/block/mmcblk0p7", "/cache");
    # run_program("/sbin/mount", "/dev/block/mmcblk0p10", "/data");
    # run_program("/sbin/mount", "/dev/block/mmcblk0p9", "/system");
    #### internal sd ####
    # run_program("/sbin/mount", "/dev/block/mmcblk0p11", "/sdcard");
    ###############################################################################
    
    ui_print("Unmounting Partitions");
    unmount("/cache");
    unmount("/data");
    unmount("/system");
    set_progress(1.000000);
    show_progress(1.000000, 0);
    
    ui_print("Wipe complete!");
    ui_print("Reboot in download mode");
    ui_print("Flash a full ROM in Odin");
    ui_print("by Phil3759@xda-developers.com");
    3
    There's no updated binaries zip file for wiping dalvik right?

    Sent from my GT-I9100 using xda premium

    Wiping dalvik should be safe as there is no dalvik partition, so no format commands issued
    Factory reset is wipe data (so dalvik too)
    Sent from my GT-I9100 using Tapatalk 2
    3
    If i go back to a 4.0.3 stock firmware, no brick risk then, right?

    Sent from my GT-I9100 using xda app-developers app

    No brick risks on the i9100 with official 4.0.3 fw

    Sent from my GT-I9100 using Tapatalk 2
    3
    Every now and then someone on stock ICS wants to do a wipe
    But doesn't want to use custom kernel or even temp CWM. And unless they are prepared to do factory reset from stock recovery, this is they only way.
    Sent from my GT-N7000 using xda app-developers app
    2
    Very nice idea and good work!
    Tested on I9100. No problem.
    Thank you!