yashsingh1/xdaforums huggingface dataset:
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] osm0sis:
Alright I'm giving up on this for now but if anyone has any info on "de-lokifying" images please mention me to get my attention. Happy holidays.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] vijovame:
Im stuck in this part

dan@pc:~$ loki_patch

Usage: ./loki_patch [boot|recovery] [aboot.img] [in.img] [out.lok]

dan@pc:~$ loki_patch recovery aboot.img cwm.img cwm.lok

[+] Detected target AT&T build JDQ39.I337UCUAMDB or JDQ39.I337UCUAMDL

[+] Output file written to cwm.lok

I downloaded loki from github but i cant make it run im my ubuntu 12.04 terminal, im not expert in command line but with a little push i will do it

Please help, i pulled aboot just fine. thanks
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] RK:
[MENTION=4544860]osm0sis[/MENTION], [MENTION=4277844]chenxiaolong[/MENTION] knows how to delokify images.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] osm0sis:
Ooh, I'm listening.. :)

Any particular thread, git or tool he's already got worked out?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] RK:
His dual boot patcher here:

http://xdaforums.com/showthread.php?t=2447534

delokifies boot image, extracts ramdisk and patches it to change mount points of partitions to enable dual boot. If you download the patcher, in the directory DualBootPatcher-xxxxxxxxxxx\useful you will find a patch-ramdisk-loki.sh that might be a good place to start.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] osm0sis:
Actually scripts/unlokibootimg.py seems to be where the magic happens. :)

A patched unpackbootimg which allows unpacking loki images was also brought to my attention the other day:

https://github.com/NervGaz/unpackbootimg

and a quick-and-dirty header patch to make the loki'd boot.img work with unpackbootimg was posted in my thread here:

http://xdaforums.com/showthread.php?p=48851378#post48851378

Definitely the more thorough, full unloki would be preferred to retain proper headers and everything, so from first glance I think chenxiaolong's might be the winning option, it's just a matter of compiling to .exe now. :good:

Thanks again for the heads up! :D

Edit: Looks like chen's functions as unpackbootimg as well, pretty cool stuff.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] njdevi11:
Will the loki exploit work on the I337UCUEMK2 bootloader that came with android 4.3 on the ATT s4? I saw the check for the older bootloaders and haven't seen anymention of the new bootloader, can anyone confirm one way or the other?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] jjwatmyself:
No.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] vitorcruzbr:
Would it work on Optumus L9? We have a Qalcomm LK based bootloader, running over a TI OMAP4430.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] Dadud:
I was wondering if i could trouble a GS4 dev to see if it would be possible to get this to work on our Verizon GS3 a number of us took the OTA and are stuck on 4.3 touchwiz.

and you can head here for a thread on what we've tried
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] Jmaserang:
could the loki exploit be used on the at&t moto X [MENTION=4229979]djrbliss[/MENTION] ?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] mike1986.:
Nevermind
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] moparfreak426:
just wanted to day how awesome it is to have devs come up with unlocks and such. if only we can get other newer updates unlocked
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] alphabeast:
Samsung galaxy s4 active i537

Sincé the active has the bootloader locked like almost all the AT&T phones with the kit kat would you have any idea if this will work on the active cause its 4.3 jelly bean
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] arunkm94:
request for further release)
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] Adizzzle:
[MENTION=5382251]arunkm94[/MENTION] Please don't quote the first post, it's not proper etiquette in here in XDA!
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] BlueHarford:
dont mean to jack the thread but dont see anyother way of getting ahold of you, can we get this on the verizon and att S5?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] RockRatt:
This method won't work for the S5 as the bypass was patched by Samsung as of the S4 MF3 firmware. So it is almost guaranteed to be patched still on the S5. (It doesn't work since 4.3 and 4.4,2 firmwares on the S4).

Sent From My Spiderman,Ironman,Red,Dark Blue,Green, GreyedOut BadAss Themed I337
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] poog:
Does anyone know where the "loki_flash" file is ? I cannot find it anywhere on the site https://github.com/djrbliss/loki

And the Master_loki zip does not contain it and seems to be missing in the bin folder.

Anyone know where to locate this? Thanks
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] kL7GtEd:
I'm a pack-rat for all that kind of stuff, so here you are my good sir!

https://mega.co.nz/#!oZRkmThD!Jzb3utjbcgNjoP0wInI_sNufGoD_IurjunffZTkKLQU

md5 864066c796ff7f7f1c0cd9ee014107b4
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] aapav01:
Will it also work for Galaxy grand 2 Sm-G7102... :good: :fingers-crossed:

PLz reply :angel:
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] aapav01:
Plz reply

[MENTION=4229979]djrbliss[/MENTION] plz add a support for Galaxy grand 2 in Loki

