yashsingh1/xdaforums huggingface dataset:
[Sony Xperia M] mbc07:
UPDATE: check out TowelRoot app by [MENTION=3280118]geohot[/MENTION]! One-click root solution that works with latest firmware released for Xperia M single/dual (provides half-root only, don't forget to apply root fixer)

Nicki Root is deprecated, it got merged in my new dd Flasher tool and works across many devices, not only Xperia M. The attachments and changelog from Nicki Root were kept below for archiving history, but I won't provide support for it anymore. For any problem you may encounter, go to dd Flasher thread. If you want to root Xperia M through dd Flasher, downgrade your device to Android 4.1 or 4.2.2 firmware, root it with Cydia Impactor and follow the instructions from dd Flasher thread.

Changelog

Version 2.0

• Nicki Root now is called dd Flasher

Old versions

Version 1.3.3

• Bugfixes for Linux script

• Updated SuperSU to 2.02

Version 1.3.2

• Make sure the temporary folder exists before pushing the script

Version 1.3.1

• Now compatible with Linux

Version 1.3

• Implement log capabilities (users can pull last log by selecting appropriate option in main menu)

• Drop "reboot in flash mode" (after using dd, system partition layout is different and device can't be rebooted)

• Check if LED can be used to indicate status, otherwise disable it

• Minor code changes

Version 1.2

• Rewrote most of the code

• Script now uses LED to indicate status

• By popular demand, dropped choice command in favour of set command (should work with Windows XP again)

• For every single command, script will now check if it failed or not and warn the user if anything get wrong

• Rewrote the mount/umount routine, loop device is selected automatically and resource busy issues are fixed now

• Can be used with half-rooted devices now (script check if device is fully rooted and apply root fixer at runtime if needed)

• Implemented "reboot in flash mode" command to avoid needing to pull/reinsert battery manually (experimental, sometimes doesn't work)

Version 1.1

• Make sure busybox is installed after first boot (previous versions pushed busybox but didn't install it)

• Drop choice32/choice64 applets and use built-in OS command (Windows XP no longer supported)

Version 1.0.1

• Typo fix (Nicky => Nicki)

• Updated busybox to 1.22.1

Version 1.0

• Initial release
[Sony Xperia M] arnabJ:
Will test as soon as Indian Firmware Update show up...
[Sony Xperia M] paper13579:
Well done [MENTION=5604590]mbc07[/MENTION], this is great news. Dont forget to give credit to [MENTION=2739716]joemarshall[/MENTION], afterall, he cane up with the idea :D. Thanks for testing it and creating this thread, nevertheless

sent from wadiya using my mafroom
[Sony Xperia M] gamer649:
I'll be trying this (probably) in the next hour, I'll post results for the Single SIM afterwards.

RESULTS TIME: This method of rooting worked and I am now running 4.3 with root access. Thank you.
[Sony Xperia M] rizla2:
Gonna test after I download 4.1.2 ftf, hope it works :P
[Sony Xperia M] gamer649:
It works perfectly, I'm now rooted on 4.3 thanks to this. The only error I had was when the tool first tried to push the system.ext4 to the SD Card, it said there wasn't enough space, I just deleted the incomplete copy and then ran the tool again and it worked.
[Sony Xperia M] joemarshall:
Hmm, I'd not thought of mounting the image and doing dd, that is pretty tidy.

Balls, It didn't work for me first try, error mounting the loopback device, said it was busy. I'm re-flashing the phone back to 4.1 now. I've split the shell scripts into 2, first one does the modifications of system.ext4, second one does the dd flash, with a press any key between. That way if the modifications to system.ext4 fail, you're not stuck with an unrooted phone where system partition has already been written, and you can happily start again. I was flashing from sd card if that makes any difference.

Also, would it be possible to copy the reboot executable into your temp folder before you do the dd, so that you don't have to do the battery out reset in the middle of the process, or won't reboot work once you're in that state?

Edit: Second time lucky, thanks ever so much. Maybe I just needed to start from a blank slate version of 4.1, blimey that first boot takes some time though!

cheers,

Joe
[Sony Xperia M] ososmam:
It worked for me thanks to you :D
[Sony Xperia M] iks8:
About flashing 4.3 can I do a data and cache wipe?

Wysłane z mojego GT-P3110 przy użyciu Tapatalka
[Sony Xperia M] Pacjonek:
Flashtoll wil wipe data and cache when you flash 4.3 You don't need to do anything else.
[Sony Xperia M] mbc07:
I still need to rework the OP, many people from Root for FTF 4.3 Update 15.4.A.0.23 LOCKED BOOTLOADER deserves credits, after all I wouldn't have that idea without their replies... Will get these guys credited in the OP soon

Thank you for the feedback, I'll try to add some sanity checks before using dd. About reboot, I tried using busybox reboot but nothing happened, the same for adb reboot. Apparently after using stop, the reboot command doesn't seems to work
[Sony Xperia M] mbc07:
Uh, I forgot... Anybody tried pushing to SD Card? Did it worked?
[Sony Xperia M] gamer649:
Yes it did, sort of. The first time I did it I got an error saying there wasn't enough space (I had over 10GB free however). Once I got the error I deleted the incomplete file from my SD Card and then I ran the script again, this time it copied the file fully and then installed properly.

This occurred on the Single SIM C1905 Xperia M by the way.
[Sony Xperia M] iks8:
Yes! Finally rooted. Thanks a lot!

Btw don't forget to change usb mode to mtp instead msc (I've tried msc and it can't copy files)
[Sony Xperia M] Pacjonek:
At first time i've had also 'mount: mounting /dev/block/loop0 on /data/local/tmp/system failed: Device or res

ource busy'

Flash new, clean Android 4.1 solve problem.

Thank you very much.
[Sony Xperia M] paper13579:
Hey guys, does this give you full root?

sent from wadiya using my mafroom
[Sony Xperia M] gamer649:
Yes it does.
[Sony Xperia M] mbc07:
I'll check about the loop device errors (apparently they may occur in Xperia M single SIM), thanks for reporting guys...

Yes. I implemented the disable ric service method from [NUT] root fixer too ;)
[Sony Xperia M] paper13579:
Man, this is a great achievement, you should be proud. Im about to try it now. Wish me luck:D

sent from wadiya using my mafroom
[Sony Xperia M] Pacjonek:
Before your script use dd it should check:

1. That there is no any apps mounted in /dev/block/loop0 (for example Swift Key). If yes, you will see 'mount: mounting /dev/block/loop0 on /data/local/tmp/system failed: Device or resource busy' (you can it by type losetup)

2. Phone is in MTP USB MODE. If you set to memory storage mode, Android will not access to sd card with system.ext4 image (script would check that can it access to /sdcard) and you will get mount argument error
[Sony Xperia M] paper13579:
If you want, there is a step by step tutorial on how to do this process on page 9 of this thread by me. Follow it exactly but if you have a single sim, then, every time the tutorial tells you to download a firmware, you use your own firmwares, for single sim. But if u use dual sim, then just follow it exactly. And dont forget, what helps for me is to use nickiroot version 1.0.1, all the other versions give me a bootloop. Hope this helps
[Sony Xperia M] bukojuice:
no luck

still now not working this is killing me:eek:

---------- Post added at 09:43 AM ---------- Previous post was at 09:38 AM ----------

I've done it before i've rooted it with this method but i got bootloop when i try to flash a mod. when i repeat the process of rooting this would haapen stuck at sony logo after flshing 4.3 ftf it happens 4times and im losing hope pls help me T.I.A
[Sony Xperia M] mbc07:
Provide me more details... Do the script finishes without errors? Are you flashing the entire FTF of 4.3 update (except system) after running the script?
[Sony Xperia M] bukojuice:
luck

no errors after the script sir yes i've flashed entire ftf except system as it was indicated in the instructions i'e done all of it still stuck
[Sony Xperia M] mbc07:
Did you wipe data partition when flashing 4.3 FTF? It's not mandatory but this could cause bootloop...
[Sony Xperia M] yeoldgreat1:
I've got 1.64Gb free on my device yet the root.bat file keeps giving me this error:

ERROR: failed to push some files, make sure you have enough free space then try again.

Any ideas on what I can try?

I originally updated my Xperia M to 4.3 but decided I wanted to root it so I downgraded it to 4.1.2 using the C1905_15.1.A.1.9_GLOBAL-INA.ftf file. I then followed your instructions but get stuck with the storage space issue :(
[Sony Xperia M] paper13579:
Did you connect your phone by MSC or MTP?
[Sony Xperia M] yeoldgreat1:
I'm using MTP.
[Sony Xperia M] itsnie:
I Have error ..

Windows 32 bla bla bla ..

How to fix this?

I'm use nicki root v1.0.1 and my os is windows xp :D
[Sony Xperia M] yeoldgreat1:
I have this error if I use v1.0.1, use v1.1 instead.
[Sony Xperia M] mbc07:
Version 1.0.1 should work without problems in Windows XP *sigh*

[MENTION=2312098]yeoldgreat1[/MENTION] and [MENTION=5788126]itsnie[/MENTION], download v1.0.1 (if you're on WinXP) or 1.1 (Vista and newer) and before running the script, open root.bat with notepad and remove the first line (@echo off). Save and run the script again (this time it'll output a lot of info in the Command Prompt). Copy all output you get until the error and post here so I can see what's going wrong...

EDIT: what's the language of your OSes?
[Sony Xperia M] yeoldgreat1:
For some reason XP was skipping the screen that lets you chose between internal storage and the sd card. I used another laptop with Windows 7 and it worked fine.
[Sony Xperia M] the gladiator:
@mbc07 I suspect that the external "choiceNN" command failed to work in this case; in order to avoid these situations and considering that it's not possible to neglect the XP users because of their number, I strongly suggest you to embed the modified root.bat file I attached here in your package version 1.1 and devote it to XP. As you may remember this .bat file allows to use the package 1.1 with XP with the only drawback that the file system.ext4 must be already stored in the external SD card.

Having said that, being you the OP and the author of the package, I go back in the shadow and I leave the lead to you :D
[Sony Xperia M] n.quan:
when i run file root.bat i got error

Checking for root <look at your device and grant access if necessary>...

USAGE: sleep seconds

usage: hmod [OPTION] <MODE> <FILE>

-R, --recursive change files and directories recursively

--help display this help and exit

unknow id: /storage/sdcard0/system.ext4

how to fix it???
[Sony Xperia M] paper13579:
Have you full rooted on 4.1.2 or 4.2.2 when you were using the script?
[Sony Xperia M] n.quan:
i have full rooted 4.1.2
[Sony Xperia M] spysatha:
Thank you so much OP :o:o

Followed all your instructions, and end up with a rooted Xperia MD (C2004) with Official 4.3 JB

you save my life :D
[Sony Xperia M] itsnie:
Great work mean!

No more error, no more skipping!

Thangs for you n [MENTION=5604590]mbc07[/MENTION]
[Sony Xperia M] Barua:
problem :(

I have this issue:

"Checking for root (look at your device and grant access if necessary)...

Initializing (your phone will die now, don't worry)...

Mounting image...

losetup: /storage/sdcard0/system.ext4

mount: mounting /dev/block/loop0 on /data/local/tmp/system failed: Device or resource busy

Installing SuperSU and disabling ric service...

Setting permissions...

Unmounting image...

umount: can't umount /data/local/tmp/system: Invalid argument

Flashing modified system image (this process will take a while)..."

Flashed two times, tried different firmwares but still same. My OS is windows xp professional sp3. 1.0.1 didn't work, I used 1.1 modified version for xp. Any idea?
[Sony Xperia M] mbc07:
Good news for XP users, although I shouldn't care anymore about WinXP, I found a way of bringing support to it again in the next release (and it isn't hackish like the implementation of v1.0.1), so, for the guys having loop device issues or that are stuck in Windows XP, please wait. Hopefully until the end of day v1.2 should be available...

EDIT: release delayed again. Version 1.2 is finished and bug-free (from what I tested), but during "real life" testing I found that unfortunately, if I call an interactive script directly from adb shell (e.g. adb shell "su -c ./root_img.sh"), the user can't send keyboard input to the script (which I heavily rely in 1.2). It's a limitation of adb itself, seen that if the user manually enter into adb shell and start the script, keyboard input works fine (but that breaks script automation, so it's not an option). I'm trying some possible workarounds, so it may take some time until I push v1.2...
[Sony Xperia M] xNarCiik:
its work

Thanx man it's work
[Sony Xperia M] Tiwy57:
Good job !

This method works for me, after 1 fail.

The first time it did not work, I selected the option to put the system.ext4 in the SD card.

Without root, but the copy worked.

I formatted and flashed 4.1.2 and I selected the option to put the file on the internal memory. This method worked.

I'm now in 4.3, thank you <3
[Sony Xperia M] mbc07:
Version 1.2 finally released. The most notable changes is that it bring WinXP support back and completely fix all loop device issues (so, no more "device or resource busy" messages). It also uses the notification light to indicate progress and stop the script if any error is encountered, among other minor changes. Will update OP later...
[Sony Xperia M] Barua:
I will try now thank you so much.
[Sony Xperia M] gottac:
Requirements

• You must be running a firmware which already have root access (like 4.1.2/4.2.2). If you already updated to Android 4.3, this script won't work until you downgrade to an older firmware and root it (I suggest using Cydia Impactor).

Can someone detail how to use Cydia Impactor to downgrade my Xperia M (stock 4.3)? It came with no readme and I don't want to break anything:/

I have no problem with rooting 4.1 and 4.2 firmwares.
[Sony Xperia M] Barua:
You must flash 4.1 stock firmware with flashtool then make full root, after that continue to instructions in this thread.
[Sony Xperia M] gottac:
This is the flashtool from the official Sony Website yes? Thanks for the reply
[Sony Xperia M] mbc07:
Starting in v1.2, Half Root also works now :victory:

No, it's FlashTool by Androxyde. Grab a FTF of 4.1/4.2 firmware, flash it, enable USB Debugging and then run Cydia Impactor. After that, use Nicki Root and you're done...
[Sony Xperia M] ananthtcr:
I have Xperia M Dual C2004,

I need the firmwares 4.2.2 JB and 4.3 JB in indian version...

can you please give the link.....
[Sony Xperia M] attitude_killer:
Thank! Man... It's work foe me...

Xperia m dual c2004
[Sony Xperia M] ananthtcr:
Im not getting root access..

i followed your instruction, not getting any error msg till the complete process..

i donno wat is wromg..

can u help me??

see the attachment images below ...

these are the error msg i got from supersu and busy box applications...
[Sony Xperia M] ewoks1978:
nice .... everything works perfectly

thanks man :victory:

sony xperia m c1905
[Sony Xperia M] mbc07:
After running the script you must flash 4.3 FTF but you need to tick "exclude system". If you forget to exclude system, su binaries will be wiped and you should start the process again from the beginning...

(one more thing, no need to install SuperSu or Busybox after using the script, it'll take care of that)
[Sony Xperia M] ananthtcr:
I got succeed at 2nd attempt...

Thanks....

[MENTION=5604590]mbc07[/MENTION]

So shall I uninstall Supersu and busybox applications??
[Sony Xperia M] mbc07:
[MENTION=5815222]ananthtcr[/MENTION], SuperSU is required and is a system application installed by the script, so you don't need to do anything...

Same for Busybox, it's required for the rootfixer so it's automatically installed when running the script, so, no need to install Busybox app...
[Sony Xperia M] DunnoWTFImDoing:
Are there any native English-speakers that can help me root with 4.3 without downgrading? Will there eve be a one-click root method? I don't want to brick my phone, and just about all methods are written in broken English and it is already a hard-to-understand process.
[Sony Xperia M] mbc07:
At the moment, the only way to root without downgrade is unlocking bootloader, flashing CWM and then installing SuperSU ZIP package through it. Since it requires unlocked bootloader, it's not an option for users with locked bootloaders or users that don't want to void warranty (some proprietary Sony apps also stop working after unlocking bootloader because DRM keys get wiped in the process).

One-click root methods always rely in some security bug or exploit to work, and unfortunately, all currently known exploits are fixed in 4.3 update. In other words, unless someone discovers a new exploit, we'll need to stick with CWM Recovery or Nicki Root methods.

Anyway, at least for Nicki Root, [MENTION=5482320]paper13579[/MENTION] wrote very detailed instructions in page 9 of this thread (I think), for v1.2 you can use that method too (just skip the step asking to install Busybox app from Play Store).

I plan reworking the OP with more detailed instructions soon, maybe I get [MENTION=5482320]paper13579[/MENTION] guide as base for this...
[Sony Xperia M] DunnoWTFImDoing:
So I will need to use the code from Sony to unlock my bootloader? Can I backup all of my apps, accounts, and contacts, etc? I heard that if you unlock the bootloader, it wipes the internal SD.
[Sony Xperia M] mbc07:
[MENTION=5851260]DunnoWTFImDoing[/MENTION], first you should check if your bootloader can be unlocked, then you proceed to get you code from Sony. I suggest unlocking the bootloader through FlashTool instead of fastboot, so you can relock it in the future. And yes, you can backup your data first, unlocking bootloader will wipe all data...
[Sony Xperia M] DunnoWTFImDoing:
I have done this, and it is unlockable.

Can I save all of my apps and my desktop configuration too? Do I just copy/paste everything in my internal SD to my computer? The external SD won't be wiped, right?
[Sony Xperia M] mbc07:
Just copying Internal SD content won't backup your apps, contacts, etc. Use the built-in Backup & Restore app or run adb backup -apk -obb -shared -all -system and you're good to go. External SD won't be wiped, but I suggest removing it anyway when unlocking.

This got off-topic, it's my last answer regarding that. If you still have doubts do a search or open a new thread in Q&A section...
[Sony Xperia M] -=W1S3=-:
I'm on 4.1 with half root, will this upgrade with root wipe my data? Do i need to remove the internal sd just to prevent it to be formatted? Thanks

Inviato dal mio Galaxy Nexus utilizzando Tapatalk
[Sony Xperia M] Android Bob:
Yes, it will wipe your data, unless you exclude it from being wiped in Flash tool settings.

In any major upgrade, it's better to start afresh anyway and re-install apps.

You can remove your SD card if it makes you feel better, but it won't be wiped.
[Sony Xperia M] himu_joy:
Done it!!

thanks buddy for ur hard work. i had to downgrade to 4.2.2 according to ur task. and now it works!! i'm with my XM (c2005) 4.3 , rooted with locked bootloader...that means its in warranty ?? doesn't it?

many many tahnks.:laugh:

ques: i didnt wipe data at last flash (4.3).now if i reset factory, what'd be happen to root? remain same?
[Sony Xperia M] anmg:
do not worry. root is stored in the system folder. it remain untuched while factory reset

---------- Post added at 04:31 PM ---------- Previous post was at 03:38 PM ----------

mbc07 what does this error mean?
[Sony Xperia M] mbc07:
[MENTION=4813858]anmg[/MENTION], don't worry, it's just a sanity check that I forgot to escape, so it's output in console...
[Sony Xperia M] anmg:
mbc07

i see. I found it here^

may be better: rm -rf $work_dir/system 2>/dev/null
[Sony Xperia M] mbc07:
The error isn't there, it's a piped rm command called in root.bat that I need rewriting anyway. Everything in main.sh and helper.sh was extensively tested (even in the worst case possible where everything get wrong) and I can assure that's bug-free...
[Sony Xperia M] anmg:
mbc07

I have added some apk to su_nicki.zip

added the respective lines in the # STEP 3: permissions

I wanted to remove odex file (SystemUI.apk replaced, and odex file couse an error)

unfortunately could not get the command working in the same section

I used like this

rm -r -f $work_dir/system/app/SystemUI.odex

may be I missed something?
[Sony Xperia M] mbc07:
I suggest doing that manually instead of messing with Nicki Root code. Get your system.ext4 and mount it in a Linux-based OS, edit the contents here and then use the system.ext4 you just modified with Nicki Root (use an unmodified version to avoid file conflicts). Assuming that you're in Ubuntu, you can follow these steps:

1) Open Terminal and type that to mount the image and open file manager with root so you can edit the contents:

sudo mount -o loop -t ext4 /path/to/system.ext4 /path/to/empty/directory
sudo nautilus /path/to/empty/directory

2) A folder with all contents of system.ext4 should open. Do whatever you want here (add, replace, delete), just make sure you leave some space free (system partition of Xperia M has 1.3GB, I suggest leaving at least 50 MB free). After you're done, close all instances of File Manager (to prevent "device or resource in use" when unmounting) and proceed to next step

3) If you just deleted files, then go directly to step 4. If you've replaced files or added new ones, make sure they have correct permissions/UIDs/GIDs, you can do that now by using sudo chmod and sudo chown commands in Terminal. You can also view the permissions and UID/GID of the files by using ls -l too. It's a very important step, some folders are very sensitive to file permissions and not setting them right can even result in bootloops, After that, proceed to next step

4) Unmount the image now by running sudo umount /path/to/empty/directory. Then, boot into Windows and use Nicki Root with the system.ext4 file your edited. I hope releasing a Linux version soon, so we don't need to switch OSes to do this process...

IMPORTANT: don't add SuperUser binaries manually, this will be handled automatically by Nicki Root, since it expects a stock image with no su binaries, Nicki Root may mess up the things if you include them manually...

Well, SuperUser is very old at that point and from what I saw it doesn't receive updates since 2012, so, don't expect it being included in Nicki Root. From what you said, all apps lost root access and SuperUser can't update the binaries, unfortunately you'll need to downgrade to 4.2.2 and run Nicki Root again, AFAIK there's no other way around that. After you're rooted again, you can try installing SuperUser directly, allowing it to update the su binaries and then manually removing SuperSU's APK from /system/app with a root capable file explorer, but I'm not sure if it'll work
[Sony Xperia M] kivulallo:
And what if i don't wipe /data during down/upgrade? Will i get into bootloop? :/

Maybe after i get rooted i will get Flashify, and try to install the binary from flashable zip...

Thank you btw :)
[Sony Xperia M] mbc07:
[MENTION=4444755]kivulallo[/MENTION] unfortunately you must wipe data to downgrade, otherwise, bootloop. If you're on 4.2 and use Nicki Root to upgrade, then you don't need to clear data (but it's highly recommended)...
[Sony Xperia M] kivulallo:
Ok, thank you. I'll do it this afternoon.
[Sony Xperia M] anmg:
Thanks. No problem. additional staff were added without problem. the only problem is to delete something.

Anyway I do not need it any more at the moment. All removes done manually.
[Sony Xperia M] zenxus31:
Warranty Question

if i root my xperia m(the warranty will be void) ryt?.. but if i unroot it and remove all the apps that i use that needs root access will my warranty be not be affected?? thanks for the one who can answer this.. :rolleyes::rolleyes: