yashsingh1/xdaforums huggingface dataset:
[Galaxy Ace II General] Szaby59:
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:

sudo mkdir /mnt/system

Type the root password and enter.

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

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:

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!

sudo cp su /mnt/system/bin/su

6, Now we have to adjust the permissions:

For SU binary:

sudo chown root:root /mnt/system/bin/su
sudo chmod 06755 /mnt/system/bin/su

For SuperUser app:

sudo chmod 644 /mnt/system/app/superuser.apk

7, Unmount the image:

sudo umount /mnt/system

or if it's not working:

sudo umount system.img

8, Now create md5 hashes:

md5sum -t system.img>>system.img
mv system.img system.img.md5

if you get "permission denied" first:

sudo chown username:username system.img

9, Create falshable tar and md5 hashes for odin package:

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.

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.
[Galaxy Ace II General] Szaby59:
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 )
[Galaxy Ace II General] szczepan2:
mount: must specify filesystem (this is error)

My OS - Linux Mint 13 with MATE, run natively.
[Galaxy Ace II General] Szaby59:
I don't know what's the problem, the filesystem should be ext4, but in Ubuntu mounted without any errors.
[Galaxy Ace II General] hary232:
any chance to reset counter? mine just rooted yesterday. damn
[Galaxy Ace II General] gidano:
Thank you! It would be a good solution can be used under Windows ... :)

GT-I8160-ról küldve
[Galaxy Ace II General] arroyo:
@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.
[Galaxy Ace II General] Szaby59:
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.
[Galaxy Ace II General] szczepan2:
By the way... There is no way to download the ROM from THIS site... Loading, loading, and... loading...
[Galaxy Ace II General] Szaby59:
Login first -> blank screen -> go back and refresh > download firmware.
[Galaxy Ace II General] arroyo:
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.
[Galaxy Ace II General] szczepan2:
Maybe the editing ROM is not working because it's Polish? I can't open it too with any archive manager...
[Galaxy Ace II General] Szaby59:
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.
[Galaxy Ace II General] szczepan2:
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?
[Galaxy Ace II General] Szaby59:
I installed on a virtualbox virtual machine, (with 8 GB vhd) for mounting and rooting follow the steps from 1st post.
[Galaxy Ace II General] mastermid:
@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:

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.
[Galaxy Ace II General] Szaby59:
It shows ext4 filesystem.
[Galaxy Ace II General] szczepan2:
cloudm33 samsung # mount -t ext4 system.img /mnt/system/

mount: Filesystem error, wrong superblock at /dev/loop0 etc.
[Galaxy Ace II General] Szaby59:
Tutorial updated with additional tools and instructions.
[Galaxy Ace II General] Corradossj:
Can you upload also a pre-rooted rom?

For example the polish or the germany stock rom?

Thanks in advance!
[Galaxy Ace II General] WiCiO_MeDi:
i have it in

/system/xbin and /system/bin/.ext

:)
[Galaxy Ace II General] oceanserv:
Done, the owner this thread has give me full instruction.

Thank you so much.....
[Galaxy Ace II General] oceanserv:
hi guys,

another question, how add CWM recovery inside the rom when i create pre-root image ?
[Galaxy Ace II General] Dr01nE:
uhh, custom recovery is within the kernel. flashing the image created from this guide won't touch your custom kernel+recovery(currently we have CWM and TWRP)

Sent from my GT-I8160 using my superhuman powers
[Galaxy Ace II General] oceanserv:
Thanks for information. Would you give me the link of your custom rom include CWM or TWRP ?

Seems your your Ace2 Stok is the same as mine. I used DXLK2 as Original STOK before flashing with pre-root rom using this guide.

thanks
[Galaxy Ace II General] oceanserv:
well i already make up my mine to flashing my ace 2 using pre-root rom...then download superuser from market.

when i try open superuser then its force closed. then try open terminal typing SU then nothing happen.

__________________

update :

geezz what i missed here......I already folow as in guided in 1st post maked 2 pre-root images. one just with su binary and other su binary and superuser apk. headache when running Superuser just give me WHITESCREEN.....nothing happen. accessing Su binary from terminal also nothing....

PLease HELLPPPPP.......
[Galaxy Ace II General] powermetza:
@oceanserv

Flash pre-root image with just su binary.

Enable usb debugging from setting - applications - development.

Then copy superuser.apk to /system/app and chmod 644 it.

If su command do not work in termal, it will work in adb.
[Galaxy Ace II General] oceanserv:
thank you....first time i add Su binary to the /mnt/system/bin then chown root and chmod 06755 then create flashable. trying install Superuser but just whitescreen. then create another image with superuser inside the same problem happen.