djrbliss if u need any file tell me i will dump for u

galaxy grand 2 haves

Cortex-A7

MSM8226

it is locked by secure boot

it is a carrier free device
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] Mr_Random:
I know there aren't any devs for it, but could this be made to work with the i467 Samsung Galaxy Note 8 AT&T? It is stuck on 4.1.2, with no unlocked bootloader available. A couple root exploits have been in use, however, and if combined with loki to give us a custom recovery, maybe a brave dev will look our way to porting some ROMs? I am sure that the lack of sammy updates/unlocked bootloaders have made this device undesirable to devs, but as it gets cheaper and hits the used market, I hope some take hold of its' plusses; stateside GSM Sim capabilities (unlocked could work worldwide), mid-sized tablet with active stylus, expandable storage, and pretty solid hardware specs. Other carrier/uncarrier Note 8.0's are popular enough, and they share hardware specs aside from speaker location I think... I dunno, just being hopeful. I want my Note 8 to be as useful as my gsIII...

Maybe it's time I start fulfilling my dreams of learning more than Basic coding! Ha... quick, someone point me in a FREE direction to learning to hack android/linux!

Thanks!
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] Riku Azhurlar:
hey i have a question.... im trying to use loki to unlock my lg devices botloader that currently isnt supported but i wanted to get the binary running first. everytime i try to run a command it always say failed to find operation to patch or find etc... any help is appreciated
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] sleekmason:
Hate to ask but cant seem to figure it out...

Can I use this on my straight talk s4 that uses att towers, it is baseband s975luduanb1.

And, I was told safestrap was the only thing I could use! I just got the s4 and have rooted, safestrap, optimized etc... But would love to use this to have a different recovery without the safestrap package, and change/create a different kernel for the device.

Basically I need to know if its worth my time and effort to start working on this or if I would be wasting my time.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] kevinco1:
This depends on how long you plan to keep your S4. Every dev, including Hash has admitted the bootloader will never be unlocked and with the S5 out now, less people are working on development for the S4 and those numbers will continue to drop, lessening any chances of a miracle.

If you are fine with Touchwiz ROMs than Safestrap is more than adequate for your needs. Personally, I'm more partial to GE/ASOP and now there is a second ROM now available which is good news. If you still want the S4 100% unlocked, best bet is to find a used TMobile model and configure it for AT&T.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] taz44410:
My s4 is on mf3 is there a way to get this to work on it or am I stuck with ss and tw rom?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] sleekmason:
Eh... Thanks for the info. I've got it pretty well laid out with xposed, bloat removal, and simply changing to deadline and interactive. Not a bad device by any means:) I wanted to optimize the kernel a bit more, but I've no real complaints.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] kevinco1:
Sorry no, MF3 was actually the first firmware release where they fixed the exploit for loki. Lots of users (including myself) were kicking ourselves that we upgraded to MF3, but at the time no one knew the consequences.

I'd suggest upgrading to NC1 and install SafeStrap. KitKat ROMs are much better than anything you are running now on MF3.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] taz44410:
Thanks

I saw a thread with towel root able firmware links and now I can't find it guess some more searching is in my future
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] ndowens:
Curious if this would work on a similar variant of the i377. I have a s975l 4.3. Safestrap works on it at least backup for sure.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] cognitivedissonance:
Some questions about loki

Hi there,

I spent at least an hour yesterday googling up a storm, searching xda and reading like crazy; I'm still not sure I full understand the loki tool, so I'm here to ask some questions.

First some context: I bought a used Verizon Galaxy S4 that has been rooted, ROMed to GPE 4.4.4, runs the alucard kernel, and has been flashed with the NC5 radios, and runs Philz Recovery. I want to go back to square one and do everything myself.

Out of the modifications listed above, I believe loki must have been used on the ROM, the kernel, the recovery, and I'm not sure about the radio flash. I believe certain tools (like GooManager and Clockwork's ROM Manager) apply loki to the packages ahead of time so that the user doesn't need to, however in the forums I have seen times where someone says "oh, this needs to be run through loki first if you want to use it."

Question 1) I feel like this is probably obvious to many, but it isn't to me: is loki something downloaded to the computer and run from there, or is it downloaded to the phone and run from there?

Question 2) Using loki involves using adb, correct?

Question 3) I have used adb before, but only with explicit instructions (ie. I know how to access it, but I can't use it without instruction) - would I be able to use loki if need be? Are there a constant set of steps for using it, or does it vary based on the file you're trying to use it on?

tl;dr

- I guess what I'm looking for is for someone to explain loki to me like I'm 5 and (if possible) tell me how to use it, myself. I've tried reading, but I'm just not fully getting it.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] Locoman_:
You can flash a loki zip right after flashing a file. I keep a copy on my external card. I'm sure you can dig up a copy if you look a little bit more.

