Fixing script for boot looping on OOS 3 [Linux][OS X?] - OnePlus 2 Q&A, Help & Troubleshooting

Basically, this is a copy-paste thread from this thread.
THIS GUIDE IS FOR LINUX (AND OS X ?) ONLY! Windows version here
Download file here: https://mega.nz/#!wooAGJYA!Hr7VUkPRt1Xx9QxaRSIX-r7u9R8OtBhcpb8W5FdwHS8
Open a terminal (Ctrl + Alt + T) and go to your "~/Downloads" directory (or basically where you download your files):
Code:
cd ~/Downloads
Now, unzip the archive you just download:
Code:
unzip FixOOS3-TWRP.zip
You should now have a folder called "FixOOS3-TWRP". Go into this folder with "cd" command :
Code:
cd FixOOS3-TWRP.zip
Get sudo access (script won't run if not in root):
Code:
sudo -s
and then:
Code:
./fixoos.sh
.
The script will flash all necessary files to your device, and after 3 seconds. it will automatically reboot onto new TWRP.
From this TWRP you'll be able to flash newest CM 13 ROMs and OOS 3.x.x.
If there is no ROMs present on your phone, you can still push it with (be sure to stay in the current directory to use "./adb") :
Code:
./adb push <name_of_the_ROM>.zip /location/on/the/device/
of you can sideload it:
Code:
./adb sideload <name_of_the_ROM>.zip
(Be sure to be in "sideload mode" in TWRP).
For more pictures, check out original thread by @djsubterrain : fastboot outputs are pretty much the same, beside the fact that you are on Windows and Linux.

Related

[HOWTO] using dropbear sshd

This is going to be patently obvious to anybody familiar with Android, but I just started poking around and it wasn't clear to me how to do it. I figured I'd post it here if anybody else is in the same boat
1) Download CyanogenMod - build probably doesn't matter much, I used the I9000 ROM from this thread (n.b. - if you know of a trusted source to get current dropbear binaries, you don't need to download the huge CM zip, but I didn't see any floating around)
2) Extract the zip. You only need two files:
Code:
system/xbin/dropbear
and
Code:
system/xbin/dropbearkey
3) Navigate to the directory that contains those files using your favorite shell.
4) Push these to your device. This requires ADB (which is included in the Android SDK) in your path, it requires that your phone is rooted, and it requires that /system is mounted rw:
Code:
adb push dropbear /system/xbin/
adb push dropbearkey /system/xbin/
5) Run the following from 'adb shell' or a root terminal on your phone:
Code:
mkdir /data/dropbear; mkdir /data/dropbear/.ssh
(aside - why is there no -p option to my mkdir? weird)
6) From here, you can follow the instructions on the CM wiki and you're good to go!

How to Root Nexus 4 in Linux the Linux way.

