[ROOT] [i8160] [Ace2] Advanced rooting procedure WITHOUT increasing the Flash counter

Search This thread

Szaby59

Senior Member
Aug 26, 2010
444
294
SAMSUNG GALAXY ACE 2 i8160/i8160P

This could be complicated if you never used any Linux os, however with this method you can root your phone without increasing the flash counter.
Kernel, recovery, etc. will be the same as in original samsung roms, we will flash a modified (pre-rooted) system.img.

For prerooted system images and csc files see 2nd post!

Requirements:
Linux - Ubuntu 12 recommended (a virtual one will also do the job)
Windows with Odin for flashing
Patience

References:
Ext4Utils
Insipred by: Expert root method which does not increase the flash counter

First of all download your original rom from: http://www.sammobile.com/firmware/?page=3

1, Create a "samsung" directory on your linux filesystem -> "home/username" folder where username is your linux username.
2, Extract the downloaded firmware, then move system.img.md5 and cache.img.md5 to home/username/samsung dir.
(root_package.zip and ext4utils.zip also extract here)
3, Open a terminal window, and enter:

Code:
sudo mkdir /mnt/system

Type the root password and enter.

4, Now set current dir to samsung directory and mount the system image:

Code:
cd /home/username/samsung
mv system.img.md5 system.img.ext4
make
./simg2img system.img.ext4 system.img
sudo mount system.img /mnt/system

if you get error when executiong "make" type:

Code:
sudo apt-get install zlib1g-dev

5, The original system image has been mounted, now extract su binary and superuser.apk to samsung dir then, enter:

I suggest only su binary to include in /system, SuperUser can be installed later!

Code:
sudo cp su /mnt/system/bin/su

6, Now we have to adjust the permissions:

For SU binary:
Code:
sudo chown root:root /mnt/system/bin/su
sudo chmod 06755 /mnt/system/bin/su

For SuperUser app:
Code:
sudo chmod 644 /mnt/system/app/superuser.apk

7, Unmount the image:
Code:
sudo umount /mnt/system

or if it's not working:
Code:
sudo umount system.img

8, Now create md5 hashes:
Code:
md5sum -t system.img>>system.img
mv system.img system.img.md5

if you get "permission denied" first:
Code:
sudo chown username:username system.img

9, Create falshable tar and md5 hashes for odin package:
Code:
tar cf system_rooted.tar system.img.md5
md5sum -t system_rooted.tar>>system_rooted.tar
mv system_rooted.tar system_rooted.tar.md5

As you remember we copied the cache.img.md5 also, that's because we need to flash this as a separated CSC package.

10, Creating CSC package.
Code:
tar cf csc.tar cache.img.md5
md5sum -t csc.tar>>csc.tar
mv csc.tar csc.tar.md5

11, Now open Odin and select system_rooted.tar.md5 as PDA, and csc.tar as csc.
Check: Auto reboot and F. Reset Time.

Enjoy your rooted phone.

NOTES:
After flashing phone will boot in recovery mode to apply csc, then reboots automatically to normal mode.
If you download different rom than already have on the device first flash the unmodified samsung tar as PDA.
 

Attachments

  • odin.jpg
    odin.jpg
    67 KB · Views: 9,011
  • root_package.zip
    1.1 MB · Views: 12,678
  • ext4utils.zip
    135.9 KB · Views: 7,977
Last edited:

Szaby59

Senior Member
Aug 26, 2010
444
294
PRE-ROOTED ROMs
(Only modified system and csc - if Superuser not included download manually from Play store or install from sdcard)

PDA: XXLD8 | CSC: I8160DBTLD2 -> -> DOWNLOAD <-
Thanks to: powermetza

PDA: XXLD8 | CSC: XXLD3 | Product code: XEO -> Mirror 1 | Mirror 2
Thanks to: mastermid | szczepan2



For i8160P - Galaxy Ace 2 NFC model

PDA: I8160PXXLE6 | CSC: I8160PDBTLE5 -> Mirrors
Thanks to: soraxx

SuperUser FIX for pre-rooted rom (only if you have problems): View

FLASHING INSTRUCTIONS

