Add pkt, apt or any other packet manager onto the Oneplus Nord - OnePlus Nord Questions & Answers

On my phone any kind of packet manager is missing. Not even dpkg or rpm are available (curl would be available though). Is there maybe some kind of magisk module or are there any online-ressources available where I can download the packet manager binaries that would be executeable on an Oneplus Nord? I know it's available on other phones, like the Fairphone 4.

Try Termux, you can install packages etc, however it's a virtual environment, not executing in the Android system directly, very useful anyways.

Related

MONITOR MODE IS NOW WORKING ON NEXUS 5 BCMON4339 chipset

Ok check it out I just checked out www(DOT)nexmon(DOT)org and they have monitor mode working on the nexus 5 I have tried it and it works I was wondering if I could get this driver ported on 5.1.1 instead of having to use this on 6.0 I enjoy using my nethunter
Is nexmon a way to temporarily boot the phone to use it as a wifi interface in monitor mode, or is nexmon installed onto the phone and then you boot the phone normally and use nethunter?
m52 power! said:
Is nexmon a way to temporarily boot the phone to use it as a wifi interface in monitor mode, or is nexmon installed onto the phone and then you boot the phone normally and use nethunter?
Click to expand...
Click to collapse
nexmon is a project to enable monitor mode on the Nexus 5 smartphone. It consists of a kernel module, which is a modified bcmdhd driver, and a modified firmware that is executed on the ARM microcontroller inside the BCM4339 wifi chip. As module loading is disabled in stock kernels for the Nexus 5, we deliver a boot.img containing a kernel with enabled module loading and the modified driver module. The boot.img also disables the wpa_supplicant and p2p_supplicant services in the init.hammerhead.rc so that they are not starting automatically. This was necessary as those services interfered with our driver testing, for example, by automatically setting up an interface (ifconfig wlan0 up). The boot.img is also relatively large, as it contains a couple of tools in the /nexmon/bin directory. If size is not a problem, you can also flash the image to your phone, but then, you cannot use it for regular wifi operations anymore. In the future, we might fix this issue to make nexmon more user friendly.
If you want to report bugs or have feature requests, then feel free to contact us.
---------- Post added at 02:05 PM ---------- Previous post was at 02:02 PM ----------
BLACKHATN5 said:
Ok check it out I just checked out www(DOT)nexmon(DOT)org and they have monitor mode working on the nexus 5 I have tried it and it works I was wondering if I could get this driver ported on 5.1.1 instead of having to use this on 6.0 I enjoy using my nethunter
Click to expand...
Click to collapse
Did you try running the 6.0.1 kernel with a 5.1.1 system image? Even though there might be some stability issues, it could work – at least temporarily for playing with monitor mode. If you require a 5.1.1 kernel image, you can simply compile a 5.1.1 hammerhead kernel with enabled module support and bcmdhd enabled as a module. Then you can insmod whichever driver you want to use with your bcm4339 chip.<
Yes it is only temporary and its still in the works. I am not a said developer for the program I was just testing it
didn't work for me..
need help.
thephoenix0707 said:
didn't work for me..
need help.
Click to expand...
Click to collapse
Then explain us, what you tried to do and what failed to work. Btw. we are currently working on the project and I just saw that you have to load the nexmon.ko module instead of the bcmdhd.ko module. We intend to keep the unmodified bcmdhd driver while being able to activate monitor mode by loading the nexmon.ko.
Actually i am running nethunter 3.0 on Android M 6.0.1 on my nexus 5,then I came to know about the nexmon project so I tried enabling monitor mode by following the steps as per the website, and I guess the whole process went on perfectly.But still when I use the command airmon-ng I get an error "unable to detect for sdio".
thephoenix0707 said:
Actually i am running nethunter 3.0 on Android M 6.0.1 on my nexus 5,then I came to know about the nexmon project so I tried enabling monitor mode by following the steps as per the website, and I guess the whole process went on perfectly.But still when I use the command airmon-ng I get an error "unable to detect for sdio".
Click to expand...
Click to collapse
http://www.aircrack-ng.org/doku.php?id=airmon-ng said:
This script can be used to enable monitor mode on wireless interfaces. It may also be used to go back from monitor mode to managed mode. Entering the airmon-ng command without parameters will show the interfaces status.
Click to expand...
Click to collapse
airmon-ng is a script to setup a monitor interface, but our nexmon driver automatically starts with a monitor interface that delivers frames prepended by a radio-tap header. So you do not need to run airmon-ng to start the monitor interface. You can simply try to run tcpdump to dump the received frames. Currently, injection is not working, so you will not be able to use any tools that require this feature.
i think that's why i couldn't use it with airodump too,would wait for the features to be added...
thanks for the help..
hello, can now normal use phone with this kernel ?
adorex97 said:
hello, can now normal use phone with this kernel ?
Click to expand...
Click to collapse
You can normally use your phone with this kernel, but regular wifi operation does not work with the monitor mode firmware. We also offer a lot of other firmware pathches, including frame injection. Additionally, there will be a demo on this years WiSec conference https://www.securityweek2016.tu-darmstadt.de/wisec/program/.
normally flase boot.img after root and not working monitor mode ,no flashing n hunter
I am flase nexmon on my nexus 5 .but not enabled monitor mode and not installing nethunter..after flashing boot.img ,I am flash boot.img normally...but not working bcmon..and not installing any kernel after flase boot.img...please help me..how to enabled monitor mode....please say me steps by step..
vicky80800 said:
I am flase nexmon on my nexus 5 .but not enabled monitor mode and not installing nethunter..after flashing boot.img ,I am flash boot.img normally...but not working bcmon..and not installing any kernel after flase boot.img...please help me..how to enabled monitor mode....please say me steps by step..
Click to expand...
Click to collapse
There is a step by step instruction online:
Code:
Download the boot.img (this project is still in heavy development, the monitor mode should work on the boot.img in this commit though: 1171d135)
adb reboot bootloader
fastboot boot boot.img
without the flash parameter, this boot image will be reset to the previous one on the next reboot
fastboot reboot
adb shell
su -
insmod /nexmon/nexmon.ko
ifconfig wlan0 up
do whatever you want, e.g. run tcpdump: /nexmon/bin/tcpdump -i wlan0 -s0
If you simply want monitor mode, use the boot.img from commit 1171d135. We are also developing new patches. To run those you need to clone the git repo and run:
Code:
make boot
to compile everything and load the modified boot image onto your phone.
Then you can choose and load one of the patches from the firmware_patching directory on your phone by executing:
Code:
make reloadfirmware FWPATCH=monitor_mode_example
Then you can setup the interface
Code:
adb shell su -c 'ifconfig wlan0 up'
And run tcpdump
Code:
tcpdump -i wlan0 -s0
In the self build image, there are a lot of pentesting tools that are all built from source, such as aircrack-ng. Using aufs as overlay filesystem, you will find them overlayed over your system binaries, so that you can directly run them. We also patched the kernel to be able to create raw sockets without root priviledges, which allows you to access interfaces directly from Java code in Android apps, without the need of a binary that runs as root.
After installing boot.img not working WiFi network..no network found.. Can you say why ??
vicky80800 said:
After installing boot.img not working WiFi network..no network found.. Can you say why ??
Click to expand...
Click to collapse
Yes, because we disable wpa_supplicant and p2p_supplicant as they hinder development and always pull up the wifi interface when it is not intended to be pulled up.
To reenable the two services, comment the following lines in the Makefile and recompile your own boot.img:
Code:
&& sed -i '/service wpa_supplicant/,+11 s/^/#/' init.hammerhead.rc \
&& sed -i '/service p2p_supplicant/,+14 s/^/#/' init.hammerhead.rc \
Thanks ..for help
Hi @matthiasschulz,
thanks for your great work. I'm having two questions:
1. Is it possible to use your developed kernel driver with an other handset? I'm thinking of my LG G3 which also has the BCM4339 chipset.
2. It seems that one needs a specially built kernel to use your driver. Are you planing to do it like bcmon where no kernel compile is needed as they work with LD_PRELOAD to hook the C Library syscalls ?
3. Can your driver somehow be used from within a running android phone without the need to reboot into fastboot mode?
thank you very much!
hack_rid said:
1. Is it possible to use your developed kernel driver with an other handset? I'm thinking of my LG G3 which also has the BCM4339 chipset.
Click to expand...
Click to collapse
The kernel always depends on the device you use, however, you can take our modified bcmdhd driver for the BCM4339 and compile it for the LG G3.
hack_rid said:
2. It seems that one needs a specially built kernel to use your driver. Are you planing to do it like bcmon where no kernel compile is needed as they work with LD_PRELOAD to hook the C Library syscalls ?
Click to expand...
Click to collapse
We needed to rebuild the kernel, as the original Marshmallow kernel for the Nexus 5 stock firmware has module loading disabled. Hence, the WiFi driver is directly included in the kernel. As long as other devices do not have module loading activated, you cannot simply load our modified driver. Just replacing the WiFi firmware binary and using the LD_PRELOAD hack might work however.
hack_rid said:
3. Can your driver somehow be used from within a running android phone without the need to reboot into fastboot mode?
Click to expand...
Click to collapse
Not yet. Currently, we disable the wpa_supplicant and p2p_supplicant services during boot as they always try to activate the WiFi interface, which is annoying when developing new firmware patches. If someone would figure out how to stop and start the two services while the device is running, one could switch between a working original firmware version and our patches.
Hi Matthias,
thanks for your answer!
I'm digesting it!
I'm sure you closely followed the development of bcmon. If not, you can find some slides here where the devs explain how they achieved what is there:
dropbox...com/sh/le8zeczpddf3nx0/fdXn4LSxGI
link source:
bcmon.blogspot...de/2013/07/monitor-mode-reloaded_14.html
they reached a pretty portable solution. the only thing they need as a pre-requirement is root and the matching chipset
looking forward to your progress
Hey, @matthiasschulz can you tell me please why i can't get monitor mode (ex:in airodump-ng) in kali Terminal Emulator([email protected] 3.1). I have a Nexus 5 with Android 6.0.1 M0B30Y with Nethunter 3.1 on top of it and I booted nexmon (boot.img) from fastboot (command: fastboot boot boot.img).I didn't forget to insert the kernel module and bring the wlan0 interface up. The nice thing is that I can use only your tools from /nexmon/bin, like airodump-ng, but not in kali terminal, just in root android. It's something, for example,a simlink or a little bit more complicated than that?