then i check my Ace2 setting i forgot tick "usb debugging" then try reflashing again with just Su binary image. the same problem happen. then i decide reflashing again with superuser inside the image file. but before i shutdown my ace2. Then i power up my ace2 to check again if still can get root access, Somehow i dont understand its ROOTED already. superuser running and other app that need rooted access can run.

is it "usb debugging" that i forgot to enable is the root case why my ace2 cant be root ? as you explain above if the su command do not work in internal, it will work in adb, can you tell me more about this since i'm newbie about android.

thanks
[Galaxy Ace II General] yethz:
Can anyone create a pre-rooted rom of

I8160DXLK2

for

Samsung Galaxy ACE 2 (GT-I8160)

... It would be awesome ;)
[Galaxy Ace II General] owl74:
Hi op, I want to try this but i never used linux before but I want to learn. First question, which

Iinux emulator can I use on windows 7 64bit. Second, I want to use SuperSU not SU, whats the command for that if I substitute superSU?

Many thanks
[Galaxy Ace II General] mkel91:
Downlaod virtual box and emulate Ubuntu or any other distribution, use the kitchen to add Super SU or follow the guide using Super SU bin instead Superuser bin..

Inviato dal mio GT-I8160 con Tapatalk 2

---------- Post added at 01:49 PM ---------- Previous post was at 01:48 PM ----------

P.S: you must download Linux cd ISO and install it using virtual box..

Inviato dal mio GT-I8160 con Tapatalk 2
[Galaxy Ace II General] WiCiO_MeDi:
as a linux distro use debian, among many things it's faster on vbox since ubuntu uses unity :mad:
[Galaxy Ace II General] mkel91:
Yes, use Debian.. is faster..

Inviato dal mio GT-I8160 con Tapatalk 2
[Galaxy Ace II General] soraxx:
Building ROMs work with Cygwin on Windows 7.
[Galaxy Ace II General] WiCiO_MeDi:
bah!

don't cut the corners if you don't have to.

emulation is necessary evil :rolleyes:
[Galaxy Ace II General] yethz:
Anyone that is kind to make this one for me :D I appreciate it a lot.
[Galaxy Ace II General] WiCiO_MeDi:
ok, let me be of use, downloading the package..

... update ...

done: I8160DXLK2_I8160OLBLK2_XTE_rooted
[Galaxy Ace II General] yethz:
OMG! You are saviour :angel: Thanks a million for making it... :highfive: Thanks hitted (+rep if possible too)
[Galaxy Ace II General] WiCiO_MeDi:
just another service provided by your friendly neighborhood Spider-Man! :silly:
[Galaxy Ace II General] yethz:
Hahahah.. :laugh: truly bro thanks a lot... It really means a lot for me. :good:

Keep it up :good:

Actually, last night I started to search for devian/linux, and think, what? 1gb download+install a virtual machine+time consume on installing + plus learning the commands (naaahh... next time maybe)

then this morning I saw your upload. WOW! That makes things easy.. Thank you..

EDIT:

Opps.. I forgot to ask; does this includes, SuperSU or Superuser? or I'll have to install it (though I prefer to install it manually)
[Galaxy Ace II General] WiCiO_MeDi:
damn it, if i only knew that you were gona make it yourself..

don't stop now! explore! learn! make something usefull :p

ps.

your deVian(t) is pretty funny too :D
[Galaxy Ace II General] yethz:
Lol... Sorry Im not familiar with it..

Btw, Does it includes supersu or superuser?

Sent from my GT-I8160
[Galaxy Ace II General] WiCiO_MeDi:
supersu v0.98

yesterday was an update to v0.99 so just update the app through Play Store
[Galaxy Ace II General] yethz:
Thank you for guidance and help... very much appreciated... keep that attitude up :victory:
[Galaxy Ace II General] rozyid:
@szaby59

Thanks bro... successfully build preroot for DXLK2...
[Galaxy Ace II General] yethz:
Good for you... but I think you wont be creating DXLK2 if you saw this > http://xdaforums.com/showpost.php?p=35063321&postcount=197
[Galaxy Ace II General] WiCiO_MeDi:
he might've needed a different csc ;)
[Galaxy Ace II General] yethz:
Oww.. Sorry I never thought of that :D

Anyhow, I just flashed my phone last night with your pre-rooted DXLK2. Thanks.. Works fine..

though Im just curious, the kernel Id used is still there. It doesn't reverted back to the original one.

