[TIPS] Fastboot and adb on linux - GT540 Optimus General

I have a tip for everyone who use adb and fastboot in linux.
In most of the tutorials i see that you have go to exac folder to use them, but there is quite simple think you can do to use them from anywhere in your consol. All you have to do is
1. go in consol to the folder where you have adb and fastboot
2. then give command
Code:
sudo nautilus
or
Code:
su
nautilus
This should open a window with root permissions
3. in this windows you need to create shourtcats for adb and fastboot by right click mouse menu.
4. Next you need to cut shourtcats you created and place in folder /bin (you need to do this in the same window beacose you need to have root permissions to paste anything there.
5. And last think you need to do when you paste them it`s change there name`s for adb and fastboot.
Now you can use this commands without "./" and firstly you do not need to go to the folder where they realy are.
Now let say you have an system.img in /home/user/data you can now flash your phone in this way
Code:
su
cd /home/user/data
fastboot flash system system.img
or
Code:
su
fastboot flash system /home/user/data/system.img
su gives root permitions
Now i want to apologize for my english
If any one want to add this to his tutorial please give link for this thread or just write it`s made by me

abrams89 said:
I have a tip for everyone who use adb and fastboot in linux.
In most of the tutorials i see that you have go to exac folder to use them, but there is quite simple think you can do to use them from anywhere in your consol. All you have to do is
1. go in consol to the folder where you have adb and fastboot
2. then give command
Code:
sudo nautilus
or
Code:
su
nautilus
This should open a window with root permissions
3. in this windows you need to create shourtcats for adb and fastboot by right click mouse menu.
4. Next you need to cut shourtcats you created and place in folder /bin (you need to do this in the same window beacose you need to have root permissions to paste anything there.
5. And last think you need to do when you paste them it`s change there name`s for adb and fastboot.
Now you can use this commands without "./" and firstly you do not need to go to the folder where they realy are.
Now let say you have an system.img in /home/user/data you can now flash your phone in this way
Code:
su
cd /home/user/data
fastboot flash system system.img
or
Code:
su
fastboot flash system /home/user/data/system.img
su gives root permitions
Now i want to apologize for my english
If any one want to add this to his tutorial please give link for this thread or just write it`s made by me
Click to expand...
Click to collapse
Sometimes SU alone wont switch to the root user in some distributions (eg. Ubuntu Variants) If you want to switch to root, type sudo su or type "sudo <name of program>" and it will run that program as root.
Jack

Related

Flashing A Recovery Rom..

I have searched this forum multiple times and i can not find my answer so i am posting this hoping someone with some patience will help me.. when i followed these steps.. "III: Flashing a Custom Recovery
Flashing a custom recovery will make your life easier when flashing ROMs in the future.
1. Download this file: Recovery.zip
2. Extract file contents to your \tools\ directory of your Android SDK.
3. Open up a command prompt and go to your tools directory, and execute these commands:
•adb shell mount -o rw,remount /dev/block/mtdblock3 /system
•adb push recovery.img /sdcard
•adb push flash_image /system/bin
•adb shell chmod 755 /system/bin/flash_image
•adb shell flash_image recovery /sdcard/recovery.img
4. Success! You now have a recovery partition installed on your phone. You can access it by running "adb shell reboot recovery" or by powering off your phone, holding "Volume Up + Power On"
It says that what i have typed is not an executible file.. someone please help.
are you 100% sure that you extracted the file out of the zip and not just put the zip into the folder?
yea im sure
Are you typing out each command? or are you pasting them into your terminal? Also, what OS are you running ADB from, and have you had success with it before? Or is the eris your first android device
Also, you did the previous steps first correct? IE: you're ROOTED
there is an easier way posted by i think Zinfab it was something like.
su
adb shell
reboot bootloader
at this point make sure it says fastboot USB on the screen
then in the same window fastboot flash recovery recovery.img (make sure your recovery.img is in the same directory as all your SDK tools)
this worked for me when the method u posted didn't work
where do i type this stuff in at.. i have my phone plugged in usb debug checked i installed the usb driver update it and i have the recovery thing extraced in my tools folder now what do i use my computers command prompt or my phones command prompt
ashertheplague said:
where do i type this stuff in at.. i have my phone plugged in usb debug checked i installed the usb driver update it and i have the recovery thing extraced in my tools folder now what do i use my computers command prompt or my phones command prompt
Click to expand...
Click to collapse
did u set the enviromental variable? its not that important I'm just curious.
if not in command prompt first command would be
(directory to tools)\adb shell
"su"
"Reboot bootloader"
then once its in bootloader
(directory to tools)\"fastboot flash recovery (directory to recovery.img)"
now the quoted sections should be typed exactly as is, without the quotes, but you have to know your own directory.
when i type it in on my phone it says adb not found
whats that
ok my phone now is in fastboot usb mode what do i do know
as suggested, did you set the variable? type fastboot devices to see if its even working correctly, to start.
how do i get out of fastboot usb
Type in the command fastboot flash recovery recovery.img
ok now it says waiting for device
You didn't search that well.
http://forum.xda-developers.com/showthread.php?t=647974
well i went to that forum and it was still giving me problems.. but i got help from spence_moore so its all good
ashertheplague said:
well i went to that forum and it was still giving me problems.. but i got help from spence_moore so its all good
Click to expand...
Click to collapse
What step were you having a problem with? If there is something wrong I would like to fix it.

root Tattoo with Mac

Hey Boys and Girls,
where i can find an manual to root the tattoo with a mac?
sorry, i have search for this, but i cant find information for this
I don't thing that there is a difference.
As soon as you have SDK installed and adb works, the commands are the same.
hi,
i'm also doing all the rooting process from mac, just put the directory contain 'adb' shell into your home/user places and executing it with 'terminal'..
Same here, using a Mac ever since and also using it for Android development. Due to the underlying Unix core of OS X you just have to follow the steps as described for Linux. If it's just adb commands it's the same on every platform anyway.
You might want to add a
Code:
export PATH=${PATH}:/Users/yourusername/android.sdk/tools
to your .bash_profile file in your home folder so you don't have to cd to the SDK tools folder everytime. Happy rooting!
Mod. edit: not dev related, moved to general
Okay thanks for yours answers but i'm a newbie.
the background story is, I want to edit the boot.mp3. Because the startsound is really annoying
So i have download SDK, open the terminal and switch to usb-debbugging mode on my tattoo.
And now? sorry, I'm still missing a few knowledge
thanks for your help
well just use the various adb commands in Terminal Just type in "adb", press enter and you'll get a list of all possible commands. Assuming you've added the path to your sdk tools folder to your bash profile. Otherwise just drag & drop the adb binary from the tools folder onto your Terminal window, et voila.
The most used commands are probably push and pull where you can, well, push stuff to your phone or pull it to your computer.
So if you want to modify the boot.mp3 you would pull the original from the phone to your computer, modify it and push it back, overwriting the original file. In Terminal speak: ;-)
adb pull /system/media/bootscreen/boot.mp3
adb push /path/to/boot.mp3 /system/media/bootscreen/boot.mp3
Please note depending on the ROM you're using the paths may be different. To browse the device via Terminal type in "adb shell" and make a simple "ls" to list the directories, "cd" to change directories etc.
Or if you just want to use another mp3:
adb push /path/to/whatever.mp3 /system/media/bootscreen/boot.mp3
Again, on the Mac you can just drag & drop files onto the Terminal to get their full Unix paths like to your custom mp3
Thanks a lot. i love it its really simple
and now i have load and edit the the boot.mp3. But i can't push it to my tattoo, because i can only read but not write
I have tried to root my phone with "adb root" but it is the message "adbd cannot run as root in production builds"
Terminal: "adb remount", then push again
damn the next bad message "remount failed: Operation not permitted"
You need to root your phone first.
http://forum.xda-developers.com/showthread.php?t=637927
Okay i have executed the instructions. But I've stop at this part:
You should get something like this:
Code:
# id
uid=0(root) gid=1000(shell) groups=1003(graphics),1004(input),1007(log),1011(adb),1015(sdcard_rw),3001(net_bt_admin),3002(net_bt),3003(inet)
uid=0(root) is important.
Click to expand...
Click to collapse
Yes i've root but i'cant download the "su binary" because its doesnt exist.
But its absolute essential to need the "su binary" to only copy the boot.mp3 to my phone? Or there is an other way? What are the commands to push the boot.mp3 back to may tattoo then i'm in the root mode like >> "#".
okay hope you understand me
You need "su" to do root stuff... no other way.
Download the package from 1 click root thread and find "su" there...
http://forum.xda-developers.com/showthread.php?t=644279
now, i have install the su binary. Then i does this command
user:~ user$ /Users/user/android-sdk-mac_86/tools/adb shell
$ /data/local/bin/su
#
Click to expand...
Click to collapse
And now? Is there a comand to push the boot.mp3 back to the phone in this mode >> "#" ?
I have try to open an new terminal window and type
adb push /path/to/boot.mp3 /system/media/bootscreen/boot.mp3
Click to expand...
Click to collapse
but the answer is
failed to copy '/Users/android-sdk-mac_86/boot.mp3' to '/system/media/bootscreen/boot.mp3': Permission denied
Click to expand...
Click to collapse
and adb remount doesnt work to
You also need tattoo-hack.ko file and do insmod tattoo-hack.ko to make /system writable.
Or even better... flash custom amon_ra recovery image and then a custom rom with all this already included.
Mine for example http://forum.xda-developers.com/showthread.php?t=702401
It doesnt have boot sound enabled
Okay thank you very much.
now it was successful