Note read other installation methods for windows and mac. This might help fill in the blanks.
I know us linux users don't understand all the wordy talk in android so I will be short and specific.
Because adb and fastboot are not native to ubuntu or any linux distro you must place these executable files in /bin or /usr/bin folder.
Open terminal type sudo Nautilus.
You must be superuser to copy and paste to /bin file system.
Next select View>Extra Panel
Third step go into Home>Downloads adt-bundle-linux-x86.zip
Unzip and extract file
Now Open extracted folder adt-bundle-linux-x86>sdk>platform-tools
The folder above is where you will find both adb and fastboot just drag and drop them into /bin
Must also get Supersu.zip
As well as ClockworkMod
Ready to Unlock Bootloader, flash image and gain Root access.
Type:
1. adb reboot bootloader = will show if any items are unlocked will be in red writing.
Unlock Bootloader
2. fastboot oem unlock - will unlock bootloader and flash information. Means you lose the data.
Root Device
1. adb reboot bootloader - at this point the bootloader should be in red because it is unlocked.
2. sudo fastboot flash recovery '/home/unityman/Downloads/recovery-clockwork-6.0.2.0-mako.img'
What should follow is
sending 'recovery (7804 KB)... OKAY
writing 'recovery'... OKAY
This point proceed to Clockworkmod by selecting it with the up and down volume
When in Clockworkmod select from sdcard again use up and down arrows and power button to confirm selection.
It should load the SuperSu.zip and show you have superuser permissions. Not when reboot SuperSu will ask if you want to grant su permissions select yes.
Note for ubuntu users. Because you loaded foreign terminal commands such as adb and fastboot. U will get error msg something wrong with file system. Nothing happens Ubuntu just complains about error in file system. I've ignored message and updated ubuntu twice.
Well got to run and load Ubuntu emulator
Cheers!
Happy Holidays
PS. What the biggest misunderstanding between linux and android is we don't grant Su or root permissions permanently. We grant superuser or temporary root permissions. Could you imagine if every person got onto your personal computer had root access system would be toast in 10 mins.
Thanks for the write up bro. I just wanted to point out that adb and fastboot are natively supported in Ubuntu 12.10.
Sent from my Nexus 4 using Tapatalk 2
culaterout said:
Note read other installation methods for windows and mac. This might help fill in the blanks.
I know us linux users don't understand all the wordy talk in android so I will be short and specific.
Because adb and fastboot are not native to ubuntu or any linux distro you must place these executable files in /bin or /usr/bin folder.
Open terminal type sudo Nautilus.
You must be superuser to copy and paste to /bin file system.
Next select View>Extra Panel
Third step go into Home>Downloads adt-bundle-linux-x86.zip
Unzip and extract file
Now Open extracted folder adt-bundle-linux-x86>sdk>platform-tools
The folder above is where you will find both adb and fastboot just drag and drop them into /bin
Must also get Supersu.zip
As well as ClockworkMod
Ready to Unlock Bootloader, flash image and gain Root access.
Type:
1. adb reboot bootloader = will show if any items are unlocked will be in red writing.
Unlock Bootloader
2. fastboot oem unlock - will unlock bootloader and flash information. Means you lose the data.
Root Device
1. adb reboot bootloader - at this point the bootloader should be in red because it is unlocked.
2. sudo fastboot flash recovery '/home/unityman/Downloads/recovery-clockwork-6.0.2.0-mako.img'
What should follow is
sending 'recovery (7804 KB)... OKAY
writing 'recovery'... OKAY
This point proceed to Clockworkmod by selecting it with the up and down volume
When in Clockworkmod select from sdcard again use up and down arrows and power button to confirm selection.
It should load the SuperSu.zip and show you have superuser permissions. Not when reboot SuperSu will ask if you want to grant su permissions select yes.
Note for ubuntu users. Because you loaded foreign terminal commands such as adb and fastboot. U will get error msg something wrong with file system. Nothing happens Ubuntu just complains about error in file system. I've ignored message and updated ubuntu twice.
Well got to run and load Ubuntu emulator
Cheers!
Happy Holidays
PS. What the biggest misunderstanding between linux and android is we don't grant Su or root permissions permanently. We grant superuser or temporary root permissions. Could you imagine if every person got onto your personal computer had root access system would be toast in 10 mins.
Click to expand...
Click to collapse
Thanks for the guide. I used this on my Ubuntu 12.10 box.
A few notes:
- I had to do add "sudo" for fastboot oem unlock so:
Code:
sudo fastboot oem unlock
- fastboot and adb are part of Ubuntu now as mentioned above, so I just installed using
Code:
sudo apt-get install android-tools-fastboot
sudo apt-get install android-tools-adb
Thanks again!
Thanks guys. I just successfully installed CWM and rooted my phone using the combination of your instructions.
I agree. Simple and clear instructions. Thanks for writing this up.
I downloaded the Android ADT package for Linux x64 (I run Debian Wheezy/Testing). Google distributes this as a zip, and it includes ADB etc, along with eclipse to start developing apps. I want to do that at some point so decided to download the whole thing. The problem though is that while the Eclipse binary included in the package is built for x64, adb and other tools are instead built for i386. So if you ./adb in the platform-tools directory, you will get a 'file or directory not found' error. To fix this -
Code:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install ia32-libs
You should now be able to execute adb, fastboot etc. I also recommend creating symlinks in the /usr/bin or similar for the tools you use frequently.
Please do never ever use sudo nautilus !!!
This might override the rights of some of your ~/ directory.
Use gksu/ gksudo instead.
Sent from my Nexus 4 using xda app-developers app
Nexus 4 Root via Linux Notes
I rooted my Nexus 4 with my Linux machine (Linux Mint) earlier today. I had a couple hiccups, notably:
If you download the 64-bit/x86_64 version of ADT (Android Developer Tools, i.e. adb/Eclipse/etc. for Android development), the executable tools such as adb and fastboot are actually 32-bit. If you have a relatively fresh Linux install, you need to install the 32-bit executable binaries (see note below). Otherwise you will get strange errors even though the files are marked executable.
I sometimes had issues with my computer connecting to the phone via USB, especially after rebooting the phone. I found simply swapping USB ports (switching between the mouse and the phone, for example) would cause the phone to be recognized again.
Otherwise the process was smooth.
Here are the notes I collected as I searched the forums and web for how to root the phone in case they are helpful to someone. They're not really in any particular order; it's just a collection of what I found.
I used the following instructions:
http://makegadgetswork.blogspot.com/2013/01/root-nexus-4-on-linux-mint-13-and.html
Code:
# It had been so long since I used my personal Linux box that I
# forgot the root password :).
# Reset root password and main user password
http://community.linuxmint.com/tutorial/view/339
# Boils down to:
1) Enter grub by holding down shift key during boot.
2) Change:
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=[letters and numbers]\[letters and numbers] ro quiet splash vt.handoff=7
to:
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=[letters and numbers]\[letters and numbers] rw init=/bin/bash
# In x86_64 disto of ADT (Android Developer Tools), ADB libs are 32-bit.
#
# Running the 32-bit libs without 32-bit support will cause strange errors
# such as 'adb: No such file or directory'
#
# Here is how to install 32-bit binary runtime support on your 64-bit OS:
apt-get install ia32-libs
# Also install Java:
apt-get install sun-java6-jdk
# How to mount Nexus 4 in Linux
http://forum.xda-developers.com/showthread.php?t=2004182
# How to backup phone prior to unlocking (unlocking will cause a factory reset)
http://forum.xda-developers.com/showpost.php?p=34744848&postcount=4
# Linux root guide (this is what I followed)
http://makegadgetswork.blogspot.com/2013/01/root-nexus-4-on-linux-mint-13-and.html
# Another good root guide (Windows oriented)
http://forum.xda-developers.com/showthread.php?t=2018179
# Linux root guide on XDA
http://forum.xda-developers.com/showthread.php?t=35217628
# Root guides (didn't really use these)
http://www.cultofandroid.com/23782/rooting-the-google-nexus-4-the-right-way-how-to/
http://forum.xda-developers.com/showthread.php?t=2010312&highlight=+waiting+for+device+
# How to fix Android devices not recognized by ADB
# (check that ~/.android is not owned by root)
http://www.tuxtrix.com/2013/03/how-to-fix-android-devices-not.html
# SuperSU download link:
http://download.chainfire.eu/282/SuperSU/
# CWM link:
http://www.clockworkmod.com/rommanager
# Setup device support for N4
sudo vi /etc/udev/rules.d/51-android.rules
# My /etc/udev/rules.d/51-android.rules
> cat /etc/udev/rules.d/51-android.rules
#LG - Nexus 4 - MTP (mount as media device)
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
# Bootloader Nexus 4
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee0", MODE="0660", OWNER="ankit"
# Normal Nexus 4
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee1", MODE="0660", OWNER="ankit"
# Debug & Recovery Nexus 4
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee2", MODE="0660", OWNER="ankit"
# Aliases to mount device as MTP
alias n4_mt 'sudo mtpfs -o allow_other /media/nexus4'
alias n4_umt 'sudo umount /media/nexus4'
# File that contains USB/device settings for N4
/etc/udev/rules.d/51-android.rules
# Restart devices
sudo service udev restart
# Print USB devices
lsusb
# Print ADB help
adb
# Print connected devices
adb devices
# Print device serial number
adb get-serialno
# Print device state
adb get-state
# Restart ADB server
adb kill-server ; adb start-server
# Restore sdcard backup
adb push ~/n4_bak_7_28/sdcard /sdcard/
# Reboot device to bootloader mode (needed to run fastboot)
adb reboot bootloader
# Reboot device to recovery (needed for flashing partitions (i.e. custom recovery, ROM)
adb reboot recovery
# Restore backed up data
adb restore ~/n4_bak_7_28/backup.ab
# Run shell on device
adb shell
# Show devices connected to fastboot
sudo fastboot devices
# Unlock phone (must be running in bootloader mode)
sudo fastboot oem unlock
# Flash custom recovery
sudo fastboot flash recovery /home/femtodude/install_adb/adt-bundle-linux-x86_64-20130717/sdk/platform-tools/recovery-clockwork-touch-6.0.3.4-mako.img

[GUIDE] Extract Samsung *.tar.md5 files on Linux

Hey. While trying to port a TouchWiz ROM, I came across tar.md5 files. For some reason, every guide to open this format assumes you're using Windows. I use Linux Mint, so it was a bit of a problem. I found the solution, and thought I should post it here.
Materials required:
Android Kitchen
Linux distro with p7zip
Basic Terminal knowledge
Procedure:
1. Download Android Kitchen here: http://forum.xda-developers.com/showthread.php?t=633246
2. Download and install p7zip (for Ubuntu-based distros):
Code:
sudo apt-get install p7zip p7zip-full p7zip-rar
3. Open a Terminal in the directory where you have your tar.md5. Do:
Code:
7z e SomeReallyLongNameHowDoesSamsungRememberThis.tar.md5
And wait for the shell prompt to appear again. When it does, go to Android Kitchen's original_update folder and paste the boot.img and system.img that were extracted there.
4. Open a Terminal in Android Kitchen's directory. Do:
Code:
./menu
1
(just press enter, type nothing before it)
(type number corresponding to "system.img and boot.img" and press enter)
When it asks you for your password, give it the password. It needs that for mounting the IMG file.
Now your /system folder is in WORKING_whatever, and you can make a ZIP from Android Kitchen. Done.