Question [TB-J706F] Restore Netflix L1 on the ROW rom.

As many of you probably know, recently the L1 netflix support for the this tablet dropped to L3.
We tried to restore it for a while without success, because the preinstalled app cannot be uninstalled normally and lower netlfix versions cannot be intalled in the top ot it (at least not from android itself).
But it seems that I finally found a way to do it sucessfully by forcing it through adb, here is the complete guide;
- Enable usb debugging on the tablet
- Get the latest android plateform tools including adb and android usb drivers and install it somewhere (shorter path is better).
- Download the 7.80 version of netflix in the usual place, and save it in the same folder as adb
- Open up a windows command prompt in that folder
- Input
adb install -r -d netlfix.apk (change the package name to whatever you named it)
- Allow the adb access on your tablet if needed
- Completely clear the app data (very important!)
- Disable auto update of that app in google play
- Done!
Please tell me if that worked for you, I might test out other versions to see until which version it does work and which breaks it.

OnePlus 7 Mclaren, Nethunter, TWRP, Magisk Everything you need to Root.

The OnePlus 7 Pro Mclaren EU HD1913 edition is perfect for Nethunter and PenTesters, 256GB storage, 12GB RAM, 2 sim cards, 48MP camera, etc. Here is everything you need to get a fully functional Nethunter Mclaren, with all wifi modules compiled in the kernel for external wifi cards.
Spoiler
The Nethunter Kernel included in the .tar file is for Android OS 10 & will work on the OnePlus 7 Pro, OP 7 Pro Mclaren & OP 7T. Packet wifi injection works also. but be sure you download these drivers after kernel install & reboot: apt install realtek-rtl88xxau-dkms, realtek-rtl8188eus-dkms, realtek-rtl8814au-dkms. So if you just need a kernel compiled with external wifi & usb modules, you can download the .tar file & just use the kernel. Flash it in TWRP per install button. You're welcome.
Some say you must get an "unlock token" from oneplus to unlock bootloader BUT I did not have this issue, it was straight without any token.​Here is the download link: This one contains all files except MSM tool. The MSM link is after. MSM is not needed unless you brick the phone.
Also NOTE: Some of the files have been compressed with "xz".
You must decompress them first, then use the "zip" version of the file for the installation instructions. To decompress these "xz" files do this command:
xz -d name_of_file.zip.xz
THE ONLY FILE TO NOT DECOMPRESS is the Kalifs-arm64-full.tar.xz. You will use the whole file as is, with the "xz" to install the kali chroot. The below download is for the Nethunter bundle not the MSM tool.
Mclaren_Nethunter
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
www.mediafire.com
Open: tar -xvf Mclaren_Nethunter.tar
The following download is the MSM tool with the stock Android 10 version. This is in case you brick the phone, this will reset it.
In case you brick your phone, but are still able to boot into TWRP, the MSM tool included can reinstall the Oxygen Os
On windows computer, transfer & extract the MSM tool.
Click on MSM tool, click "run as administrator" it'll open up the dialog.
In upper left, choose EU version then set your cursor over the "start" button
Have a usb cable connected to the Windows machine ready to connect the Mclaren
On Mclaren, in TWRP mode, choose Reboot option, then click EDL
Plug phone in immediately to Windows, it'l recognize it, click Start
The phone will then reinstall the OS, & wipe it clean. Then you must repeat all the steps to reinstall TWRP, Nethunter, Magisk, etc.
MSM_Oneplus7_AndroidOS_10.0.13
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
www.mediafire.com
The files are:
1. TWRP -> for the EU version
2. Dm-verity -> disable Dm-verity encryption.
3. System_rwBundle zip -> Make read/write System, Product, Vendor.
4. NetHunter Kernel -> Compiled with all the wifi modules for external wifi cards, Alfa cards.
5. Magisk -> Root manager
6. Nethunter Apps -> Nethunter GUI, Terminal, Kex-client, Store.
7. MSM download tool -> In case you brick your phone, restore it thru MSM. This needs a windows computer tho.
Starting on the Mclaren:
1. Settings -> About Phone:
a....tap "Build Number" 7 times to enable "Developer Mode".
2. Settings -> System -> Developer Options:
a.Turn on "OEM unlocking", "USB debugging" & turn off "Automatic system Updates"
b. Scroll to "Default USB configuration", select "File Transfer"
c. You can also turn off "Verify apps over USB"
3. Once those are set, plug in phone to Linux computer, "allow usb debugging"
a. Type without quotes "adb reboot bootloader"
b. This will put phone in "Fastboot mode", then in fastboot mode..
c. Type "fastboot flashing unlock"
d. Agree to unlock the bootloader, phone WIPES YOUR DATA then reboots.
4. Go thru motions to set up phone, then REPEAT steps 1 & 2.
5. Now, we are gonna boot into TWRP to install it.
6. Plug phone back into Linux, type again "adb reboot bootloader"
7. This will put you in "Fastboot mode" again:
a. Make sure your in the TWRP directory on Linux: Type "fastboot boot twrp.img" //This boots the image to the Mclaren
b. Now push the "twrp.zip" onto the Mclaren: Type "adb push twrp.zip sdcard/"
c. In TWRP app, go to install, choose "twrp.zip", install.
d. IMPORTANT!!!! AFTER TWRP INSTALL, BOOT BACK INTO RECOVERY not into system.
e. TWRP is installed, now you can boot into system
8. Next, power off phone, boot into TRWP recovery by holding volume down & power key till you see TRWP logo.
9. Plug phone into laptop, push Disable-DM-verity to phone.
adb push Disable_Dm-Verity_ForceEncrypt_11.02.2020.zip /sdcard/
In TWRP, choose install Disable-Dm-verity.
Reboot into system.
10. Next, we make the "vendor, product & system" directories writable. You need this bcuz by default they are read only"
a. In TWRP, push the systemrw_1.32_BUNDLE_proper.zip onto the Mclaren to /data/local/tmp directory.
b. In TWRP, choose "Advanced->Terminal" navigate to /data/local/tmp
c. Unzip the bundle, then -> unzip systemrw_1.32_flashable.zip -> cd to the systemrw_1.32 dir
d. Make file executable: type "chmod +x systemrw.sh"
e. You can specify a size for each directory, the programs op says 15mb is good, but I chose 150MB which works.
Type " ./systemrw.sh size=150 "
f. This will automatically make all the directories read/write... Make sure you got battery on your phone
g. Reboot into system
11. Now we'll install the Nethunter Kernel. It has the wifi modules already compiled.
a. Be in TWRP recovery mode:
b. Push the kernel onto Mclaren: -> adb push anykernel-NetHunter.zip /sdcard/
c. Click install & install the zip, then reboot to system.
d. Go to Settings->About Phone->Android Version to check the Nethunter kernel install
12. Next, reboot into TRWP to install Magisk
a. Push Magisk to Mclaren: "adb push Magisk-v23.0.zip /sdcard/
b. Install Magisk.
c. After Magisk is installed, still in TWRP, go to "Wipe" -> Format Data -> type "yes", then reboot into system.
13. At this point, you'll need to set up the phone again. I refuse all the analytics, & unset all the Google options in the phone.
a. Important!! BEFORE YOU CONNECT TO WIFI to update Magisk, you have to disable "Automatic Updates" on the Mclaren.
I also disable "Find my Device" & all of the Google features including Google Play Scanner.
b. Settings -> System -> System Updates -> Uncheck the "Automatic Updates over wifi" button.
c. Repeat steps 1 & 2 again, especially uncheck the "automatic updates" in "developer options"
d. Turn off "Find my Device" -> Settings -> Google -> Find my Device check to off
e. In Settings, search for Google play, Turn off Google scan.
f. I turn off all the Google features in Settings->Google. Its all spyware crap
14. Once that is done, connect to wifi, and click Magisk app to update. It'll update the app, then in Magisk, click Install-> Direct Install -> Reboot.
15. Now you have Magisk ready, & can install Nethunter.
a. Push "update-nethunter" file to Mclaren in system mode, not TWRP.
adb push update-nethunter-20220211_172614-oneplus7-oos-ten.zip /sdcard/
b. Open Magisk->Modules->Install from Storage-> choose "update-nethunter" file, and done.
16. Nethunter & the Nethunter apps will be installed, but you must update Nethunter thru the Nethunter Store first
a. Open Nethunter Store app -> Updates -> Refresh till update appears, Update then reboot.
17. Nethunter is installed but the chroot kali is not.
a. Push the kalifs-arm64-full.tar.xz onto the Mclaren to the /storage/emulated/0/ directory
adb push kalifs-arm64-full.tar.xz storage/emulated/0/
b. Go to Nethunter GUI -> Kali Chroot Manager -> Install chroot, -> choose to install from backup.
c. The file that shows up is not the one you just pushed so backspace & change the name to "kalifs-arm64-full.tar.xz
d. Click install. Once its done, ready to go.
18. There will be some issues at first, but easy to solve following these instructions. The Nethunter terminal may throw an error for kali term
because of some 'security key' function.
a. Open Nethunter terminal, select "AndroidSU".
b. Type "bootkali_bash" //this will put you into Kali linux shell inside Android shell.
c. To fix the perms, navigate to /etc/pam.d/ & Comment out the following line in each of these files
# session optional pam_keyinit.so force revoke
Files: su-l, login, runuser-l, and sshd. This will solve the Kali terminal issue.
19. Next, lets fix the permissions on the Postgresql directories. Use the following command on all of the directoris
chown -R postgresostgres postgresql/
Directories: "/var/lib/postgresql", "/etc/postgresql", & "/usr/lib/postgresql" Now postgresql will work.
20. Lets fix the iptables legacy error to have iptables working: In Kali shell type:
update-alternatives --config iptables
Choose the iptables-legacy option
Same for ipv6
update-alternatives --config ip6tables
The android firewalls are complex, check them: iptables -n -v -L
I delete all default android firewalls, up to you. iptables -F; iptables -Z; iptables -X //do same with ipv6
21. IMPORTANT there is a program that uses high CPU usage that has to be disabled immediately. Its the @brain-service. You can use "top" process monitor to check this. Don't panic, use the command below to stop it.
a. Lets make this command start at boot. Navigate to NetHunter GUI -> Custom Commands -> ADD
Name: whatever, can be "stop_brain".
Command: su -c resetprop ctl.stop oneplus_brain_service
Send to: android
Exec: background
Run on boot: yes
b. That command will bring the cpu down to 2%. There are more program/services to stop, based on not wanting oneplus spy stuff. here are a few. Use the same command above:
soter-1-0
oneplus.engineer-1-0
opdiagnose
22. There are many programs to uninstall, some are mandatory, others optional. There are numerous lists of bloatware to uninstall, located on the Internet, one link at end of post.
But, think before you uninstall, you may want or still need the package. But the following programs you have to uninstall-> spyware
a. The way to uninstall these is in the AndroidSu shell. Don't use the '-k' flag, bcuz it keeps cache & data of uninstalled pkges.
b. Some commands:
pm list packages // lists pkges. Tack a "-d" to the end to see disabled pkges.
pm uninstall --user 0 com.package.name //uninstalls the package
pm clear --user 0 com.package.name //clears data left from package
c. Necessary uninstall:
net.oneplus.odm
net.oneplus.odm.provider
com.oneplus.ses
d. Necessary Disable: // You can disable or uninstall, but must disable to avoid being updated by Oneplus
Command: pm disable --user 0 com.oneplus.backup
com.oneplus.backup
cn.oneplus.nvbackup
23. After all that, you can go to Nethunter GUI, -> chroot Manager -> Add Metapackage
Choose "kali-linux-nethunter" & "kali-linux-default" to update to base installation. After install all you want.
24. Here is a link to remove some bloatware:
OnePlus Bloatware List | Remove Bloatware on OnePlus
Using our bloatware list you can safely remove OnePlus bloatware. You can also use Oxygen OS Debloater to uninstall system apps on OnePlus devices.
technastic.com
Does Kali NetHunter also work well for OnePlus 7T Pro? I used Google and tried to find on different web pages Installation Guides for this Phone but I only found 7, 7 Pro, 7T but not a ****ing OnePlus 7T Pro!
Can´t believe nothing was posted about 7T Pro since its launch years ago.
Thank you for this detailed guide. Worked like a charm <3 .
botsec said:
Thank you for this detailed guide. Worked like a charm <3 .
Click to expand...
Click to collapse
Hey can you share your experience with nethunter, Im tempted to buy this device only for this

[APP][NON-ROOT] Termux-ADB - debug one Android device from another connected by USB-OTG

Run adb in Termux without root permissions!​This is a launcher for adb which enables debugging of one Android device from another via USB cable. It should work with any USB-C male-to-male cable or the corresponding OTG adapter + cable in case of micro USB.
https://github.com/nohajc/termux-adb
Motivation​Termux has had the android-tools package for some time now but it only works properly if you root your device (due to missing filesystem permissions). This is because Android has its own API for accessing USB peripherals which is incompatible with Linux. Termux already exposes this API using the termux-usb utility (part of Termux API) but this is not enough to make programs like adb work out of the box.
Usually you would have to modify any application which accesses USB devices but there's actually another way.
When you start adb using termux-adb, it will use termux-usb in the background for device discovery and then essentially feed the device information into adb by intercepting some libc calls and emulating usb device files as they would appear on any linux machine (bypassing the file permission problem entirely).
At this point the program is in its early stages and therefore highly experimental. I tested it on two Android devices so far and I can't give any guarantees it will work for everyone. But you can try.
That is great work! It works fine in my honor handset!
When will you share the new release with multiple ADB device support?
Appreciate for your fantastic tool !
It's definitely on my TODO list but now I'm also dealing with the fact it doesn't work on some devices.
So, I don't have an exact timeline but I'll keep this thread up to date.
Version 0.2 released today: https://github.com/nohajc/termux-adb/releases/tag/v0.2.0
@Stanton1011 It supports multiple devices now.
Thank you. If you're wanting feedback, there seems to be a lot of lag getting it to connect at first but it does work and once it's connected no issues. The fastboot however has much more lagging and will say simultaneously that commands succeeded and failed (but just seem to fail). But adb works fine on moto g pure running android 11, moto g pure on Android 12, TCL Obama phone type android 12, Samsung a11 android 10.
Thanks for the report. I'm aware of the lag. It's mainly caused by how Termux handles USB access in general but it could be improved if fastboot ran in the background (same as adb).
As for the commands failing, I'll look into it. Which particular fastboot commands you tried?
nohajc said:
Version 0.2 released today: https://github.com/nohajc/termux-adb/releases/tag/v0.2.0
@Stanton1011 It supports multiple devices now.
Click to expand...
Click to collapse
Thank you so much, I will have a try and let you know the result.
The following problem is solved by Pkg upgrade.
I find a error for it ,please help!
CANNOT LINK EXECUTABLE "./termux-adb": cannot locate symbol "_ZN6google8protobuf8internal14ArenaStringPtr3SetIJEEEvRKNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPNS0_5ArenaE" referenced by "/data/data/com.termux/files/home/termux-adb"...
I have a handset with the root permission only for ADB, but Termux(or any android APP) can not obtain the root permission. Could you tell a way to use the adb in termux, I know I can user your github project Termux-adb as what you did before., but I also need a alternative way. I have the root permission of ADB command(by PC). Can I modify some folder permission to achieve the same affect?