[GUIDE] Linux Ubuntu: Unlocking Bootloader / Rooting Nexus S

One thing I've noticed is there isn't a lot of documentation for getting set up and unlocking your bootloader on a Linux OS. Setting up your machine to get adb and fastboot to recognize your device takes a tiny bit of extra work on a Linux operating system, but what exactly needs to be done may not be clear to everyone. Whether it's because you're new to the Android SDK/adb, somewhat new to Linux, or can't simply can't seem to find the Vendor Code for the Nexus S. (For those who are looking specifically for this, it's '18d1', and I assume will be the same on all Nexus devices to come; If this means nothing to you right now, read on.)
Disclaimer: I take no responsibility if something goes wrong (if it does, it should be fixable though), Unlocking your bootloader voids your warranty (but you can lock it back), Unlocking the bootloader will wipe your entire phone, including USB Storage; so make a copy of all those family photos and other files you may have put onto the USB storage if you want to keep them.
For the sake of sanity, this guide assumes you are using Ubuntu. If you're using something else (or different applications), there are terminal commands offered, and you probably have an idea on how to adapt the given instructions to your Linux OS.
Preparation: Installing the Android SDK, ADB, Fastboot & Setting Up Your Nexus S to be Recognized
1. Download the Android SDK for Linux: http://dl.google.com/android/android-sdk_r08-linux_86.tgz
2. Save it in a folder of your choice. I chose to keep it in my Downloads folder, myself. If you'd like, you can rename it to the simpler name of 'AndroidSDK.tgz'. The rest of the guide will assume that you did, because I'm lazy, and it makes things simpler; it will also assume you saved it in Downloads. If you feel that you have the intuition to rename and edit the path names based on your own choices, then fine; but if you're utterly lost here, just stick with what I'm doing; download to 'Downloads', rename to 'AndroidSDK.tgz'.
3. Now that you have it, navigate to the folder you downloaded it to, right-click, and click 'Extract' to unzip it. If for some reason you cannot do this, open up a terminal and try this command:
Code:
tar zxvf /home/<your-user-name>/Downloads/AndroidSDK.tgz
You may have to adjust the command if you didn't save it under Downloads or didn't rename the file to AndroidSDK.tgz.
4. Now, we'll install adb and some other software packages by starting up the Android SDK and AVD Manager. Start it either by:
- Navigating to your AndroidSDK folder, going to the 'tools' folder and double-clicking the file called 'android'; if a popup opens asking you what you want to do with it click 'Run'.
- Using this command:
Code:
/home/<your-user-name>/Downloads/AndroidSDK/tools/android
5. In Android SDK and AVD Manager, click on "Available packages". Check the box next to "Android SDK Tools, revision 8" and "Android SDK Platform-tools", and click on "Install Selected" then "Install". When prompted click "Yes" to restart ADB.
6.You should now have a folder in /home/<your-user-name>/Downloads/AndroidSDK/ called "platform-tools".
7. Download fastboot here: http://developer.htc.com/adp.html
- Save it to the aforementioned platform-tools folder.
- Now, navigate to the file, right click it, click 'Properties', go to the 'Permissions' Tab and check 'Allow executing file as program'. Alternatively, run this command:
Code:
chmod +x /home/<your-user-name>/Downloads/AndroidSDK/platform-tools/fastboot
8. Now to set things up so adb and fastboot recognize your Nexus.
- Type this command into a terminal:
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
- Paste this into the blank file:
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
- Click save and close.
- Then, type the following terminal command:
Code:
sudo restart udev
9. Almost done with preparations! Run this command:
Code:
gedit .bashrc
And add this line to the top of the file:
Code:
#AndroidDev PATH
export PATH=${PATH}:/home/<your-user-name>/Downloads/AndroidSDK/tools:/home/<your-user-name>/Downloads/AndroidSDK/platform-tools
Then save the file and close.
10. Download this file and save it to /home/<your-user-name>/Downloads/AndroidSDK/platform-tools: http://www.mediafire.com/?4pe5y906zr67nfh
10.We're ready to go!
Unlocking the Bootloader on your Nexus S and Rooting
Once again, unlocking your bootloader wipes everything on your device, including USB storage. Make a backup of any files you want to keep.
1. On your Nexus S, go to Menu>Settings>Applications. Select "Development" and check the box next to "USB debugging"
2. Power off the phone, and then hold down the Volume Up button and the Power button simultaneously to get into Bootloader/Fastboot mode. Connect your Nexus to the computer via USB.
3. Run this command to unlock your bootloader: (Once again WIPES EVERYTHING!)
Code:
fastboot oem unlock
Hit Enter and on your phone you will be prompted to confirm the action. (Use Volume +/- buttons to choose, power button to confirm choice) Confirm. At this point you will have an unlocked bootloader.
4. Copy/paste the following into the Terminal window:
Code:
fastboot flash recovery /home/<your-user-name>/AndroidSDK/platform-tools/recovery-clockwork-herring.img
5. Use the Volume +/- buttons to choose the Recovery option, then press the power button.
6. In Recovery, go to 'mounts and storage' and choose 'mount USB storage'.
7. Go to this page: http://forum.xda-developers.com/showthread.php?t=682828
About 1/5 of the way down on that page, find the link for "su-2.3.6.1-ef-signed.zip", which is the link for the Froyo version of Superuser. Control-click (right click) on that link and choose "Download Link As..." Save that file to your desktop and then copy it to the main directory of your mounted phone.
8. Click 'Unmount'. Go back to 'mounts and storage' and choose 'mount /system'. Then Go Back and choose 'install zip from sdcard'>'choose zip from sdcard'>su-2.3.6.1-ef-signed.zip
9. When it's finshed installing, reboot. You are now rooted.
Special Thanks
Amin Sabet; I used your Mac guide as a reference and copy/pasted some things for convenience.
Koush; For first posting the unlocking information, developing ClockworkMod Recovery, and ROM Manager. You should probably hook him up with a donation. https://www.paypal.com/us/cgi-bin/w...63663d3faee8d9384d85353843a619606282818e091d0
Michael.B.; for suggesting adding the platform-tools folder to the .bashrc file.
Linus Torvalds; Without which we'd have neither Android nor Ubuntu.
Feel free to leave your comments on the guide below.
Good guide for beginners, I would throw in how to update their path so they can just type adb or fastboot
On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ and platform-tools directories to it. If you don't see a line setting the path, you can add one:
export PATH=${PATH}:/home/<your-user-name>/Downloads/AndroidSDK/tools:/home/<your-user-name>/Downloads/AndroidSDK/platform-tools
Click to expand...
Click to collapse
Be sure to update your username above.
Thanks a lot man, great guide. I didn't get my NS yet but this is gonna be very useful soon
ps: someone please stick this
Michael.B. said:
Good guide for beginners, I would throw in how to update their path so they can just type adb or fastboot
Be sure to update your username above.
Click to expand...
Click to collapse
Thanks for the tip. I added your tip and instructions for marking fastboot as executable.
Stuck due to the thread's usefulness
I forgot to ask: will this work for 64 bit systems?
nicholasbgr said:
I forgot to ask: will this work for 64 bit systems?
Click to expand...
Click to collapse
It should work just fine.
Thanks, got me rooted nice and quickly.
BlackOtaku said:
It should work just fine.
Click to expand...
Click to collapse
Yes but don't forget to install 32 libs.
Thanks for guide
Useful !
I'm waiting for cyanogen ROM so i'll able to install
Cheers
To confirm, yes it works on 64bit. I am running that
Thanks for the confirmation, guys
Good stuff, much appreciated.
I'm working on a simple shell script that should automate some of the more menial tasks while holding the user's hand through the process. I should have it up later today.
UPDATE: It's up! Link on the first page.
Sent from my Nexus S using XDA App
question:
If I use
Code:
fastboot boot recovery.img
instead of
Code:
fastboot flash recovery recovery.img
will i get OTA updates?
confiq said:
question:
If I use
Code:
fastboot boot recovery.img
instead of
Code:
fastboot flash recovery recovery.img
will i get OTA updates?
Click to expand...
Click to collapse
Or, I don't get OTA until i change OS with zip file (ex: su app) ?
confiq said:
Or, I don't get OTA until i change OS with zip file (ex: su app) ?
Click to expand...
Click to collapse
You shouldn't flash the recovery in the boot partition, I think that will cause problems with the phone period. :S
If you flash a custom boot.img (which this guide doesn't cover, though the script will flash Superboot) or kernel like Paul's Superboot, Supercurio's Voodoo Kernel, or Koush's insecure boot.img, OTA updates will fail to install. OTA updates will also reflash your recovery back to stock. One of the devs around here will probably start modifying them so they don't check the boot.img or reflash the recovery though.
Thanks for this! Worked perfectly
Hi all,
I have a strange problem. I can install ClockworkMod recovery but, when I reboot the phone, I don't have superuser installed and su doesn't work. If I reboot the phone, I have to install the recovery every time. It seems it isn't permanent.
Thanks
Matroska
matroska said:
Hi all,
I have a strange problem. I can install ClockworkMod recovery but, when I reboot the phone, I don't have superuser installed and su doesn't work. If I reboot the phone, I have to install the recovery every time. It seems it isn't permanent.
Thanks
Matroska
Click to expand...
Click to collapse
To fix the problem, before selecting zip file, you have to select mount /system. Then go to apply update.zip and proceed as usual.
Thanks
ok im stock
with this part fastboot oem unlock ware i put this code in my terminal of my pc ,,i put the cell in fasboot , i intall everiting if i put that code in my terminal
bash: /home/toshiba/.bashrc: line 2: syntax error near unexpected token `('
bash: /home/toshiba/.bashrc: line 2: `export PATH=${PATH}:/home/<your-user-name>/Downloads/AndroidSDK/tools:/home/<your-user-name>/Downloads/AndroidSDK/platform-tools# ~/.bashrc: executed by bash(1) for non-login shells.'
[email protected]:~$ fastboot oem unlock
fastboot: command not found
[email protected]:~$
what can i do or im doing wrong

launcher ?

Tryex to Change the launcher out for lawn chair...however b i still get that stupid Walmart button ! Must i really root and deblout ? Tryed to disable the stock launcher but no go !
first you need the fastboot driver software: MTK Fastboot Drivers: https://online.mediatek.com/Public Documents/MTK_Android_USB_Driver.zip
more info on how to install driver software here: https://forum.xda-developers.com/wa.../how-rooted-walmart-onn-tablets-twrp-t4011659
then get adb: ADB and Fastboot: https://www.xda-developers.com/what-is-adb/
copied from: https://forum.xda-developers.com/android/development/amazing-temp-root-mediatek-armv8-t3922213
Download the current mtk-su zip file to your PC and unzip it. Inside will be 2 directories: 'arm' & 'arm64' with an 'mtk-su' binary in each. Pick one for your device. Differences between the flavors:
arm64: 64-bit kernel and userspace
arm: 32-bit userspace on a 64-bit or 32-bit kernel (will also work in 64-bit userspace)
Connect your device to ADB and push mtk-su to your /data/local/tmp folder
i just used the arm not arm64 that seemed to do the trick.
Code:
adb push path/to/mtk-su /data/local/tmp/
Open an adb shell
Code:
adb shell
Change to your tmp directory
Code:
cd /data/local/tmp
Add executable permissions to the binary
Code:
chmod 755 mtk-su
At this point keep your device screen on and don't let it go to sleep. Run the command
Code:
./mtk-su
keep this terminal/command prompt session open then go to...
download this batch file this user made in this post: https://forum.xda-developers.com/wa...s-general/root-walmart-bloat-remover-t4011639
open it inside making sure it is in your adb folder.
it will remove the sams club, walmart app etc.
mine did not remove the walmart button BUT a user posted on how to do so in the comments this is how you do so.
cd into your directory for adb to do so just open cmd/terminal window type this without quotes "cd filepath" replace filepath with where your adb folder is i usually just drag my folder into my terminal/cmd window and it should just put the proper directory into the window.
now type
adb shell
settings put secure sysui_nav_bar "space,back;home;recent,space"
if that does not work also try going into that window you have open with mtk-su and run
settings put secure sysui_nav_bar "space,back;home;recent,space"
sorry if this post is not descriptive enough first post so go easy on me dont hate me too much just trying to help if you have any questions about this that are confusing please ask ill try to fix them trying to help another user of this tablet as i think that the bloatware on these android tablets is ridiculous and makes the experience terrible so id like to help in anyway possible. Thank you.
Slys13 said:
Tryex to Change the launcher out for lawn chair...however b i still get that stupid Walmart button ! Must i really root and deblout ? Tryed to disable the stock launcher but no go !
Click to expand...
Click to collapse
You can use Custom Navigation Bar without root to remove the Walmart button, but I recommend root so you could use QuickSwitch, and some root tweaks with Lawnchair.
Pix12 said:
You can use Custom Navigation Bar without root to remove the Walmart button, but I recommend root so you could use QuickSwitch, and some root tweaks with Lawnchair.
Click to expand...
Click to collapse
I installed that custom navigation app .apk from a third party website because playstore said app was not compatible with device still right away it asks for root, xposed, or to conect to computer to grant permission when I did use the comand prompt and input the command it said device was not compatible. Cool idea though
Sent from my 100015685-E using Tapatalk

[Guide] OnePlus 8T EASY ROOT (for all unlocked variants)

DO NOT FOLLOW THIS GUIDE IF YOU HAVE ANDROID 12
Visit this thread for more information
________________________________________________________
CAVEAT
I've only tested this on my device running Android 11 (KB2005 / KB05AA), but it should be universally helpful as it's using your own boot.img so there's no need to find a matching package for your variant and os version.
CREDIT
The steps were buried across a few threads, I'm posting this so it'll be easier for others to find the information. All credit goes to xb360, FullOfHell, and TheUnkn0wn.
INFO​The basic rundown is:
Use the semi-broken TWRP package to give yourself temporary su access through adb.
Extract the boot.img your phone is currently using to your pc.
Reboot to OxygenOS, copy over the boot.img you just extracted and then use Magisk to patch it.
Copy the boot.img back to your pc and use adb to temporarily boot your phone with it, giving you root access until reboot.
Use your temporary root access to allow Magisk to patch your internal as-yet unmodified boot.img to give you permanent root.
There seems to be some confusion in the thread, I'll try to clear up what's happening and why:
The primary issue at hand is that you can't root your device without already having root privileges, for security reasons. Without a custom recovery like TWRP, there are a few more steps than usual (but mostly simple stuff).​
Because we don't flash anything with this guide, it shouldn't cause any permanent bootloops if you use the wrong boot.img, if you get stuck in one just power cycle your phone. ​
Updating with OTAs should be the same process as the other guides here.​
Because of changes in Android, devices that launched with Android 10 and above will not allow you to modify the system partition, even with root. This is not a fault of this rooting method.​
Prerequisites:
ADB and Fastboot installed.​
An unlocked bootloader and USB debugging enabled.​
Android 11. (Android 12 introduced problems with this method, per other users. See link at top of page)​
________________________________________________________
STEPS:​
1. Connect your phone to your pc and boot it into fastboot mode. You can leave it connected throughout this guide.
2. On your computer open a terminal/cmd prompt. Set the directory (on your pc) you want to work from, I'm using the desktop:
for Windows, type cd C:\Users\Yourname\Desktop​for Mac, type cd desktop or cd /Users/yourname/Desktop​
Spoiler: How to set up adb and fastboot properly
To usb adb and fastboot commands outside of the folder those programs are located in, you'll need to add their location to the PATH list so your terminal can still find them when it's pointing to a different folder. If you want to skip this step, set the directory to the folder that contains adb instead of the desktop.
3. Next, use the terminal to check which A/B partition is active on your phone:
Code:
fastboot getvar all
a. You'll find it on this line: (bootloader) current-slot:a/b​b. For simplicity I'll be referring to boot_a.img throughout the guide, make sure to use boot_b.img if that's the one marked as active on your device. ​​
4. Download the semi-broken TWRP package to your desktop. We'll be using it to extract a copy of your active boot_a.img. It will give you temporary su access via adb, but there won't be a gui. Only boot from it, DO NOT FLASH IT:
Code:
fastboot boot recovery.img
adb shell
dd if=/dev/block/by-name/boot_a of=/sdcard/boot_a.img
exit
adb pull /sdcard/boot_a.img boot_a.img
adb reboot
5. Copy the extracted boot_a.img file to a user accessible area of your phone, like your downloads folder.
6. Install the latest Magisk Canary apk on your phone. Open it and:
a. Select the Install option.​b. Use Select and Patch a File on boot_a.img​
7. Copy the patched magisk_patched_a.img file back to your computer. In terminal, type adb reboot bootloader to get back to fastboot mode.
8. Temporarily boot with the patched image that corresponds to the active partition, DO NOT FLASH IT:
Code:
fastboot boot magisk_patched_a.img
Spoiler: Why we're booting and not flashing.
You could flash this boot.img, but it's safer to temporarily boot from it without overwriting your existing image in case anything went wrong along the way. The effect is that you still get root access without modifying your device, and then you can use the much safer Magisk direct install option, which has some safeguards in place.
9. By booting with the patched image, you now have temporary root access. To make it permanent open Magisk:
a. Select the Install option.​b. Use Direct Install (Recommended) to root your internal boot.img​
10. Reboot and verify it worked.
Forgot to tag it... if an admin is able to do so I'd appreciate it.
Just applied for a bootloader unlock today. When i get approved ill attempt this guide.
I am currently on T-Mobile 11.0.5.7.KB09CB.
Unlike other methods prvoided here for the 8T I got this method to work. Thank you very much!
clarification update: I own the t-mobile kb2007 model of phone
a couple of notes for any either newBs or old OPO users rejoining the party with a new onplus phone..
Some prework I had to do for my OnePlus 8T KB2005
-ensure you have the correct ADB driver installed, I installed the "15sec adb installer 1.4.2" found here on xda, watch the videos provided.
-ensure to unlock your bootloader first (*this will wipe your device.. didn't think about that..no pain no gain...)
-With device in bootloader/fastboot, run: fastboot flashing unlock
-verify with your phone to accept
-phone will reboot, just through the setup, I just skipped it all and opted for offline setup..
-renable OEM lock and USB debug
-restart back into bootloader/fastboot
-now you are ready to root
Just came here to say that this is the most genius way to go about it and thanks OP for this solution. To add your screen would flicker in TWRP but you just want to type adb reboot bootloader after you are done copying off the boot files from your phone. Thanks OP!
After performing this, I am unable to write to /system even with root?
Unable to get through with es explorer, root explorer pro, or even use a app like Titanium to move a user app to system,unable to get r/w access.
Thanks in advance
lordxcom said:
After performing this, I am unable to write to /system even with root?
Unable to get through with es explorer, root explorer pro, or even use a app like Titanium to move a user app to system,unable to get r/w access.
Thanks in advance
Click to expand...
Click to collapse
I'm having the same issue although its more tied in with removing youtube as a system app for vanced
lordxcom said:
After performing this, I am unable to write to /system even with root?
Unable to get through with es explorer, root explorer pro, or even use a app like Titanium to move a user app to system,unable to get r/w access.
Thanks in advance
Click to expand...
Click to collapse
Actually Is not possible on devices borned with android 10 or above.
giacomowrc said:
Actually Is not possible on devices borned with android 10 or above.
Click to expand...
Click to collapse
To be clear, you're saying this isn't a fault with this root method and is just a security measure since Android 10?
Mpolo87 said:
To be clear, you're saying this isn't a fault with this root method and is just a security measure since Android 10?
Click to expand...
Click to collapse
Yes of course.
Mpolo87 said:
CAVEAT
I've only tested this on my device (KB2005 / KB05AA), but it should be universally helpful as it's using your own boot.img so there's no need to find a matching package for your variant.
CREDIT
The steps were buried across a few threads, I'm posting this so it'll be easier for others to find the information. All credit goes to xb360, FullOfHell, and TheUnkn0wn.
INFO​The basic rundown is:
Use the semi-broken TWRP package to give temporary su access through adb.​
Extract boot_a.img and boot_b.img to your computer.​
Reboot into OxygenOS and copy boot_a.img and boot_b.img back to your phone.​
Use Magisk to patch both images.​
Copy the patched images back to your computer.​
Use fastboot to temporarily boot using the patched image, giving you temporary root.​
Use Magisk to direct install for permanent root.​
Prerequisites:
ADB and Fastboot installed.​
An unlocked bootloader and USB debugging enabled.​
________________________________________________________
STEPS:​
1. Get the semi-broken TWRP .img. This won't give you a gui but will give you su access over adb. You DON'T want to flash this, we're just booting with it temporarily.
2. Restart your phone into fastboot mode.
3. On your computer open a terminal/cmd prompt and set the directory where you want to dump the files (ex: cd /your/path/here). Run the following:
Code:
fastboot boot recovery.img
adb shell
dd if=/dev/block/by-name/boot_a of=/sdcard/boot_a.img
dd if=/dev/block/by-name/boot_b of=/sdcard/boot_b.img
exit
adb pull /sdcard/boot_a.img boot_a.img
adb pull /sdcard/boot_b.img boot_b.img
4. Copy the extracted files to a user accessible area of your phone.
5. Install the latest Magisk Canary release to your phone.
a. Select the Install option.​b. Use Select and Patch a File on both boot_a.img and boot_b.img​c. You should rename them or make note of the new names given by Magisk. You'll need to use one or the other depending on which partition is active. ​
6. Copy the patched .img files back to your computer.
7. Restart your phone back into fastboot mode.
8. On your computer, run:
Code:
fastboot getvar all
9. Find which A/B partition is active on this line: (bootloader) current-slot:a/b
10. Temporarily boot with the patched image that corresponds to the active partition, DO NOT FLASH IT:
Code:
fastboot boot patched-boot-a/b.img
11. You now have temporary root access, to make it permanent open Magisk:
a. Select the Install option.​b. Use Direct Install (Recommended) to root your internal boot.img​
12. Reboot and verify it worked.
Click to expand...
Click to collapse
hey there! I was just about to try this method but confused with this syntax -- don't mind the quotes
"On your computer open a terminal/cmd prompt and set the directory where you want to dump the files (ex: cd /your/path/here)"
I'm painfully confused about this: cd /your/path/here. is this done during fastboot? I know fastboot commands but adb is where my brain doesn't get it. Please elaborate further and thanks.
sameog said:
hey there! I was just about to try this method but confused with this syntax -- don't mind the quotes
"On your computer open a terminal/cmd prompt and set the directory where you want to dump the files (ex: cd /your/path/here)"
I'm painfully confused about this: cd /your/path/here. is this done during fastboot? I know fastboot commands but adb is where my brain doesn't get it. Please elaborate further and thanks.
Click to expand...
Click to collapse
When you open a terminal or command prompt on your computer it is, by default, 'pointing' to a certain folder. Since we're pulling files from the phone to pc it'll dump there, so it's easiest to set the location in advance, for your own convenience. You can just make a folder on your desktop and drag it onto the terminal window to automatically input that path after typing cd, which just means 'change directory'. This isn't a fastboot or adb thing, just a feature of terminals, so you'd do this in advance.
Mpolo87 said:
When you open a terminal or command prompt on your computer it is, by default, 'pointing' to a certain folder. Since we're pulling files from the phone to pc it'll dump there, so it's easiest to set the location in advance, for your own convenience. You can just make a folder on your desktop and drag it onto the terminal window to automatically input that path after typing cd, which just means 'change directory'. This isn't a fastboot or adb thing, just a feature of terminals, so you'd do this in advance.
Click to expand...
Click to collapse
Attached are 2 photos -- the 1st photo is the "before" I dragged my intended folder into command prompt. the 2nd photo is the "after" I dragged my intended folder into command prompt. Still hella confused.
Please note: I love this guide. It's cohesive and well-written. I just need pictures to "see" on what and where to do. I'm visual.
UPDATE: I followed the tuturial to the best of my ability and I got nothing. I'm giving up and taking a step back.
PS C:\Program Files (x86)\platform-tools_r30.0.5-windows> ./fastboot boot recovery.img
Sending 'boot.img' (64964 KB) OKAY [ 1.660s]
Booting OKAY [ 0.084s]
Finished. Total time: 1.939s
PS C:\Program Files (x86)\platform-tools_r30.0.5-windows> ./adb shell
* daemon not running; starting now at tcp:5037
* daemon started successfully
OnePlus8T:/ # dd if=/dev/block/by-name/boot_a of=/sdcard/boot_a.img
196608+0 records in
196608+0 records out
100663296 bytes (96 M) copied, 0.194981 s, 492 M/s
OnePlus8T:/ # dd if=/dev/block/by-name/boot_b of=/sdcard/boot_b.img
196608+0 records in
196608+0 records out
100663296 bytes (96 M) copied, 0.185497 s, 518 M/s
OnePlus8T:/ # exit
PS C:\Program Files (x86)\platform-tools_r30.0.5-windows> ./adb pull /sdcard/boot_a.img boot_a.img
/sdcard/boot_a.img: 1 file pulled, 0 skipped. 27.7 MB/s (100663296 bytes in 3.470s)
PS C:\Program Files (x86)\platform-tools_r30.0.5-windows> ./adb pull /sdcard/boot_b.img boot_b.img
/sdcard/boot_b.img: 1 file pulled, 0 skipped. 32.0 MB/s (100663296 bytes in 2.997s)
PS C:\Program Files (x86)\platform-tools_r30.0.5-windows> ./adb reboot
PS C:\Program Files (x86)\platform-tools_r30.0.5-windows>
sameog said:
Attached are 2 photos -- the 1st photo is the "before" I dragged my intended folder into command prompt. the 2nd photo is the "after" I dragged my intended folder into command prompt. Still hella confused.
Click to expand...
Click to collapse
You're missing the command "cd" before the path to change the directory to the new one. It should be cd C:\Users\Mr. Lew\Desktop\oneplus 8t boot image then press enter. Now you can reference any file in that folder by just the name without its entire path as a prefix being required.
A difficult method
zengin said:
Diğer yöntemden hiç de kolay değil.
Click to expand...
Click to collapse
huh?
Honestly, if there's a kind of soul out there who can share their unpatched kb2007 boot image (tmobile version), I would greatly appreciate it. I'm been banging my head on the wall with this for about 2 months with no help. I've received TONS of half-baked one liner answers but no "full-scale" tutorial. I'm giving up on this.
NOTE: I'm just frustrated guys. Not bashing the OP. It shouldn't be this hard but it became this way.
sameog said:
Honestly, if there's a kind of soul out there who can share their unpatched kb2007 boot image (tmobile version), I would greatly appreciate it. I'm been banging my head on the wall with this for about 2 months with no help. I've received TONS of half-baked one liner answers but no "full-scale" tutorial. I'm giving up on this.
NOTE: I'm just frustrated guys. Not bashing the OP. It shouldn't be this hard but it became this way.
Click to expand...
Click to collapse
While this is a temporary solution, it is also a bad solution because you can land with not being able to boot your phone every time an incremental update comes along.

Categories

Resources