I flash tons of stuff and never touched adb.

Loki exploits the locked bootloaded for att phones with the MDB or MDL bootloader. You must have one of them because you have a custom kernel, otherwise you'd be stock or using safe-strap and stuck with TW roms.

.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] cognitivedissonance:
Yup, I guess it's named "loki doki." I had seen it mentioned before but I looked it up after you posted. That appears to be the zip I needed. Also, based on some other information I found, it seems as though certain recoveries (Philz and maybe TWRP) now have an option to automatically flash that loki doki whenever you flash anything, just to make things easier. I checked my Philz recovery and sure enough, that option is checked off for me. I'll still grab that loki doki zip just in case though. Thanks for your help.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] beefwilliams:
Anyone had any success with apply this patch to lollipop kernels? I have tried to adapt developers scripts to create an updated one that works, but without any success.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] FarmGeek4Life:
You can take a look at the repositories on GitHub for jflteatt and jfltevzw for some updated examples (look at the cm-12.0 branches) or download one of the updates for these and pull the compiled loki code out if you don't have a good way to compile it yourself. It should work on any other kernel, and is designed to automatically run loki as part of the flashing process for those devices. It does work on at least the Cyanogenmod jflteatt and jfltevzw lollipop kernels.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] alex-kas:
nec terrain?

Hi there,

LOKI is great. Do you know can it be applied to NEC Terrain? Or other way around: do you know that it cannot by the different nature of the boot lock? For the moment it was a problem that even root (temporary) cannot write to partitions. I found a snaky way and CAN write, so I can flash whatever on the internal memory. I can provide I hope everything upon your request.

Now I'm waiting for other guys to disasm and decompile the aboot binary. Everything suggests that the story is VERY similar or identical to findings in S4, LG, etc. I hope to find the address of the important function myself.

Espetially for LOKI authors: will you, however, be able to help by supporting (or correcting) my findings about the function address. My problem is that I'm quite new for arm, android, etc. I'm pc c/c++/assembler guy.

What might you need? aboot image I guess and the boot image (or atleast it first portion as the image itself is big, 10M), correct?

Thanks in advance, Alex
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] kaasnake:
Any updates regarding bootloader hacking?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] StoneyJSG:
Sadly, no. Loki is the only hack available and will only work with the MDB and MDL bootloaders. It seems that most of the devs have moved onto other newer devices.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] zero061099:
hi one has anyone tried this on GS4a i537? also i cant seem to locate the flash file for loki?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] JarrettG:
Updated of 'Loki-enabled' Version of ClockwordMod Recovery?

Is there a way, or available, to update the ClockworkMod Recovery I'm using of my SGS4 (AT&T) with this solution? It's been on 6.0.4.7 (if I'm remembering correctly) forever.

Thanks.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] przyrodnik35:
Hi!

Could someone port it to LG G4c? I would like to get help by somebody because I don't know how to find a secure key.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] caez360@hotmail.com:
hello i can donwgrade from lollipop 5.0.1 OK2 to 4.2.2 MDK , and flash loky pacht?? and install recovery TWRP ? NO BRICKED THE PHONE TTO INSTALL STOCK ROM 4.4.2 FROM SAMMOBILE ?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] StoneyJSG:
I don't think loki can be ported to another device as it's a bypass for the at&t s4. You can only use loki on that device running the MDB or MDL bootloader.

Once you are on Android 4.3 or later (MK2, NB1, etc.) you cannot go back to a previous version with the exception of NB1 I think it is.

So if you're on Android 4.2.2 you're good to install Loki, any other version is a no go.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] Warrior1988:
Very interesting still.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] BBRecon:
So, if you have an OC4 bootloader for example, it's not possible to downflash to a vulnerable bootloader so that we can exploit this flaw?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] StoneyJSG:
Nope, once you're on jelly bean 4.3 or higher you can't go back to the MDL bootloader.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] Maresorare13@yahoo:
Someone stole. My sim card. Is there a way to retrieve info .
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] s4goa:
no
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] distortedvoice:
Great work. I can finally stop having dreams about its release.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] open1your1eyes0:
Just to confirm this doesn't actually unlock the bootloader to allow recovery and kernel flashes in ODIN? Is this similar to kexec method we had before on the VZW Galaxy S III before the unlocked bootloader was released? As far as I understand it seems this method just helps devs to bypass the aboot security checks by implementing this patch into their recoveries and kernels.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] fix-this!:
i think you nailed it.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] wdouglass:
These .lok files require a specified aboot to function correct? is there a way that the .lok file could include the aboot that it is paired with, and load both in one operation?

