See by the post count, certainly a noob but I think I've done my homework here. I know this is posted in various places with long threads attached but here it is ...
Atrix 4G ATT
I was on 1.8.3 rooted, did the OTA update to 4.5.91. I think I want root back.
Is this thread the safest way to accomplish this?
http://forum.xda-developers.com/showthread.php?t=1138204 (OP)
I'm not concerned with losing any data on the phone as far as media or anything.
abuse away for being new, idiot with android at the moment.
Best and safe way is preinstall method by eval.... Why?
you dont need to unlock your unit it work with lock / unlocked units
So the method referenced in my first post?
1. Flash with RSD (2.3.4 SBF)
Then ...
Hi guys.. here is a useful little /preinstall for you (attached)
Put phone in fastboot mode, then:
Code:
fastboot flash preinstall preinstall.img
fastboot reboot
(older versions maybe need "fastboot -i 0x22b8")
after fastboot & reboot, type in adb ("adb shell") or terminal emulator, exactly:
Code:
/preinstall/dosu
/bin/mount -o remount,rw /system
cp /preinstall/su /system/bin/
chmod 6755 /system/bin/su
PATH=/system/bin:$PATH pm install /preinstall/Superuser.apk
The last step is optional (and next-to-last *should* be unnecessary), as you can install Superuser however you like. In fact, if you've installed it, simply typing "/preinstall/su" is another way to root, and you could then mount /system read-write and copy it into /system/bin.
Many thanks to Brandon & The2d for brainstorming this out in a crazy "there's no way it could be possible" rooting session. There were a lot of harder ways... who knew we'd be so lucky! And thanks to Edgan for the great "dosu" =)
You can find fastboot here: http://forum.xda-developers.com/show....php?t=1138092
Click to expand...
Click to collapse
thanks!
I used this briefmobile method
http://briefmobile.com/motorola-atrix-4g-root
same as you - OTA to 2.3 from stock locked AT&T. Above method worked first time no data loss. YMMV of course.
I specifically did NOT want to use anything related to sbf due to all the warnings about bricking etc. etc.
I'm holding off on BL unlock as right now 2.3 is a great build even with AT&T restrictions/crapware, hoping that the official unlock will drop before stable CM/AOSP builds appear, but you never know lol
I saw this one too but wasn't sure, no issues at all on this one?
EDIT: That was easier than anticipated..... What's next for a noob such as myself? Tech background: UNIX Engineer (AIX/Solaris/Linux) 15+ years *NIX experience. I don't know crap for java, I alright with c, perl, python, korn ....
Related
Just got an RMA from Verizon. I tried the unRevoked method and it fails after reboot. I install the correct drivers and can see the device if I "adb devices" It fails to allow me to "su" or "adb shell mount -o rw,remount /dev/etc.." throws up an error about permissions. Am I missing something? Is the latest firmware preventing me from rooting the phone. Is there a newer method that works best? I tried searching all night and have used 3 root methods. 1 never even got started so I'll neglect to mention it.
ndoggfromhell said:
Just got an RMA from Verizon. I tried the unRevoked method and it fails after reboot. I install the correct drivers and can see the device if I "adb devices" It fails to allow me to "su" or "adb shell mount -o rw,remount /dev/etc.." throws up an error about permissions. Am I missing something? Is the latest firmware preventing me from rooting the phone. Is there a newer method that works best? I tried searching all night and have used 3 root methods. 1 never even got started so I'll neglect to mention it.
Click to expand...
Click to collapse
Have you tried jcase's 1-click method? http://forum.xda-developers.com/showthread.php?t=742228
Failing that, you could also try this method on Android Forums: http://androidforums.com/eris-all-things-root/127861-universal-eris-root-dummies.html
If you are comfortable using adb (which is sounds like you are), there's also: http://androidforums.com/eris-all-things-root/125436-detailed-leak-root-tutorial.html
There's also the "original" root method: http://androidforums.com/eris-all-things-root/53963-guide-stock-1-5-latest-root-2-1-a.html (this is the method I used way back when).
As always, please read carefully and use caution.
Cheers!
Thanks, i'll give those a try later.
I've heard of the news of the unlocked bootloader being availible to Bell Atrix's but it seems as if though there isn't a full tutorial for the Bell unlock, or the internationals. I'm just a bit curious to see if there is a tutorial or anything out there that is in one compiled resource that is strictly for the Bell Atrix?
td;lr noob wants to do this but has no clue, and is confused.
Thanks for any help.
Anouthen said:
I've heard of the news of the unlocked bootloader being availible to Bell Atrix's but it seems as if though there isn't a full tutorial for the Bell unlock, or the internationals. I'm just a bit curious to see if there is a tutorial or anything out there that is in one compiled resource that is strictly for the Bell Atrix?
td;lr noob wants to do this but has no clue, and is confused.
Thanks for any help.
Click to expand...
Click to collapse
I spent a few hours and finally got it unlocked and running Gingerbread (everyone here calls it GB).
Your best bet is to use this: http://forum.xda-developers.com/showthread.php?t=1136261 to unlock your bootloader (follow the newbie section) - link 1
Then this: http://forum.xda-developers.com/showthread.php?t=1138541 to install CWM - link 2
Then to install GB used this: http://forum.xda-developers.com/showthread.php?t=1169409 - link 3
I'm on bell, and everything seems to work right out of the gates except for data which I am working on right now. EDIT: simple mistake, set up APN on phone using information for bell here: http://forum.xda-developers.com/showthread.php?p=13607746#post13607746
Rough steps are as follows:
1) Unlock bootloader (everything you need to know about this will be located in the first post)
2) Backups! I used both mybackup and titanium backup to back up all my data and apps as this will all be erased (I think unlocking the bootloader will root your phone and thus give super user access on things? Mine was rooted previously). In the unlikely event this doesn't root or whatever this is what I did to root my phone before: http://forum.xda-developers.com/showthread.php?t=1070076
3) Install the CWM using the second link and fastboot. Then set up a recovery just in case? I never had to use it, but it seems like the right thing to do.
4) Install the android developer SDK so you can run ADB shell and do the commands as per link three that will tell you which boot file to flash. Information on using adb can be found here: http://www.addictivetips.com/mobile/what-is-adb-and-how-to-install-it-android/
5) Use moto-fastboot (this is different from fastboot used before) to upload the GB rom with the ram fix in link three and then the appropriate boot file (do these both in sequence then reboot phone)
6) You will likely need to moto-fastboot -w to clear cache to end a boot loop.
Hopefully this gives you enough links to get started (I read through each of these fully). Please follow the links and not my rough guide as that is just meant to give you an idea of what I did and is no means meant to be comprehensive or eloquent. Whew, power to the noobs!
If you have any specific questions I will try and help. Remember there is only one rom (as far as I could find) that is working on international unlocked bootloader phones that will provide full ram right now: 2.3.4 OrangeFR with ram fix.
One last thing, once I got low battery the ringer wouldn't stop working. I used ADB shell to restore the four sound files not included in this GB build. I did this by downloading files from the following thread: http://forum.xda-developers.com/showthread.php?t=1171527. Then I followed this to change read/write permissions by typing adb remount (at the end I did adb remount ro to return to read only): http://forum.xda-developers.com/showthread.php?t=745019. Then I used this to figure out how to copy and past files via the adb shell: http://www.londatiga.net/it/how-to-use-android-adb-command-line-tool/. Finally, I copied the following files from the first link (which i placed in my root folder) to /system/media/audio/ui: LowBattery.ogg, Undock.ogg, Unlock.ogg, Dock.ogg. That makes the two files the same. I would be posting this in other places, but I can't yet . Hope this helps someone. Once again feel free to ask me any questions, I actually thoroughly enjoyed figuring all this out. Also, I ran my battery low to test it and it worked.
This walks through the process of rooting a Motorola Milestone X2 running 2.3.6. First off I DID NOT come up with this solution nor did I initially post this in this thread. Many many MANY thanks to all those helped make this a reality (which seem to be Brandon15811, the2dcour, and eval-!) and to Sippi4x4man who posted this information here along with DarkFalconX who posted an addendum to help get it working, and to Tiso who made me aware someone had posted this in the thread. See the bottom for the original links that were posted.
This is the process I used it is slightly different than Dark's and the original link. The standard warning applies here, NEITHER MYSELF NOR ANYONE ELSE IS RESPONSIBLE IF YOU BRICK YOUR PHONE DOING THIS!
PREREQUISITES
You MUST have the ADB drivers for your phone installed which are obtained as part of the Android SDK.
You MUST have USB Debugging enabled on your phone.
You MUST have Superuser installed, which can be found on the Market.
PROCESS
Download the following file (atrix-4g-moto-fastboot-win32.zip): LINK
Extract the zip file to a location that is easy to get to, the original instructions suggested making a Root folder in C:\, however it is really up to you. Just make sure all the files are extracted to the same folder.
Get your phone into Fastboot mode, to do this:
Shut the phone off.
Hold down the Volume Down Button while pressing the Power Button.
After the phone turns on you should see Fastboot at the top of the screen.
Press the Volume Up Button to enter Fastboot mode. Your computer may need to install drivers if this is the first time you entered Fastboot mode, so let this happen BEFORE proceeding.
Start a command prompt on your computer.
Type the following commands:
cd \<DIRECTORY> where <DIRECTORY> is the folder you created. If you created the Root folder in C:\ it would be cd \root.
moto-fastboot flash preinstall preinstall.img
moto-fastboot reboot
Wait for the phone to reboot, once it does so execute the following commands (in the command prompt you should still have open):
adb shell
/preinstall/su
On your phone you should see a prompt to Allow or Deny Superuser access, allow this. Then execute the following commands (in the command prompt you should still have open)
mount -o rw,remount -t ext3 /dev/block/mmcblk0p12 /system
cp /preinstall/su /system/bin/su
chmod 6755 /system/bin/su
Initial links Posted by Sippi4x4man
http://www.xda-developers.com/androi...orola-atrix-2/
http://briefmobile.com/motorola-atrix-4g-root
Closing
I have to again thank everyone who created this process and who made people aware of this. I take ZERO credit I am simply reposting information others have already posted. Have fun!
UPDATES
09/04/2012 - The links for the files were broken, the files needed to root the Atrix 4G are the same as we need so I have updated the link to those used for that, along with tweaking the instructions a bit to match. Thanks to Carl Parker and this post here for the working link. Do not worry that the files are labeled "for" the Atrix 4G, the files do in fact work for rooting the Milestone X2 I just used them successfully.
09/05/2012 - I modified the instructions to flash preinstall.img versus root.img, thanks to aldude999 and sd_shadow for pointing out the error as well as sd_shadow for the new link.
I also need to make sure I give credit where credit is due, skwoodwiva and mastafunk have been extremely helpful in trying to figure out a solution for my phone. I can't thank you guys enough, I apologize in the fact that I didn't see the personal messages before I let my phone update OTA to 2.3.6. If anything I hope if I can provide the OTA update I can help the community figure some stuff out as frankly I don't have the knowledge. Thanks again guys.
HELP!!!
The same thing happened to my provider. I got a 2.3.6 up date and I was thinking as it was downloading.... crap I am not going to have root access. I have tried several ways. I have tried Superoneclick, the zerg method and I have also tried some other odd ways. PLEASE HELP US FIGURE THIS OUT!!!!! Maybe this will help with other problems with some of the roms I also wanted to add that I have the SBF and I tried to go back to 2.3.5 and it fails. Which means I am stuck with 2.3.6 >.< ANGRY MOOGLE.... ANGGGEERRRR Motorola unlock your bootloader!!!
Sorry for the bad news. I do wish voodoo rootkeeper was was given more credit in this forum as it may have saved you in spite of it's (TO BE NOTED) problems with one custom rom, eclipse. Thanks for the recognition
---------- Post added at 10:33 PM ---------- Previous post was at 09:56 PM ----------
Did the ud negotiation give an option to dl only? tw... where did you get the sbf? Care to post it? Also give details about the rsd failure I assume you used rsd mode down rocker up rocker...
---------- Post added at 11:16 PM ---------- Previous post was at 10:33 PM ----------
Clcrawl so you saved the ota while still on 235. Drama! Man. Post it or send it to me. Change the .zip to mp3 if you have trouble on phone, boat and es file expl used to work w/ multiupload. My last ota ul would not w/ those so I opera'ed a mp3.
i can not post the sbg . It is from ntelos. It has the 2.3.5 build from Daytona. Bassically what happens the phone I phone freezes when I try to reload the sbf. Then rsd fails. I do put the phone in RSd mode and then connect it. Is there something I am missing?
Development forum top sticky sbf tutorial
The problem with OTA root keeper it's that apparently it doesn't place superuser apk back into system properly. So when we all tried to flash eclipse it couldn't set permission correctly inn superuser apk.
it wasn't allowing the system to write to the root files of the ROM.
so basically it blocked itself.
((ooh....and I didn't figure this out lol....me an nitro had a conversation bout it....he figured out I believe while trying to mess with three razr and it's OTA update)
Which roms are effected?
skwoodwiva said:
Which roms are effected?
Click to expand...
Click to collapse
Pretty sure all of them.
Since don't they all include superuser apk and binaries in the updater scripts?
A work around would be to remove superuser things from the script and then after ROM install use root keeper again to restore superuser.
Easier to just use zergrush IMO
That is at least until we run of ways to obtain root on OTA lol
Whoa....... wait.. there is a X2 2.3.6 OTA dropping down?!?
lordforex said:
Whoa....... wait.. there is a X2 2.3.6 OTA dropping down?!?
Click to expand...
Click to collapse
Milestone x2
Not our x2
ashclepdia said:
Milestone x2
Not our x2
Click to expand...
Click to collapse
Ouch... missed that part. lol
Motorola Milestone X2 OTA 2.3.6 Link
For those interested, here is a link to the Motorola Milestone X2 2.3.6 OTA Update:
http://www.multiupload.com/6L3UU9P28J
Many thanks if anyone can help me get root back, at the very least I was able to Freeze Apps to make the phone far more responsive. This is what happens when you get drunk and are playing with your phone, you let an OTA update get applied ;-).
I am in the same boat with my Milestone X2 (Bluegrass Cellular). Had root at 2.3.5 with a variant of zergrush. Lost it with an OTA I let slip through (2.3.6). No method has had any luck fixing it (Hellion blue flames message on zergrush). If anyone comes up with a fix, please post it. Thanks.
I have a Milestone X2 on Ntelos. Seen some people rooting with 2.3.5, any ideas on how? Read posts on one way that had worked with others but could never get it to work with mine.
Manula Root Method
Scroll to the bottom of the OP and look for the Manual Root Method stated there. Have you guys tried this?
Has anyone tried the D3 1 click rather than zerg rush. It's older but I havent heard of it breaking yet.
This did not work. I tried the commands by hand the point where you do the following you are getting permission denied so I presume the exploit is supposed to happen before it when you are creating a symlink (ln -s):
$ mv /data/local.prop /data/local.prop.bak
mv /data/local.prop /data/local.prop.bak
failed on '/data/local.prop' - Permission denied
$
After that is is all fail. So I guess previously moving the 12m file or whatever it is, removing it and then moving it back created the exploit?
aceoyame said:
Has anyone tried the D3 1 click rather than zerg rush. It's older but I havent heard of it breaking yet.
Click to expand...
Click to collapse
Pete's fails to give you temp root unfortunately so it fails. Which is effectively what the manual instructions are from what I can tell. We just need some exploit to offer temp root via ADB and then you can get su in place and it is over. It appears the only thing that worked in 2.3.5 was Zerg and the "fixed" that. If anyone knows how the developer of Zerg is I would love to talk to them to see what exactly was being exploited.
Peperm1nt said:
Manula Root Method
Scroll to the bottom of the OP and look for the Manual Root Method stated there. Have you guys tried this?
Click to expand...
Click to collapse
I'd like to sign this petition too...
I'm glad to see some people talking about this! Just moved to this phone from an HTC desire and while I love the screen size & internal memory it has been quite a blow to move from cyanogenmod 7 to the slow jerky OS that this appears to have - after all it was touted as being faster! And there is no way for me to get root because right from the store I got 2.3.6. I've tried a couple of exploits including the zergrush one, and doing it manually via adb as mentioned already in this thread. I'd lover to get some help with this!
Also, what is the difference between the Droid x2 and the milestone x2? I have searched but have not found... Other than that updates get rolled out at different times perhaps.
- Jon
1) I restored my nandroid backup thru CWM and reverted back to 2.2.2 stock rom I had at the first place when I got my atrix.
It works fine but the device randomly shuts down and the only way to turn it back on is pulling out the battery. How do I fix that?
2) I heard the only way to get rid of the bootloader logo is to flash an official SBF file.
Is it possible to revert to froyo 2.2.2 using SBF? plus I didnt manage to find the 2.2.2 sbf file over the web, does it exist out there?
Right now I'm on 2.2.2 (restored from nandroid) but the bootloader still appears so I basicly want to go from 2.2.2 to 2.2.2, just this time using SBF
Ultrasagol said:
1) I restored my nandroid backup thru CWM and reverted back to 2.2.2 stock rom I had at the first place when I got my atrix.
It works fine but the device randomly shuts down and the only way to turn it back on is pulling out the battery. How do I fix that?
2) I heard the only way to get rid of the bootloader logo is to flash an official SBF file.
Is it possible to revert to froyo 2.2.2 using SBF? plus I didnt manage to find the 2.2.2 sbf file over the web, does it exist out there?
Right now I'm on 2.2.2 (restored from nandroid) but the bootloader still appears so I basicly want to go from 2.2.2 to 2.2.2, just this time using SBF
Click to expand...
Click to collapse
1) It sounds like your backup is corrupt.
2) You won't get much help around here with sbf files. Too many users were bricking devices, so the sbf files were removed from the forum. The best and safest option to return to stock is to flash a Froyo fruit cake. Otherwise flash a custom ROM.
Atrix Reboot Project
Froyo 2.2.2 fruit cake
upndwn4par said:
1) It sounds like your backup is corrupt.
2) You won't get much help around here with sbf files. Too many users were bricking devices, so the sbf files were removed from the forum. The best and safest option to return to stock is to flash a Froyo fruit cake. Otherwise flash a custom ROM.
Atrix Reboot Project
Froyo 2.2.2 fruit cake
Click to expand...
Click to collapse
Ok. and what about the bootloader? is there a way to hide it somehow?
my warrant ends real soon and Ive got to make a use out of it or my digitizer will stay unfuctional
Ultrasagol said:
Ok. and what about the bootloader? is there a way to hide it somehow?
my warrant ends real soon and Ive got to make a use out of it or my digitizer will stay unfuctional
Click to expand...
Click to collapse
If I remember correctly, the only way to remove the "unlocked" is to flash the Froyo 183 sbf. I do not recommend doing this.
Also, many device owners that have sent their Atrix in for service get it back with an unlockable bootloader. You may want to consider replacing the digitizer yourself.
upndwn4par said:
If I remember correctly, the only way to remove the "unlocked" is to flash the Froyo 183 sbf. I do not recommend doing this.
Also, many device owners that have sent their Atrix in for service get it back with an unlockable bootloader. You may want to consider replacing the digitizer yourself.
Click to expand...
Click to collapse
There has to be a way to hide the Unlocked , maybe flashing white bootlogo? Idk...
Ultrasagol said:
There has to be a way to hide the Unlocked , maybe flashing white bootlogo? Idk...
Click to expand...
Click to collapse
If there was any way to do this, don't you think someone would come up with it already? I gave it a shot myself, no luck.
The white logo doesn't help at all sine the text has black background.
Trust me, this has been made specifically with the intention that it cannot be removed or concealed. There is just no way. Just deal with it.
ravilov said:
If there was any way to do this, don't you think someone would come up with it already? I gave it a shot myself, no luck.
The white logo doesn't help at all sine the text has black background.
Trust me, this has been made specifically with the intention that it cannot be removed or concealed. There is just no way. Just deal with it.
Click to expand...
Click to collapse
Damn.
that really sucks. Hope theyre dumb as much as I think they are and they won't notice that.
Do you know if there's a way to hide the Superuser application? I tried unrooting but the application still exists, I also can't uninstall it for some reason. Any suggestions?
Steps to Unroot
Ultrasagol said:
Damn.
that really sucks. Hope theyre dumb as much as I think they are and they won't notice that.
Do you know if there's a way to hide the Superuser application? I tried unrooting but the application still exists, I also can't uninstall it for some reason. Any suggestions?
Click to expand...
Click to collapse
When you rooted your phone, Superuser.apk was installed as a system app to prevent it from being removed.
I found manual steps to unroot that you can try, but I have not confirmed them working. This assumes you used the preinstall method described in that post, but I think it should work regardless. Here's the steps from this post from Atrix Forums:
You must still have full root access to accomplish this. This will remove root access and also erase the traces (most) of root access from your phone. There may still be evidence on log files, but that's something I cannot help with.
First, start by downloading Android Terminal Emulator from the Market
This will only apply to the /preinstall root method posted above as different root methods place files in different locations, but if you know where they are located you can use the same methods to remove them.
I'm going to use the Terminal to delete everything, but you can also accomplish the same thing using Root Explorer or another root file manager.
Un-root Steps:
1. Open Android Terminal Emulator (see download link above)
2. Type in the following commands, hitting ENTER after each line of code: (after typing 'su' below, look for the Superuser request and approve it, you can only continue if you get the # prompt.
Code:
su
mount -o rw,remount /dev/block/mmcblk0p12 /system
mount -o rw,remount /dev/block/mmcblk0p17 /preinstall
rm /system/bin/su
rm /preinstall/sqlite3
rm /preinstall/dosu
rm /preinstall/Superuser.apk
rm /preinstall/su
reboot
3. Let the phone reboot fully and then go into Settings > Applications > Manage Applications > find Superuser and uninstall it just like any other app.
4. You're un-rooted and all files that /preinstall put on your phone have been removed.
Click to expand...
Click to collapse
Ultrasagol said:
Damn.
that really sucks. Hope theyre dumb as much as I think they are and they won't notice that.
Do you know if there's a way to hide the Superuser application? I tried unrooting but the application still exists, I also can't uninstall it for some reason. Any suggestions?
Click to expand...
Click to collapse
Go to Manage Applications and uninstall su updates. Then use a root level file explorer to go to /system/app and delete su. Might not work if you successfully unrooted. Might have to re-root.
Can someone give me some straight directions on how to flash an official 2.3.4 SBF on my international atrix?
Im taking full responsibility for this in case anything happen I take all charges. I might have a low posts count but I'm not newbie I'm into all of this for a long time, I just don't post a lot. I mostly read and learn.
Bump.
Someone?
SBFs are dangerous, I guess most people have learned to avoid them. That's why you're not getting any responses.
Ultrasagol said:
Can someone give me some straight directions on how to flash an official 2.3.4 SBF on my international atrix?
Im taking full responsibility for this in case anything happen I take all charges. I might have a low posts count but I'm not newbie I'm into all of this for a long time, I just don't post a lot. I mostly read and learn.
Click to expand...
Click to collapse
Thats why I mentioned Im taking full responsibility for that.
My atrix digitizer is barely functional I gotta take it the company to have a fix under warranty and thats why I need to flash this SBF so bad - I need the "Unlocked" in boot to disappear
Hi I need the combination and firmware for the Samsung Galaxy SM-J337PVPU3ASC1
I flashed it with a combination file.. but now I'm stuck in the factory binary mode so I need to flash it again
with the stock firmware or whatever to get it working again
Was trying to do a google bypass and kinda goofed because I couldn't find the right firmware :/
If anyone could help me out I'd appreciate it!
I did same, on accident though, trying to bypass fpr lock after factory reset...honestly i think this phone is ****, being as nobody seems to know anythang bout it. I called asurian and got free replacement.
SaitoSama said:
Hi I need the combination and firmware for the Samsung Galaxy SM-J337PVPU3ASC1
I flashed it with a combination file.. but now I'm stuck in the factory binary mode so I need to flash it again
with the stock firmware or whatever to get it working again
Was trying to do a google bypass and kinda goofed because I couldn't find the right firmware :/
If anyone could help me out I'd appreciate it!
Click to expand...
Click to collapse
I did the same exact thing, so far I've figured out that with that being the newest flash of combination we upgraded the bootloader to binary 3 now, the only firmware that will work is going to be the PVPU3ASC2 which is April's update but online you have to have membership or pay to download, unless that's all a scam? I just did this same wipe on a j327p and had no problem going up from binary 2 to 3 and flashing stock ROM. But from what I understand there's a way to just turn factory off in the combination ROM. I've spent hours pouring over different avenues to go. I was going to change device id to j337U being the unlocked version but I'm getting stuck on gaining SU permissions in the Shell with this new factory binary ROM. I can get adb shell while it's running and side load from recovery but nothing installs or flashes. I believe it's running a sort I emulated VM instead of running ON the phones persistent memory.
FINALLY someone to talk to about this specific problem. It was my fault flashing the U3 combo instead of the U2arj2 I should've.
Attaining root J337p? Dirtycow?
To gain su permissions after reflashing stock have you tried using the dirtycow exploit. I have found it to be an almost fool proof method to attain temp root and for flashing twrp or cwm. Depending on the phone you may have to modify the source a bit but basically jus go to github and download the dirtycow zip or if your using Linux then use git clone and clone the Repository then extract it rename to whatever you want i use the simple dirtycow. put that and accompanying files on the root of the phone (/sdcard) . now use ADB push to push it to /data/local/tmp. Then ADB shell cd into /data/local/tmp and chmod 777 *. Once thats done depending on your phone its gonna be a little trial and error but use ./dirtycow /system/bin/applypatch /data/local/tmp/(the name of your dirtycow applypatch file). Then the same process with app_process or app_process64 depending on the phone. Reboot. That should take SElinux to permissive. Here is where things get tricky. ./dirtycow /system/bin/run-as /data/local/tmp/(name of your dirty run-as file). If you have the exact dirtycow applypatch file for your phone then proceed to thw next step otherwise do whatever mods you gotta do to get your file right. Now run-as exec ./(dirtycow)-applypatch boot. Once that is finished run-as su and presto you have temporary root to do whatever you feel like. I do the next step manually if youd like to. Download the appropriate twrp for your phone name it something memorable like twrp.img and move it to the /sdcard root of your phone. now su dd if=/sdcard/twrp.img of=/dev/block/bootdevice/by-name/recovery. Reboot to recovery and you should be free to flash a permanent root method like chainfire supersu or magisk. And that is that. But i warn you not all phones store the recovery image there you may need to search around a bit. I use su ls -al /dev/block/bootdevice/by-name or cat /proc. Between those 2 i usually can find where it is. I claim no responsibility for bricked phones. Thank you. I will be doing this to my j337p later today ill let you know what i come up with
Ps. If your phone is relatively new its more than likley it has a property called dm-verity which is enable that is a huge pain and causes encryption to fail while flashing. There are .zip files online i believe called dmverityopt.zip or something to that effect i suggest flashing that before and after any custom rom flash. Or a custom kernel that doesnt have that problem.