Do I have to flash the original then this pre-rooted? (I already wipe/data/cache)
[Galaxy Ace II General] WiCiO_MeDi:
you're flashing just system partition and kernel is in kernel.bin file which isn't located in /system ;)
[Galaxy Ace II General] yethz:
hey bro or should i call you buddy :angel: Ive learned a lot from your inputs. I appreciated it a lot for all the help you shared.

now another useful tip added. :D thank you.

I re-flash my phone using the home (original) ROM and then wipe data/cache and flash the pre-rooted DXLK2 you've made, now it seems are going all smooth and stable.. If XDA have a +rep I would hit it many times for your effort on helping others.

Im going to say it again, Thank you for all your help. Hope you wont stop assisting our fellow members here.

Have a great day.

PS. Sorry for the bad english. its not my native language :cyclops:

One more thing, if its okay with you, can you re-create DXLK2 without SuperSU? only the su binary so I can manually install SuperSU or Superuser from SD Card or from Play store.

That if you have more free time :D :angel:
[Galaxy Ace II General] soraxx:
Impressive. My ROMS stll have Update binary failed and I unable to solve it.
[Galaxy Ace II General] WiCiO_MeDi:
@yethz

you know, you could just delete the Superuser.apk from the /system/xbin folder after the flashing procedure..

the problem would be the su binary 'cause it's different for SuperSU and SuperUser.

try deleting the apk and installing SuperUser and let me know if it works ;)

@soraxx

still? man, make the rooting procedure and post (in 'CODE') the whole terminal here.

also describe the steps that you do before ./make command.

it's just not possible that it wouldn't work for you if it works for (not only) me..
[Galaxy Ace II General] rozyid:
I know this post yethz... but i want try self... and the result is successfully.... :):):D:D
[Galaxy Ace II General] yethz:
Yeah I also thought of that :o but deleting the .apk on system folders needs root. so, these may the procedure;

install root explorer, grant access when it asks, delete supersu.apk, and then install superuser from play store?

can it be successful? when installing superuser when it can no longer grant an access to install binary files?

I dont know it will be successful but I will try it in the future when I re-flash my phone :D

Me too, I want to make it myself. But my laptop lags when using virtual machine... I hate lags :laugh:

I already tried it but I cannot start with the tutorial because of lags/freezing some time issue :(
[Galaxy Ace II General] Dr01nE:
LOL. I made my own prerooted DXLK2 and I uninstalled SuperSU(installed on system) using Link2SD and reinstalled it from the play store.

For the virtua machine I use my laptop to prerooot. I use ubuntu on virtualbox on windows 7 (so I dont have to reboot to flash the package) I tweaked the settings a little bit: 256MB graphics memory, all possible cpu features and more importantly, make sure you have at least 2.5GB of RAM and dedicate 1-1.5GB to linux. I just use 968MB on mine amd it runs fine, frames drop every now and then but as long as I can work on terminal, then there's no problem. :D

Sent from my GT-I8160 using my superhuman powers
[Galaxy Ace II General] WiCiO_MeDi:
as stated before:

debian is smoother on vbox 'cause ubuntu uses very demanding unity (X enivronment), if you'd like to stick to ubuntu then i would suggest to change the 'dekstop' to xfce (apt-get install xfce4). runs much faster ;)

also take a look at boot up sequence and disable the services that you don't use/need.

anyway.. debian rulez, ubuntu sux :silly:
[Galaxy Ace II General] yethz:
i have 4gb of ram running win7 pro 64bit..

Virtualbox is my fav vbox machine.

No linux installed yet maybe debian soon download it on my day off..

U are always sharing helpful tips every post u make... No space wasted ;)

Sent from my GT-I8160
[Galaxy Ace II General] Eselter:
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

)

In Odin 3 1.85 choose "system_rooted.tar.md5" as "PDA"

"csc.tar.md5" as "CSC"

Check only "Auto Reboot" and "F. Reset Time"

"Start"

Download​

Dev-Host

Zippyshare PART 1

Zippyshare PART 2
[Galaxy Ace II General] tonus76:
Thanks Eselter. Nice work.
[Galaxy Ace II General] rozyid:
I not using virtual mechine... i used "wubi"... is very simple bro... install under windows... we can adjust the size of partition that used ubuntu system ( i use only 5gb)... and make dual boot and your laptop... free lag bro...
[Galaxy Ace II General] soraxx:
I doesn't do "make" because simg2img binary files were builded the first time I made a rooted firmware.

superuser.apk is Supersu 0.9.9