Thanks for all your work Dan.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] MrPlNK:
So as long as the ROMS/Kernels/models/etc.. have been compiled with Loki, they will be able to be flashed via recovery? If it hasnt been compiled with Loki, it will brick or be unsafe? Correct me if im wrong as i am far from a dev nor even consider myself knowledgeable in these things. Just trying to get an understanding.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] :
As far as I've heard it wont brick but it wont flash and say that its not an official samsung file ect...
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] djrbliss:
This is possible, but I won't be doing it for two reasons:

1. I don't redistribute firmware due to potential legal issues.

2. I can't guarantee flashing an aboot from one device onto another is safe, and I'm not able to support that sort of thing.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] MrPlNK:
Thats good to know!

Will Nandroids and such be able to flash? Does the backups use loki also when created?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] djrbliss:
loki_flash has been designed to check that the provided image is safe to flash on the device you're running it on. If it's not, it will abort flashing and avoid causing any harm.

If a custom kernel has been patched with Loki, it can be flashed via a custom recovery like any other ROM.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] djrbliss:
You'll definitely be able to flash a Nandroid backup for everything except for the recovery and boot partitions. As for recovery and boot, I suspect that would work fine (assuming the aboot hasn't changed), but I don't know for sure, so I don't encourage you to try it unless you really know what you're doing.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] open1your1eyes0:
Hey Dan, I remember a few weeks ago you had posted a photo of AT&T Galaxy S4 on your twitter that had a cracked code listed on the device. Was this the same Loki method or you were able to actually hack into the bootloader?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] AxAtAx:
get busy sir, kernel time.:)
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] djrbliss:
I'm not sure what you mean by "actually hack into the bootloader". Loki allows me to execute code in the context of the bootloader, which is pretty much the definition of "hacking" it. For the picture, rather than booting a custom kernel or recovery, I had my code cause the bootloader to print that teaser message. So yes, it was the same method, just a different payload.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] open1your1eyes0:
Ahh I see, that's interesting. Do you think there will ever be a way we can flash kernels and recoveries using ODIN or is this method the only option we have really?

EDIT: Just curious, is there any chance of creating a similar method that you had for unlocking Motorola device bootloaders where any user can run it?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] djrbliss:
Not at this time, since ODIN still requires images to be signed by Samsung before it will flash them. But it should be pretty straightforward: you can flash a .lok recovery from an app, and use that recovery to flash Loki-patched update.zip ROMs.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] djrbliss:
Nope. Unlike Motorola, these Samsung devices don't use QFuses to determine the unlock state, so there's no way to blow a QFuse to unlock the device. The only difference between the locked and unlocked S4 variants is that the locked versions have an aboot that does signature checking, while the unlocked variants don't.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] ovoxo.:
Even though I returned my S4, I just want to say great job Dan. Let the fun begin for all you Sammy users!
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] open1your1eyes0:
Very insightful, thank you for the information Dan. You're a great help to the community as always! :good:
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] niv3d:
This is awesome! So is it safe to say this is an official unlock? I don't really know specifics when it comes to this... sorry!
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] fix-this!:
as dan stated this does not touch the locked bootloader at all.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] freemeech:
Thanks Dan! Excited to see what comes about for this phone!
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] :
Right, this allows us to do almost if not everything an unlock would do.

But if we were to get the phone sent out for repair or something and there was an update that patched this, you'd be stuck.

So it has no 100% permanence but coming from an iPhone this is great to me lol
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] muhamet:
Den will this work on international version i9505???
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] fix-this!:
i dont think so. i also didnt know that version was locked up?
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] Veight:
This may be really dumb, but if we flash a new rom such as the CM nightlies. Wouldn't we just have to push the hack again? Or am I just an idiot? Lol. Sorry,
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] spectrumfox:
There's no hack to push. You should really read through the whole post to learn what this is and how it will be used.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] mattdm:
The i9505 is not bootloader locked. If you don't know that already know that, you shouldn't really be messing with any of this.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] mcmb03:
i foresee may bricks in the future for those who just try to flash packages that aren't "loki compatable"
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] k0nane:
This is Dan's PayPal. Send to it.

A reminder to those in media, like I said before, this is NOT the work of "XDA" or "devs". I'm looking at you, Gawker.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] spy890:
The ROMs would have to have this patch applied to them. Like the original post says, the instructions are mainly for developers. So this means, any ROM for this phone that you download would already be patched. So no, just flash the new rom.
[Sprint Samsung Galaxy S 4 Q&A, Help & Troubleshoot] k0nane:
Only kernels and recoveries. ROMs do not need to be patched - only boot.IMG contained within them, if it is.