0, Download odin from 1st post, extract the downloaded (pre-rooted) rom.
1, Open odin and select csc.tar.md5 (or something like that it's a smaller file max. 20 MB) as CSC.
2, Select the other file (possibly system.tar.md5 or pda.tar.md5, it's 500+ MB) as PDA.
3, Check, Auto reboot and F. Reset Time then start.
(of course first switch to download mode and connect the phone :D )
 
Last edited:

Szaby59

Senior Member
Aug 26, 2010
444
294
I don't know what's the problem, the filesystem should be ext4, but in Ubuntu mounted without any errors.
 

arroyo

Senior Member
Mar 14, 2009
416
388
Bydgoszcz
@Szaby59

Three simple questions:

1. Can I use this method to cook pre-rooted ROM (that doesn't increase flash counter), but without samsungs bloatware? In other words: Can I somehow remove any APK that comes from samsung and still have valid warranty?
2. Did you tried this method with flash_counter=0 or did you already voided warranty and then NOT increased flash_counter?
3. Are both values "Custom Binary Download=NO" and "Current Binary: Samsung Official" still intact after this root method?

Anyway... Thank you for this... I was waiting for something like this since I bought I8160.
 
Last edited:

Szaby59

Senior Member
Aug 26, 2010
444
294
1, I think you can remove apps and modify some other things if you want I didn't test it but 99% it's possible (or you can remove aps later with root explorer from /system/app)
But for warranty purposes (removing root, restoring original apps) reflash the original unmodified samsung tar.

2-3, No, I didn't tried any other methods, the custom binary downloads is 0 (NO) and I have "Samsung Official".
I think the counter only observing kernel flashes, with this method the flash counter will be the same as before the flash.

Also I noticed when you reboot from adb or terminal to download mode it doesn't shows the odin mode... stuffs, only when you use the hardware keys (vol down+home+power). !Maybe! in this way we can flash a modified kernel but it's not 100% and first you need to root the phone somehow to enable "su reboot download" command.
 
Last edited:

szczepan2

Member
Jun 23, 2010
10
0
By the way... There is no way to download the ROM from THIS site... Loading, loading, and... loading...
 

arroyo

Senior Member
Mar 14, 2009
416
388
Bydgoszcz
Do I need to create CSC file again if I want to flash back to stock-non rooted firmware? Or should I use stock PDA file only, without CSC?
Can you write down a simple "Going back to stock ROM procedure without touching Flash Counter". Many noobs (including me) would be grateful for complete solution.
 

szczepan2

Member
Jun 23, 2010
10
0
Maybe the editing ROM is not working because it's Polish? I can't open it too with any archive manager...
 

Szaby59

Senior Member
Aug 26, 2010
444
294
Do I need to create CSC file again if I want to flash back to stock-non rooted firmware? Or should I use stock PDA file only, without CSC?
Can you write down a simple "Going back to stock ROM procedure without touching Flash Counter". Many noobs (including me) would be grateful for complete solution.

Just flash back the original tar with all files as pda no csc or phone needed it's included in the tar.


@szczepan2: you can't use any know archiver to open img.md5 files.
For extracting the tar use winrar or 7zip.
 
Last edited:

szczepan2

Member
Jun 23, 2010
10
0
@szczepan2: you can't use any know archiver to open img.md5 files.
For extracting the tar use winrar or 7zip.

Ahh, got it. So if it impossible to open it, so how it's possible to mount it?
Ehh, i'm really angry because I can't root my phone... You use Ubuntu in VM or native? Or maybe LiveCD?
 

Szaby59

Senior Member
Aug 26, 2010
444
294
Ahh, got it. So if it impossible to open it, so how it's possible to mount it?
Ehh, i'm really angry because I can't root my phone... You use Ubuntu in VM or native? Or maybe LiveCD?

I installed on a virtualbox virtual machine, (with 8 GB vhd) for mounting and rooting follow the steps from 1st post.
 

mastermid

Senior Member
Aug 30, 2009
152
11
Tychy
@Szaby59

I have also the problem that I need to specify type of mounting filesystem, but I have an idea.

If you are able to mount succesfuly system.img, then could you in console just type:
Code:
mount

It will give you the list with all mounted devices/images and their types - I would be grateful if you could check what type is /mnt/system.

Thanks in advance.
 

Szaby59

Senior Member
Aug 26, 2010
444
294
@Szaby59

I have also the problem that I need to specify type of mounting filesystem, but I have an idea.

If you are able to mount succesfuly system.img, then could you in console just type:
Code:
mount

It will give you the list with all mounted devices/images and their types - I would be grateful if you could check what type is /mnt/system.

Thanks in advance.

It shows ext4 filesystem.
 

Attachments

  • sss0.jpg
    sss0.jpg
    11.7 KB · Views: 410

szczepan2

Member
Jun 23, 2010
10
0
@Szaby59

I have also the problem that I need to specify type of mounting filesystem, but I have an idea.

If you are able to mount succesfuly system.img, then could you in console just type:
Code:
mount

It will give you the list with all mounted devices/images and their types - I would be grateful if you could check what type is /mnt/system.

Thanks in advance.

cloudm33 samsung # mount -t ext4 system.img /mnt/system/
mount: Filesystem error, wrong superblock at /dev/loop0 etc.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 38
    SAMSUNG GALAXY ACE 2 i8160/i8160P

    This could be complicated if you never used any Linux os, however with this method you can root your phone without increasing the flash counter.
    Kernel, recovery, etc. will be the same as in original samsung roms, we will flash a modified (pre-rooted) system.img.

    For prerooted system images and csc files see 2nd post!

    Requirements:
    Linux - Ubuntu 12 recommended (a virtual one will also do the job)
    Windows with Odin for flashing
    Patience

    References:
    Ext4Utils
    Insipred by: Expert root method which does not increase the flash counter

    First of all download your original rom from: http://www.sammobile.com/firmware/?page=3

    1, Create a "samsung" directory on your linux filesystem -> "home/username" folder where username is your linux username.
    2, Extract the downloaded firmware, then move system.img.md5 and cache.img.md5 to home/username/samsung dir.
    (root_package.zip and ext4utils.zip also extract here)
    3, Open a terminal window, and enter:

    Code:
    sudo mkdir /mnt/system

    Type the root password and enter.

    4, Now set current dir to samsung directory and mount the system image:

    Code:
    cd /home/username/samsung
    mv system.img.md5 system.img.ext4
    make
    ./simg2img system.img.ext4 system.img
    sudo mount system.img /mnt/system

    if you get error when executiong "make" type:

    Code:
    sudo apt-get install zlib1g-dev

    5, The original system image has been mounted, now extract su binary and superuser.apk to samsung dir then, enter:

    I suggest only su binary to include in /system, SuperUser can be installed later!

    Code:
    sudo cp su /mnt/system/bin/su

    6, Now we have to adjust the permissions:

    For SU binary:
    Code:
    sudo chown root:root /mnt/system/bin/su
    sudo chmod 06755 /mnt/system/bin/su

    For SuperUser app:
    Code:
    sudo chmod 644 /mnt/system/app/superuser.apk

    7, Unmount the image:
    Code:
    sudo umount /mnt/system

    or if it's not working:
    Code:
    sudo umount system.img

    8, Now create md5 hashes:
    Code:
    md5sum -t system.img>>system.img
    mv system.img system.img.md5

    if you get "permission denied" first:
    Code:
    sudo chown username:username system.img

    9, Create falshable tar and md5 hashes for odin package:
    Code:
    tar cf system_rooted.tar system.img.md5
    md5sum -t system_rooted.tar>>system_rooted.tar
    mv system_rooted.tar system_rooted.tar.md5

    As you remember we copied the cache.img.md5 also, that's because we need to flash this as a separated CSC package.

    10, Creating CSC package.
    Code:
    tar cf csc.tar cache.img.md5
    md5sum -t csc.tar>>csc.tar
    mv csc.tar csc.tar.md5

    11, Now open Odin and select system_rooted.tar.md5 as PDA, and csc.tar as csc.
    Check: Auto reboot and F. Reset Time.

    Enjoy your rooted phone.

    NOTES:
    After flashing phone will boot in recovery mode to apply csc, then reboots automatically to normal mode.
    If you download different rom than already have on the device first flash the unmodified samsung tar as PDA.
    6
    PRE-ROOTED ROMs
    (Only modified system and csc - if Superuser not included download manually from Play store or install from sdcard)

    PDA: XXLD8 | CSC: I8160DBTLD2 -> -> DOWNLOAD <-
    Thanks to: powermetza

    PDA: XXLD8 | CSC: XXLD3 | Product code: XEO -> Mirror 1 | Mirror 2
    Thanks to: mastermid | szczepan2



    For i8160P - Galaxy Ace 2 NFC model

    PDA: I8160PXXLE6 | CSC: I8160PDBTLE5 -> Mirrors
    Thanks to: soraxx

    SuperUser FIX for pre-rooted rom (only if you have problems): View

    FLASHING INSTRUCTIONS

    0, Download odin from 1st post, extract the downloaded (pre-rooted) rom.
    1, Open odin and select csc.tar.md5 (or something like that it's a smaller file max. 20 MB) as CSC.
    2, Select the other file (possibly system.tar.md5 or pda.tar.md5, it's 500+ MB) as PDA.
    3, Check, Auto reboot and F. Reset Time then start.
    (of course first switch to download mode and connect the phone :D )
    5
    ok, let me be of use, downloading the package..

    ... update ...

    done: I8160DXLK2_I8160OLBLK2_XTE_rooted
    5
    Rooted XXLK6

    Rooted XXLK6
    (Poland; November 2012; PDA: XXLK6, CSC: XXLK1)

    SuperSu app and library


    Installation

    Before installing I recommended install stock XXLK6 from SamMobile (dev-host, zippyshare part 1, zippyshare part 2, hotfile)
    1. In Odin 3 1.85 choose "system_rooted.tar.md5" as "PDA"
    2. "csc.tar.md5" as "CSC"
    3. Check only "Auto Reboot" and "F. Reset Time"
    4. "Start"

    Download

    Dev-Host

    Zippyshare PART 1
    Zippyshare PART 2
    2
    Ok i flashed the 1ghz kernel + recovery without increasing flash counter !!!! :)

    How did i do that ?

    1) get you phone rooted

    2) download the 1ghz kernel from this post http://xdaforums.com/showpost.php?p=27696948&postcount=47

    3) Put the kernel.bin.md5 file to /sdcard

    4) apply the folowing command (using adb or terminal emulator) :

    Code:
    $ su
    # dd if=/sdcard/kernel.bin.md5 of=/dev/block/mmcblk0p15
    # reboot

    5) reboot your phone

    ATTENTION : be carefull i flashed one kernel and my phone didn't boot anymore

    Here is attached the stock kernel to flash with Odin in case of probleme :