Unbrick Htc Desire 626G+ [Noob Friendly Guide]

Hi this is an complete noob-friendly guide to un-brick a hard/soft bricked HTC Desire 626G+
[Things you need]
1. A Computer with Linux Distribution.
2. Stock firmware for HTC Desire 626G+ [https://drive.google.com/file/d/1bmmwKIzyjbk7Ii8UUI8_OAur72LSi8N8/view?usp=sharing]
3. Sp flash tool v5.1744.00 (for linux)
4. Download agent for Sp-Flashtool (DA_SWSEC.bin) [https://drive.google.com/drive/folders/1s0BPSkY9lYii58b-fdL0XMaTGMjnBoCX?usp=sharing]
[Steps]
1. The very first step is to install Linux distribution if thats already done then u can skip this step
2. the second step is to install Sp Flash tool version 5.1744.00 from the official website
i tried it with other version of flash-tools but the firmware fails to flash on HTC desire 626G+ so choosing the right version is a must.
you can find that version from (https://spflashtool.com/download/)
3. now we must install dependency for spflashtool
the only dependency i had trouble installing was libPNG12 so i will post that here
simply run this command on terminal
Bash:
wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb
dpkg -i /tmp/libpng12.deb
rm /tmp/libpng12.deb
after this also install generic usb driver by typing
Bash:
sudo apt install libusb-dev
after installing that you should be able to run flash tool for that follow step 4
4. after downloading sp flashtool and installing dependency
open terminal (shortcut [ctrl] + [alt] + [T] )
and type in terminal
Bash:
sudo apt update
then after that type
Bash:
sudo apt upgrade
we must allow flashtool to access the usb port without mode-manager interfering with flashtool
so in terminal type
Bash:
sudo gedit /etc/udev/rules.d/20-mm-blacklist-mtk.rules
a txt file will open and paste these 2 lines in it and save and exit
ATTRS{idVendor}=="0e8d", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="6000", ENV{ID_MM_DEVICE_IGNORE}="1"
and then after saving exiting txt file
in terminal type
Bash:
sudo service udev restart
after that u will have to goto flashtool directory by
Bash:
cd Downloads
cd SP_Flash_Tool_v5.1744_Linux
after that u will have to provide permission so that we can run the sp flash tool type
Bash:
chmod +x flash_tool
after this u should be able to run the flashtool by typing
Bash:
sudo ./flash_tool
5. after step 4 u will likely have flash tool open and ready to go now u should extract the firmware u downloaded from link provided above
after extracting chose the scatter file for htc desire 626g+ and make sure to select the download agent "DA_SWSEC" which u can download from the link above, do not use the default one or flash will fail or wont start.
now click on download and connect ur phone while holding down the volume down key
note: if ur phone keeps disconnecting try flashing without battery.
6. after flashing is done boot the phone and Profit!
NOTE: Make sure to set your download agent in spflashtool as "DA_SWSEC.bin or mtkallinone" which you downloaded from the above link and then flash or else u might get error

[Guide]Temporary root(Dirty COW) Marshmallow , Honor 5x

This is a guide on how to obtain temporary root on marshmallow stock ROM for the Honor5x. Works on KIW-L24 and should work fine for other models.
1. Install Android Studio.
2. Install NDK within android studio.
3. If you run
Code:
ndk-build
and it says command not found, you'll need to add the ndk-build path to your environmental variable. After you install NDK, 'ndk-build' file will exist on your computer. In Linux, the path location is ~/Android/Sdk/ndk/22.1.7171670/build/ndk-build
Ex.
Code:
export PATH=$PATH:/home/user123/Android/Sdk/ndk/22.1.7171670/build/
4. Download Dirty COW exploit and extract zip to a folder: https://github.com/timwr/CVE-2016-5195
5. Open terminal and navigate to 'CVE-2016-5195' directory.
6. Plug your phone in and make sure you can 'adb devices'.
7.
Code:
make root && adb shell;
8.a If you get error 'CANNOT LINK EXECUTABLE cannot locate symbol'. Then go to ~/Android/Sdk/ndk/22.1.7171670/build/gmsl and modify line 512 of '__gmsl' to say:
Code:
int_encode = $(__gmsl_tr1)$(wordlist 1,$(words $1),$(__gmsl_input_int))
More Info See: https://stackoverflow.com/questions/17131691/non-numeric-second-argument-to-wordlist
8.b.
Code:
make root && adb shell;
9. If everything goes right, you should be inside the shell of the phone and you should see '#' instead of '$', which indicates root.
The command that gets executed that puts you in temporary root is
Code:
adb shell /system/bin/run-as
Now what I don't know is how to obtain permanent root from here. Most people are going to say 'unlock your bootloader and flash a different ROM'. While I agree, this is the ideal solution. But if you can't unlock bootloader then the next best thing is permanent root on your current build.
I got # after step 9. But how that is temporary root? Root checker app doesn't recognize as rooted device.

Categories

Resources