cd samsung
mv system.img.md5 system.img.ext4
./simg2img system.img.ext4 system.img
sudo mount system.img /mnt/system
sudo cp su /mnt/system/bin/su
sudo cp superuser.apk /mnt/system/app/
sudo chown root:root /mnt/system/bin/su
sudo chmod 06755 /mnt/system/bin/su
sudo chmod 644 /mnt/system/app/superuser.apk
sudo umount /mnt/system
md5sum -t system.img>>system.img
mv system.img system.img.md5
tar cf system_rooted.tar system.img.md5
md5sum -t system_rooted.tar>>system_rooted.tar
mv system_rooted.tar system_rooted.tar.md5
tar cf csc.tar cache.img.md5
md5sum -t csc.tar>>csc.tar
mv csc.tar csc.tar.md5
exit
[Galaxy Ace II General] WiCiO_MeDi:
right, was hoping for the output as well ;)

anyway, try copying su to /mnt/system/xbin

i don't see anything else that would make problems here but then again i don't see the terminal output ;)
[Galaxy Ace II General] soraxx:
After extracting system and cache..

Su file also works on xbin

alberto@alberto-Presario-CQ61-Notebook-PC:~$ cd samsung
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ mv system.img.md5 system.img.ext4
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ ./simg2img system.img.ext4 system.img
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ sudo mount system.img /mnt/system
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ sudo cp su /mnt/system/bin/su
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ sudo cp superuser.apk /mnt/system/app/
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ sudo chown root:root /mnt/system/bin/su
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ sudo chmod 06755 /mnt/system/bin/su
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ sudo chmod 644 /mnt/system/app/superuser.apk
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ sudo umount /mnt/system
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ md5sum -t system.img>>system.img
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ mv system.img system.img.md5
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ tar cf system_rooted.tar system.img.md5
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ md5sum -t system_rooted.tar>>system_rooted.tar
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ mv system_rooted.tar system_rooted.tar.md5
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ tar cf csc.tar cache.img.md5
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ md5sum -t csc.tar>>csc.tar
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$ mv csc.tar csc.tar.md5
alberto@alberto-Presario-CQ61-Notebook-PC:~/samsung$

Clean and without errors :(:confused:
[Galaxy Ace II General] WiCiO_MeDi:
right, lets try again:

0. remove ALL files from ~/samsung

1. extract system, cache, ext4 files (from first post) and su, superuser (from supersu 0.99) to ~/samsung

2. start with ./make and proceed with all your commands but try changing:

- sudo cp su /mnt/system/bin/su to sudo cp su /mnt/system/xbin/su

- sudo chmod 06755 /mnt/system/bin/su to sudo chmod 06755 /mnt/system/xbin/su

- sudo chmod 644 /mnt/system/app/superuser.apk to sudo chmod 0644 /mnt/system/app/superuser.apk

3. after completing all the procedure, extract system.img from system_rooted.tar.md5 and mount it again

4. check if /mnt/system/xbin/su and /mnt/system/app/superuser.apk is there and have correct permissions

5. if yes then flash the system_rooted.tar.md5 if no then we need to look for the error elsewhere

You're on vbox, cygwin or pure linux? I assume Ubuntu 'cause you use sudo.

Computers are binary so there's no way for this procedure to work for some and not work for others...
[Galaxy Ace II General] soraxx:
I noticed that other files on xbin has "2000" as owner instead of "root". Could it cause problems?

EDIT: Supersu gave me "Installation failed" again. :( I have to install Superuser to allow Supersu to update su binary.
[Galaxy Ace II General] WiCiO_MeDi:
su has to have root:root permissions.

you did everything from the start and still get errors? then maybe your environment is flawed?
[Galaxy Ace II General] tonus76:
Wicio can you make prerooted rom of latest Nordic from November I8160XXLK6_I8160OXXLK1_NEE:

http://www.hotfile.com/dl/183374365/785c4b1/I8160XXLK6_I8160OXXLK1_NEE.zip.html

Thank you.
[Galaxy Ace II General] WiCiO_MeDi:
why do you need Nordic if you're from Bulgaria? :)

there's already rooted LK6: http://xdaforums.com/showpost.php?p=35168291&postcount=218

... UPDATE ...

Just checked and NEE, SEB and XEO LK6 firmwares are IDENTICAL!

There's not a single bit that's different between those three (binary comparison).

Weird, right?
[Galaxy Ace II General] tonus76:
I'm not familiar with the differences but Nordic is the most stable for me and it works without lag unlike Poland and Bulgaria.