How To Guide How to extract boot.img from OnePlus 9 firmware packages to patch with Magisk & flash to your phone using Linux Mint 21.1

As a OnePlus 9 user who likes to root their phone mainly to allow Network Signal Guru to work (as well as a few other root things like AdAway) I had been trying to extract the boot.img the same way as I had done with a OnePlus 7T using Payload Dumper for Windows. However it looks like Payload Dumper has issues with extracting xx.img files (including boot.img) if the payload.bin file is bigger than 4.3 GB in size. So I've been looking to see if another method was possible that would work for our OnePlus 9 ROMs that are above this file size. As I use Linux Mint as my usual desktop OS & only fall back onto Windows for stuff that'll only run on that OS, I went to have a look to see if something could be done under Linux. Turns out there is an old thread elsewhere on XDA that almost nearly provides what is needed for this, and I thought I would gives details here that should work for the time of this post (March 2023).
This not only extracts the boot.img to patch in Magisk, but also extracts other xx.img files as well.
I'm using Linux Mint 21.1, but I'd assume that this will also work for similar Ubuntu builds or anything that is based on Debian.
Obligatory disclaimer: The following instructions I'm giving below have worked well for me several times in the past, however I am in no way responsible for screwing up or damaging your phone if you try and follow what I've written below. In extreme cases, a bad flash may require using the OnePlus MSM tool to completely reflash your phone. Back up anything important first before doing any of the following!​
1. You will need to ensure that you have downloaded packages to be able to do adb & fastboot from the command line. You can check by running the following commands - if it's already installed with the latest versions, the terminal interface will let you know...
Code:
sudo apt install adb
Code:
sudo apt install fastboot
2. You will need to go to your software manager in LM21.1 and install both Python 3 & the Python Protobuf compiler. Just search for "Python 3" & "Protobuf-compiler" in the software manager and the first option for each search is what you should need - if they are not installed, install them.
3. Create a read/writable directory that will hold your ROM that you've just downloaded & other files that I'll mention soon. I just use a folder calls "ROM" in my Downloads folder (e.g. /home/lawhec/Downloads/ROM ), but you can choose wherever you want that suits you.
4. If you have not done so already, make sure you have the FULL package of your OnePlus 9 ROM downloaded. As of right now (March 2023) it seems the best way is to download the package using the Oxygen Updater app which is available on Google Play - more info available at oxygenupdater.com - just download the ROM to your phone and transfer it on to your computer into the folder you've created for it.
5. Download and save the following two Python scripts/files ("Right click" & "Save Link As") into the folder you have just created for your ROM (all credit to Gregory Cyxx at github.com/cyxx )...
https://raw.githubusercontent.com/c...payload/master/extract_android_ota_payload.py
https://raw.githubusercontent.com/cyxx/extract_android_ota_payload/master/update_metadata_pb2.py
6. Make sure in your file browser (Nemo in my case as it is the default for LM21.1 Cinammon, yours may differ) the window is open in the ROM folder that contains the two Python scripts above that you've just downloaded as well as a ROM package (ZIP file) you've downloaded (in my case from Oxygen Updater mentioned in step 3). Create a new folder for the extracted images to be written to - in my case I just call the folder "output" which is located at "/home/lawhec/Downloads/ROM/output" but again you can call it what you wish.
7. After you've created your output folder, in your ROM directory in the file manager window right-click on your mouse in a white or free space and select "Open in Terminal" - a command terminal will pop up defaulting to your directory.
8. In the command terminal, type the following command and press enter/return...
Code:
sudo python3 extract_android_ota_payload.py <<Your ROM.zip>> <<Your Output Directory>>
...for example, in my case the command would be either...
Code:
sudo python3 extract_android_ota_payload.py LE2113_11_F-75.zip output
...or for handiness you can type "sudo python3 extract_android_ota_payload.py " (remember to leave a space) and simply drag the ROM zip file to the command terminal, press space and then drag the output foler to the terminal line, which will look like in my case...
Code:
sudo python3 extract_android_ota_payload.py '/home/lawhec/Downloads/ROM/LE2113_11_F-75.zip' '/home/lawhec/Downloads/ROM/output'
...this will now run the python script you downloaded earlier that will begin extracting the ROM you've specified and will output all relevant xx.img files into your output folder, including the one we want, "boot.img" - there is no need to extract paylod.bin beforehand, the script will automatically do this for you. Once all xx.img files have been extracted the script will stop, depending on your computer this will take anything from 1-5 minutes, maybe longer on some very old or low spec'd computers - but just let it run its course. Once it is done you can then close the terminal window.
9. Now with the boot.img we've extracted, transfer this file on to your phone (the Downloads folder is usually a good choice). Now open Magisk and patch the boot.img file - once this has been completed, it'll generate a patched boot.img file named something like "magisk_patched-25200_12345.img" - copy and paste this patched boot image back on to your computer (into the folder you've been using will be fine here).
10. If your OnePlus 9 phone is connected to your computer via USB cable, disconnect it now. Then shutdown your phone into a power-off state then reboot it into fastboot mode - this can be done by holding down the volume up & down buttons, then holding down the power button and keep holding down all three buttons until you feel a vibration from your phone. Your OnePlus 9 should then boot into fastboot mode.
11. Now reconnect your OnePlus 9 to your computer via the USB cable and then open up a new display terminal (preferably by right-clicking in the file window of the directory where you saved your Magisk patched boot.img file). Enter the following...
Code:
fastboot devices
...you should then get a line featuring a block of numbers that should match the serial number that is displayed on your phone's display, followed by "fastboot", for example...
Code:
85f53405 fastboot
...if you get anything else, double check your connections at try again - if more than one device is displayed, disconnect the and try again to make sure that only one device is listed. It might also be the case that you don't have the proper drivers installed on your computer for your phone though in my case LM21.1 automatically recognises my phone, so I'm not of any direct help here I'm afraid for this, sorry.
12. Now you will be flashing your patched boot.img to your phone - this is where things can be a little nervous though as long as you do everything right nothing should really go wrong. Type the following into the command terminal, assuming you did so by opening a command terminal from the folder your Magisk Patched boot.img file is located...
Code:
fastboot flash boot <<Magisk Patched boot.img>>
...for example in my case the command line would be...
Code:
fastboot flash boot magisk_patched-25200_12345.img
...otherwise you will need to provide the location of where your patched boot.img is, so in this case...
Code:
fastboot flash boot '/home/lawhec/Downloads/ROM/magisk_patched-25200_12345.img'
...either way, your phone will now be in the process of getting its boot image replaced with the one patched by Magisk. This should take no more than a few seconds and that should be it done! You can then close the terminal window again.
13. Once you've patched the boot image, disconnect the phone from the USB cable to the computer and make sure that the screen on your mobile says "START" in green at the top, if it doesn't, use the volume keys to change this. Then just simply press the power button and your phone will now reboot, this can take a little bit longer than before as your phone's firmware has changed so give it time - (however if it takes longer than 10 minutes or so you might have a problem here) - once your home screen becomes available, give it a few seconds once you've entered before selecting the Magisk app. Once you've done this, Magisk should say that it is installed however to double check, use an app that requires root permissions either to work (e.g. Network Signal Guru) or to do additional things, like a simple root checker app that you can download from wherever you download your apps. If everything is good, then you've rooted your OnePlus 9!
Notes: This process will probably work for other firmware packages for various phones where the boot.img can be extracted to be patched by Magisk and then flashed via fastboot (assuming the bootloader is unlocked) which includes the OnePlus 7T's stock firmware, but I can give no guarantees for this. Once again, try at your own risk.​
I would suggest to boot the magisk patched image and then doing a direct install from the app instead of flashing it directly. This way you can use the "Restore images" feature in the Magisk app that can be useful when doing incremental update.
Thank You for thinking of Us Linux Users !
Attempted to update to LOS 20 via ADB, and now my touch screen will not work. All the remedies here require a Windows system for the MSM tool, which I do not have...
barguybrady said:
Thank You for thinking of Us Linux Users !
Attempted to update to LOS 20 via ADB, and now my touch screen will not work. All the remedies here require a Windows system for the MSM tool, which I do not have...
Click to expand...
Click to collapse
You have a computer you can install windows on another partition it's not like you don't have the ability to use msm
stez827 said:
You have a computer you can install windows on another partition it's not like you don't have the ability to use msm
Click to expand...
Click to collapse
no comment
barguybrady said:
Yup.
Just gonna spend another 4 or 5 hours prepping a drive to somehow install windows just to fix a phone.
Maybe - No....
Click to expand...
Click to collapse
It does not take that long as a Linux user who has had to install for that exact reason it took maybe an hour or 2
lawhec said:
As a OnePlus 9 user who likes to root their phone mainly to allow Network Signal Guru to work (as well as a few other root things like AdAway) I had been trying to extract the boot.img the same way as I had done with a OnePlus 7T using Payload Dumper for Windows. However it looks like Payload Dumper has issues with extracting xx.img files (including boot.img) if the payload.bin file is bigger than 4.3 GB in size. So I've been looking to see if another method was possible that would work for our OnePlus 9 ROMs that are above this file size. As I use Linux Mint as my usual desktop OS & only fall back onto Windows for stuff that'll only run on that OS, I went to have a look to see if something could be done under Linux. Turns out there is an old thread elsewhere on XDA that almost nearly provides what is needed for this, and I thought I would gives details here that should work for the time of this post (March 2023).
This not only extracts the boot.img to patch in Magisk, but also extracts other xx.img files as well.
I'm using Linux Mint 21.1, but I'd assume that this will also work for similar Ubuntu builds or anything that is based on Debian.
Obligatory disclaimer: The following instructions I'm giving below have worked well for me several times in the past, however I am in no way responsible for screwing up or damaging your phone if you try and follow what I've written below. In extreme cases, a bad flash may require using the OnePlus MSM tool to completely reflash your phone. Back up anything important first before doing any of the following!​
1. You will need to ensure that you have downloaded packages to be able to do adb & fastboot from the command line. You can check by running the following commands - if it's already installed with the latest versions, the terminal interface will let you know...
Code:
sudo apt install adb
Code:
sudo apt install fastboot
2. You will need to go to your software manager in LM21.1 and install both Python 3 & the Python Protobuf compiler. Just search for "Python 3" & "Protobuf-compiler" in the software manager and the first option for each search is what you should need - if they are not installed, install them.
3. Create a read/writable directory that will hold your ROM that you've just downloaded & other files that I'll mention soon. I just use a folder calls "ROM" in my Downloads folder (e.g. /home/lawhec/Downloads/ROM ), but you can choose wherever you want that suits you.
4. If you have not done so already, make sure you have the FULL package of your OnePlus 9 ROM downloaded. As of right now (March 2023) it seems the best way is to download the package using the Oxygen Updater app which is available on Google Play - more info available at oxygenupdater.com - just download the ROM to your phone and transfer it on to your computer into the folder you've created for it.
5. Download and save the following two Python scripts/files ("Right click" & "Save Link As") into the folder you have just created for your ROM (all credit to Gregory Cyxx at github.com/cyxx )...
https://raw.githubusercontent.com/c...payload/master/extract_android_ota_payload.py
https://raw.githubusercontent.com/cyxx/extract_android_ota_payload/master/update_metadata_pb2.py
6. Make sure in your file browser (Nemo in my case as it is the default for LM21.1 Cinammon, yours may differ) the window is open in the ROM folder that contains the two Python scripts above that you've just downloaded as well as a ROM package (ZIP file) you've downloaded (in my case from Oxygen Updater mentioned in step 3). Create a new folder for the extracted images to be written to - in my case I just call the folder "output" which is located at "/home/lawhec/Downloads/ROM/output" but again you can call it what you wish.
7. After you've created your output folder, in your ROM directory in the file manager window right-click on your mouse in a white or free space and select "Open in Terminal" - a command terminal will pop up defaulting to your directory.
8. In the command terminal, type the following command and press enter/return...
Code:
sudo python3 extract_android_ota_payload.py <<Your ROM.zip>> <<Your Output Directory>>
...for example, in my case the command would be either...
Code:
sudo python3 extract_android_ota_payload.py LE2113_11_F-75.zip output
...or for handiness you can type "sudo python3 extract_android_ota_payload.py " (remember to leave a space) and simply drag the ROM zip file to the command terminal, press space and then drag the output foler to the terminal line, which will look like in my case...
Code:
sudo python3 extract_android_ota_payload.py '/home/lawhec/Downloads/ROM/LE2113_11_F-75.zip' '/home/lawhec/Downloads/ROM/output'
...this will now run the python script you downloaded earlier that will begin extracting the ROM you've specified and will output all relevant xx.img files into your output folder, including the one we want, "boot.img" - there is no need to extract paylod.bin beforehand, the script will automatically do this for you. Once all xx.img files have been extracted the script will stop, depending on your computer this will take anything from 1-5 minutes, maybe longer on some very old or low spec'd computers - but just let it run its course. Once it is done you can then close the terminal window.
9. Now with the boot.img we've extracted, transfer this file on to your phone (the Downloads folder is usually a good choice). Now open Magisk and patch the boot.img file - once this has been completed, it'll generate a patched boot.img file named something like "magisk_patched-25200_12345.img" - copy and paste this patched boot image back on to your computer (into the folder you've been using will be fine here).
10. If your OnePlus 9 phone is connected to your computer via USB cable, disconnect it now. Then shutdown your phone into a power-off state then reboot it into fastboot mode - this can be done by holding down the volume up & down buttons, then holding down the power button and keep holding down all three buttons until you feel a vibration from your phone. Your OnePlus 9 should then boot into fastboot mode.
11. Now reconnect your OnePlus 9 to your computer via the USB cable and then open up a new display terminal (preferably by right-clicking in the file window of the directory where you saved your Magisk patched boot.img file). Enter the following...
Code:
fastboot devices
...you should then get a line featuring a block of numbers that should match the serial number that is displayed on your phone's display, followed by "fastboot", for example...
Code:
85f53405 fastboot
...if you get anything else, double check your connections at try again - if more than one device is displayed, disconnect the and try again to make sure that only one device is listed. It might also be the case that you don't have the proper drivers installed on your computer for your phone though in my case LM21.1 automatically recognises my phone, so I'm not of any direct help here I'm afraid for this, sorry.
12. Now you will be flashing your patched boot.img to your phone - this is where things can be a little nervous though as long as you do everything right nothing should really go wrong. Type the following into the command terminal, assuming you did so by opening a command terminal from the folder your Magisk Patched boot.img file is located...
Code:
fastboot flash boot <<Magisk Patched boot.img>>
...for example in my case the command line would be...
Code:
fastboot flash boot magisk_patched-25200_12345.img
...otherwise you will need to provide the location of where your patched boot.img is, so in this case...
Code:
fastboot flash boot '/home/lawhec/Downloads/ROM/magisk_patched-25200_12345.img'
...either way, your phone will now be in the process of getting its boot image replaced with the one patched by Magisk. This should take no more than a few seconds and that should be it done! You can then close the terminal window again.
13. Once you've patched the boot image, disconnect the phone from the USB cable to the computer and make sure that the screen on your mobile says "START" in green at the top, if it doesn't, use the volume keys to change this. Then just simply press the power button and your phone will now reboot, this can take a little bit longer than before as your phone's firmware has changed so give it time - (however if it takes longer than 10 minutes or so you might have a problem here) - once your home screen becomes available, give it a few seconds once you've entered before selecting the Magisk app. Once you've done this, Magisk should say that it is installed however to double check, use an app that requires root permissions either to work (e.g. Network Signal Guru) or to do additional things, like a simple root checker app that you can download from wherever you download your apps. If everything is good, then you've rooted your OnePlus 9!
Notes: This process will probably work for other firmware packages for various phones where the boot.img can be extracted to be patched by Magisk and then flashed via fastboot (assuming the bootloader is unlocked) which includes the OnePlus 7T's stock firmware, but I can give no guarantees for this. Once again, try at your own risk.​
Click to expand...
Click to collapse
If Using the t-Mobile Variant - LE2117 - we are Unable to Install any OTA Updates with OxygenUpdater, and are promptly warned of this limitation upon install. Nevertheless, I forged ahead and,
Following this Method, I downloaded a LE2115_11_F.17.zip, and proceeded to use your helpful .py scripts to extract the boot.img file, and Flash it - promptly sending me to a Qualcomm CrashDump mode.
Having a chance to MSM back to "stock" LE2117 - 11.2.2.2 LE54CB, I am wondering if I should just let the t-Mobile Update, through "Settings >> System >> System update" to Update the Stock ( bloated !? ) OS with all that are available,
Then attempt to Extract a boot.img and Magisk patch it ?
Any Advice?
TIA

Categories

Resources