[Guide] How to edit build.prop without Root (fix memory management) - OnePlus 3 Guides, News, & Discussion

We are fighting a losing battle against Google's Safety Net via Systemless Root and various mods which mask root.
For those of us who enjoy Android Pay this may be a worthy alternative to systemless root, which has and will continue getting blocked by Google:
-Ensure adb and fastboot is installed on your PC
-Boot to fastboot and install TWRP if you haven't already
Code:
fastboot flash recovery filename.img
-Reboot to Recovery (TWRP); select Mount -> check System and enable editing System when it prompts you
-Connect device to PC:
Code:
cd C:\Users\YourUsernameHere\Desktop
Code:
adb pull /system/build.prop
-The build.prop will be downloaded to your desktop
-Save a copy of the build.prop just in case and make the desired changes via Notepad++ (recommended). To fix the memory utilization look for the line which shows:
Code:
ro.sys.fw.bg_apps_limit=32
and change the 32 to a value between 32 and 100. I find with it set to 90 I can best utilize the 6GB of RAM. I am seeing between 4.1 to 4.4GB utilization in normal use and as high as 4.9 when I'm trying to fill the RAM.
-Once done, run this command to push the file back to phone:
Code:
adb push build.prop /system/
-Fix permissions as not to trip Safety Net (Android Pay):
Code:
adb shell
cd system
chmod 644 build.prop
-you can leave TWRP installed if you want but you can only take OTA with stock recovery. To install stock recovery reboot to fastboot and do:
Code:
fastboot flash recovery recovery.img
I take zero credit for the above. I wanted a solution for having proper memory utilization without root (Android Pay without the hassle) and found the commands on androiding.how
The only problem with the above setup is no adblock (AdAway). I chose to purchase an AdGuard license (root-less adblock) as a workaround.

Setting ro.sys.fw.bg_apps_limit=90 seems a bit high.......I noticed most Build.Prop on Custom ROMs are lower than that (between 40 and 60).

But what's the point of this when you have to unlock the bootloader to do so?

Related

[FAQ] GT540 Reference Thread | How-to's | Data2System method by Anton_ch ADDED!

~ FAQ | LG GT540 REFERENCE THREAD ~
.:: http://mygt540.com ::.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
~ o ~​
LG GT540 is equipped with 512Mb ROM (flash memory).
It is divided into sections:​ * Boot (boot partition | 5 MB) - contains the kernel of linux system and the ram-disk image
* System (system partition | 245 MB) - contains built-in Android applications
* User (userdata partition | 138 MB) - contains custom applications / settings
* Cache (cache partition | 64 MB) - unnecesary files you need to clean often
​ ~ o ~
​START | NEWBIE
[HOW-TO] Set up SDK/ADB/FASTBOOT on Ubuntu 11.04
[HOW-TO] Set up SDK/ADB/FASTBOOT on Windows | Flash Android ROMs 2.1/2.2/2.3
[HOW-TO] Create a EXT4 & SWAP partition on Windows / Linux
[HOW-TO] Use ADB tool | Android Debug Bridge
[HOW-TO] Install LG IME Full
[HOW-TO] Change default fonts | Custom ROMs
[HOW-TO] Use Fastboot tool | Bootloader
[HOW-TO] Replace Files | Set permissions
__________________________________________________
RESTORATION | ADVANCED
[FAQ] My Phone is bricked !!! | GUIDE
__________________________________________________
TECHNICAL TRICKS
[TUTORIAL] Self-Assembly of Android OS Firmware
[TUTORIAL] Data2System method by Anton_ch | Custom ROM's
[HOW-TO] Fix MD5 mismatch | Nandroid restore
[HOW-TO] Fix Russian Profile | Swiftdroid
[HOW-TO] Change default low system sounds | Sound Scheme
~ Please user DO NOT POST IN HERE, LET'S KEEP THE THREAD CLEAN, PM me if you have a question or something to say. Thanks! ~
​
are Welcomed!!!
[HOW-TO] Set up SDK/ADB/FASTBOOT on Ubuntu 11.04
TUTORIAL #1
THANKS TO bloodychaos FROM XDA
I've been searching around the forums,the stickies and Google on how to install ADB in Ubuntu from scratch but I wasn't able to get a guide anywhere. What I found mostly are for Windows or little bits and pieces of info which did not cover the whole thing. Which is when I decided to grab some Tab and Mountain Dew, and Google my way through to make it work and share it to those who had trouble or no idea how to install it on Ubuntu.
When I'm writing this, I'm using Ubuntu 10.10 64bit to install and run everything. There was mentions of using Eclipse SDK while searching around, but I won't be touching on that. There's another guide for it at the end of my guide. I have yet to encounter any problems while using ADB in 64bit environment. I've tested it out on the 32bit platform as well and it works. It'll also work on SD and NAND versions of Android for the HD2, since it's my main phone. Also, this is my first time making a guide, so bear with me if there's any mistakes. I've checked the article a few times hoping that it's clear and easy to understand.
Step 1. Install JDK
You'll need to install JDK for ADB to work. If you have already installed JDK, I recommend reinstalling it again, just in case there are new updates or you have the older version.
Open Terminal and enter the following command(s), then enter your ubuntu login password followed by ‘y’ when prompted for yes/no.
Code:
$ sudo apt-get update
$ sudo apt-get install openjdk-6-jdk
Step 2. Download and Install Android SDK
Download the Android SDK. Obviously, choose the one for linux (android-sdk_r10-linux_86.tgz)
Code:
http://developer.android.com/sdk/index.html
Extract the android-sdk-linux_x86 folder from android-sdk_r10-linux_x86.tgz and put folder to your desired location. I recommend to put in home/username/ | When using the terminal the same path is described as ~/
Step 3. Choose packages to install
First of all go to ~/android-sdk-linux_x86/tools/
Right clic to android >> Properties >> Permissions
Make sure "allow executing file as a program" it's checked
In Terminal, type the following
Code:
$ cd ~/android-sdk-linux_x86/tools
$ ./android update sdk
The 'Android SDK and AVD Manager' window will appear (screencap below). If you are not a developer then just accept the first option to install and the rest reject. Once installation is finished, it will prompt you to restart the manager. Just click 'Yes' and close the manager
Step 4. Check your device's permission
Now head over to the platform-tools directory
Code:
$ cd ~/android-sdk-linux_x86/platform-tools
Check if you have permission for your device
Code:
$ ./adb devices
If you're getting the following, go on to Step 5.
Code:
List of devices attached
???????????? no permissions
If you're getting something like this or other random numbers with the word device next to it, congrats! You now could use ADB. Now go on to Step 7.
Code:
List of devices attached
0123456789ABCDEF device
Step 5. Giving permission to your device
You'll need to create a certain udev rule. First off type the following in Terminal:
Code:
$ sudo gedit /etc/udev/rules.d/99-android.rules
Once the gedit window pops-up, type the following line
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
Here's a list of each vendor's ID. Source: http://developer.android.com/guide/developing/device.html
Save the file and exit out of gedit. Back in Terminal execute the following
Code:
$ sudo chmod a+rx /etc/udev/rules.d/99-android.rules
$ sudo restart udev
$ sudo adb kill-server
Then unplug your phone and plug it again
Now to check if it works
Code:
$ ./adb devices
You should be getting the following line or something similar:
Code:
List of devices attached
0123456789ABCDEF device
Congrats! Now you can use ADB in Ubuntu! Now hop on to Step 6!
Step 6. Create path for ADB and Fastboot
NOTE: while using adb in Linux, you'll need to type ./adb to execute adb unless you create a path in ~/.bashrc.
Code:
$ sudo gedit ~/.bashrc
Add the following line at the very end of the file. Once you're done, save and exit.
Code:
# Android tools
export PATH=${PATH}:$HOME"/android-sdk-linux_x86/tools"
export PATH=${PATH}:$HOME"/android-sdk-linux_x86/platform-tools"
Then in a Terminal run this command to reload your .bashrc:
Code:
source ~/.bashrc
Now you can just run adb without put ./ before every command.
Step 7. Set up FASTBOOT
Download Fastboot file from here: http://www.mediafire.com/?uc8zvuoklr8qlmk
Move it to ~/android-sdk-linux_x86/tools/ folder
Right clic to Fastboot >> Properties >> Permissions
Make sure "allow executing file as a program" it's checked
Reboot in fastboot mode (bootloader), then plug your phone with USB cable to a computer
Open a terminal and type:
Code:
$ sudo -s
# fastboot devices
0123456789ABCDEF fastboot
NOTE: you must login as root to fastboot to work. If you get an error issuing the last command then most likely something went wrong while creating a path for fastboot in ~/.bashrc, then you should try with ./ statement before the command like this:
Code:
# ./fastboot devices
0123456789ABCDEF fastboot
__________________________________________________
* For more in-depth guide, try HowtoForge. Just found this guide today and I find it VERY useful and even have a good guide on Eclipse.
[HOW-TO] Set up SDK/ADB/FASTBOOT on Windows | Flash Android ROMs 2.1/2.2/2.3
TUTORIAL #2
HELLO I SEE THERE IS QUITE OF PEOPLE (NEWBIES) THAT ARE HAVING PROBLEMS WHILE FLASHING, MOST OF THE TIMES FROM STOCK 1.6 TO 2.1, SO I WANTED TO SHARE THIS TUTORIAL I MADE AND WOULD LIKE TO ALL OF YOU CONTRIBUTE IN SOMETHING MISSING OR NEW THINGS FOR THIS TUTO AND MAKE IT THE UPDATED AND BEST TUTO FOR DUMMIES OUT THERE . NO OFFENSE . JUST THAT THERE ARE LOTS OF PEOPLE NOT FAMILIARIZED WITH THIS KIND OF STUFFS.
THANKS TO CHKRLY FROM TARINGA! FOR THE BASIS OF THIS TUTORIAL, i added and quit some parts, translated and attached files...
WARNING: Any of these methods can brick your phone, im not responsible if that happens. READ ALL THE TUTORIAL FIRST. If your phone gets unresponsive DO NOT PANIC! we are here for HELP!
FIRST PART
(Flash from 1.6 to 2.1 with fastboot)
In this part we are going to flash an european ROM that comes with fastboot with the purpose of flash other ROMs that needs fastboot later...
1. Create a folder, download the KDZ Updater , the European ROM and the drivers for our LG GT540 and unzip them all in the same folder.
Install KDZ
Deactivate your FIREWALL and Antivirus if necessary
Install drivers:
UPDATE: Thanks to eoghan2t7 you can install LG GT540 drivers all in one:
METHOD1: NEW
LGGT540 ALL IN ONE DRIVER PACK.exe (32 bits users only)
METHOD2: OLD
Or install the drivers in the old normal way (32 & 64 bits users)
WINDOWS7 users: Right clic>> Run as administrator.
Also is very important you install the drivers inside the LG_SmartPhone folder:
2. On to the phone go to: SETTINGS >> APPLICATIONS >> DEVELOPMENT and activate the mode USB debugging , also check out this:
SETTINGS >> SD CARD AND PHONE MEMORY >> EXTERNAL ONLY MEMORY (not SECRET_, remove if), then plug you phone to the computer
3. Close all applications you do not need on the computer and run the KDZ_FW_UPD.exe (Windows 7 users: right clic>>start as Administrator)
4. Once in the program select from the TYPE list the 3GQTC option and then clic in the folder icon and select the European ROM(KDZ file) from the folder where you unziped, then press the button Launch Software Update
NOTE: It is important mention that while in the process dot not interrupt the program, unplug the phone or shutdown the computer
*If it stops in any of the processes and doesn't finish (processes doesn't get stuck for long), then unplug your phone, close the program, open it again plug your phone, and run it again.
*If that doesn't help eather, remove the battery, close the program, plug your phone to the computer, start the program and run the process again.
NOTE: various problems in the following procedure to update can occur if non of the above tips helped then try this:
Go to Device Manager in your computer>> right click on the LG Modem Android>> DISABLE / Modem>> LGE Virtual Modem>> DISABLE and then try FLASHING AGAIN
THE WHOLE PROCESS SHOULD TAKE 10 MINUTES​
Once the program has loaded the ROM to the phone it will appear a leyend FINISHED, after that the phone will reboot and boot android 2.1 with fastboot.
SECOND PART
(Flash from stock 2.1+fastboot to custom 2.1/2.2/2.3...)
1. Download the following files:
- Google SDK tools, unzip and put the folder in C:\ drive
- Drivers for your computer recognize the phone in fastboot mode. Unzip and put the files inside the folder in C:\android-sdk (take a look of the 3th image)
INSTALL WITH YOUR PHONE PLUGGED:
... then next and it will install the drivers.
- Clockwork recovery (latest version) and place it in C:\android-sdk
- Download the ROM you want to flash for FASTBOOT NOT RECOVERY, UNZIP and place the .IMG FILES in C:\android-sdk
NOTE: It is RECOMMENDED that from stock 2.1 you flash to 2.2 and then to 2.3 and so on, this means not go directly to 2.3.3 as may cause your phone do not boot properly and also not login to recovery. This is not confirmed but some users have experienced this kinds of issues.
2. Shutdown your phone and Start it in fastboot mode (CAMERA+POWER BUTTON) hold the camera for 1 sec then add the power button . Wait few second you will see LG's logo then the screen will turn dark, CLEAN DARK SCREEN, just in that moment you are in FASTBOOT mode.
3. Flash rom by FASTBOOT mode:
Plug your phone to the computer and open a CMD terminal and type:
Code:
cd C:\android-sdk
4. Once inside the folder type ONE by ONE:
Code:
fastboot flash recovery recovery_clockwork_3.0.2.4_swift.img
fastboot -w
fastboot erase boot
fastboot erase system
fastboot flash boot boot.img
fastboot flash system system.img
fastboot -w
fastboot reboot
THAT MY FRIEND IS A CLEAN INSTALL...
5. Once is rebooting fast login to recovery pressing POWER+HOME. Inside recovery select wipe data/factoryreset for reset the phone. Then select reboot, and that's it YOUR DONE!
NOTE: If you are flashing any ROM with data2system method then DO NOT WIPE DATA/FACTORY RESET, just reboot.
6. Set your phone as you like install all your apps and once you done reboot into recovery and go to backup & restore>> backup for create a backup of your entire phone.
[HOW-TO] Use ADB tool | Android Debug Bridge
TUTORIAL #3
You can find the adb tool in C:\<sdk>\platform-tools\ or C:\<sdk>\
*All the examples refers to /data/app path you can change to /system/app or any other path you need
Open a CMD terminal on Windows:
Start>>run>> type cmd>> click ok (WinXP)
Start>> in search box type cmd>> right click Run as Administrator (Win7)
Once opened type:
Code:
cd C:\<sdk>\platform-tools
adb devices
adb remount (from r/o to r/w)
-----------------------------------------------------
adb shell mount /system (if you only want to mount system)
adb shell mount /data (if you only want to mount data)
Installing an Aplication .apk
Put the .apk file into C:\<sdk>\platform-tools\ folder and type
Code:
adb install [B]appname[/B].apk
Uninstalling an Aplication
There is an uninstall adb commans that always shows failure!!!
So we are going to use Adb Shell:
Code:
adb shell
# cd data/app
# ls
# rm -r appname.apk
# ls
Ctrl+c to exit shell mode
You will not find this application, you just removed it!
Push & Pull commands
Pull:
Code:
adb pull /data/app/appname.apk
If you want to PULL all the files located in a folder then:
Code:
adb pull /data/app test
to pull all the .apk's located /data/app and save them into a folder that it will create in C:\Android-SDK\platform-tools named test
Push:
Code:
adb push appname.apk /data/app
If you want to PUSH all the files located in a folder then:
Code:
adb push test /data/app
to push all the .apk's located in C:\Android-SDK\platform-tools\test folder to /data/app
Close ADB
Code:
adb kill-server
exit
[How-to] Replace Files | Set permissions
TUTORIAL #4
When you need or would like to add or replace a file to our phone we need to set permissions.
In this tutorial we are going to use Root Explorer for this purpose, because is the "standar" file manager that comes with custom roms lately.
Apart of this, if you are having issues with applications for incorrect permissions then you might FIX permissions using ROM MANAGER application not RECOVERY (not recommended)
REPLACING A FILE:
in this example we are going to replace our old Music.apk for the newest Music.apk...
*Applies for replace any file
Before: After:
1. Backup your old Music.apk then uninstall it (I can do both with RootAppRemover.apk or Titanium Backup)
1. Plug your phone, mount your sdcard then download Music.zip
to your desktop
2. Put the Music.apk and libjumper.so into /sdcard/newmusic folder
3. Close the windows, unmount your sdcard, unplug your phone then go open Root Explorer application
4. Go to sdcard/newmusic/ >> press menu button >> Multi-select >> select Music.apk >> press copy button
5. Press back button and go to system/app/ >> press Mount R/W >> press Paste button
6. Look for the Music.apk you just pasted and press on it until a window pops up:
7. Select Permissions and change them to rw-r--r--
TO
It should look like this:
9. Repeat process from step 4-to-7 to replace libjumper.so but to /system/lib/ path
THANKS ARE WELCOMED!!!
[TUTORIAL] Self-Assembly of Android OS Firmware
TUTORIAL #5
* This tutorial was created for me after read from many sites and figure it out by myself and the result is a 100% fully working step by step tutorial.
* First of all you need to have installed Ubuntu then Follow this: [How-to] Set up SDK/ADB/FASTBOOT in Ubuntu 10.10
* Once everything is set and working download IMG_tools.zip then unzip in home/username/IMG_tools/
* When i mention ~/ means home/username/ but shorty
Proceed...
Extract boot. img
-To extract boot.img use extract_boot from ~/IMG_tools/boot
- Put boot.img file inside ~/IMG_tools/boot/ folder
- Open a terminal and type:
Code:
$ cd ~/IMG_tools/boot
$ ./extract_boot boot.img
- if you want to extract boot.img in another folder, for ex. in ~/ROM/ then the command is
Code:
$ ./extract_boot ~/ROM/boot.img
- You will get something like this
Page size: 2048 (0x00000800)
Kernel size: 2664916 (0x0028a9d4)
Ramdisk size: 966,485 (0x000ebf55)
Second size: 0 (0x00000000)
Board name:
Command line: mem = 214M console = tty0, 115200n8 androidboot.hardware = swift uart.mode = arm11_uart_disable crash = off
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
3210 block
Click to expand...
Click to collapse
Rebuild boot.img
-To rebuild boot.img use make_boot from ~/IMG_tools/boot
- Double click make_boot>> show
Compare info after cmdline with Command Line after extracted boot.img, if its different then modify the file.
- Once verified info type:
Code:
$ ./make_boot boot.img
- You will now see a boot-new.img file ready for flash
Click to expand...
Click to collapse
Extract system. img
-To extract system.img use unyaffs from ~/IMG_tools/system
- Put system.img and unyaffs file inside ~/IMG_tools/system/system folder
- Open the terminal and type:
Code:
$ cd ~/IMG_tools/system/system
$ ./unyaffs system.img
- Then cut system.img and unyaffs file and put them back to ~/IMG_tools/system
Click to expand...
Click to collapse
Rebuild system. img
-To Rebuild system.img use mkfs.yaffs2 from ~/IMG_tools/system
- Do not move mkfs.yaffs2 file
- Open the terminal and type:
Code:
$ ./mkfs.yaffs2 system system.img
Click to expand...
Click to collapse
Rebuild system. img [update.zip]
* works to sign .apk too
- If you have based your work on RUU file, you’ll have to create META-INF folder with the correct information and update scripts inside. If you have unpacked someone’s .zip, the META-INF folder should be already present. Update script might mention some files in the update, so if you have removed (or added new) files, the update script should be amended to reflect those changes. Please, get a few images from different developers and try to understand the correct internal structure.
Once you have something like this:
- Open the terminal and go where your <workdir> content is: META-INF, system, boot.img then type
Code:
$ zip -r9 update.zip *
-r9 tells the program to collect files recursively and use the maximum compression. If you omit “r”, the subfolders will not be included (bad, bad idea!), if you omit “9″ nothing bad will happens, but resulting file might be about 1% larger.
- Now to sign the zip file put sign folder and androsign file from ~/IMG_tools/sign/ to ~/*SDK/tools
- Go back to the terminal and type
Code:
androsign /<workdir>/update.zip
Click to expand...
Click to collapse
Odex Files
- What are those Odex files? Answer
- How to get rid of them?
Odex files depend on framework they are made for. To deodex an odex file use that how to
Then you may create a classes.dex file by executing the smali program on the "out" folder. You then rename it to classes.dex and add it to the .apk.
- How to create them?
Use dexopt-wrapper on device.
For deodex ODEX files, use this howto
Then you can create classes.dex file by running smali from your "out". Then rename it to classes.dex and add it to apk.
Click to expand...
Click to collapse
Porting another's devices ROM
Well, this part is simple smile_good.gif
- Extract system.img
- Extract boot.img
- Replace boot.img-kernel of the original Roma HTC Hero.
- Rebuild boot.img
- Collect update.zip (see how it's done in any Custom rum for Hero)
- Sign and flash.
Device should start, and even be able to call, but probably will not work WiFi, BT, trackball.
Click to expand...
Click to collapse
[HOW-TO] Fix MD5 mismatch | Nandroid restore
TUTORIAL #6
THANKS TO ihtfp69 FROM XDA!
To fix this is assuming you did not change the folder names and let Clockworkmod create them.
Code:
Checking MD5 sums...
MD5 mismatch!
- Plug your phone to the computer
- Open a Terminal and type:
Code:
adb devices
adb shell
# cd /sdcard/clockworkmod/backup/2010-06-29.20.22.53
# rm nandroid.md5
# md5sum *img > nandroid.md5
# exit
* Substitute the final folder name for the backup you need to fix.
- Re-run the restore and everything should be fine.
NOTE: As rpearl stated, there could be something really wrong with your nandroid, so use this tutorial as a learning experience and not a fix-all. In my case, everything was fine after restoring. However, that may not always be the case. Do this with caution.
[HOW-TO] Install LG IME Full
TUTORIAL #7
- Dowload LG_IME_data2system and unzip in desktop
- Open System folder and copy the 3 folders: app, lib2 and usr folders to C:\*SDK\platform-tools\
- Plug your phone to the computer
- Open a CMD terminal and type:
Code:
cd C:\*SDK\platform-tools
adb devices
adb remount
adb push app /system/app
adb push lib2 /system/lib
adb push usr /system/usr
adb kill-server
exit
- Unplug your phone
- Go to ROM Manager application and run Fix Permissions (DO NOT avoid this step, so you dont get FC's)
DONE!
[HOW-TO] Use Fastboot tool | Bootloader
- What is fastboot?
Fastboot tool is a program used to update the flash partitions in Android devices from a host (PC) over USB.
It allows you to perform flashing images (*.img) files to your device.
_________________________________________
- How do i get in Fastboot mode?
You can boot in Fastboot mode in two ways:
1. For 2.2 / 2.3 Android ROM:
Hold the power button until a window pops up | Select reboot >> bootloader >> OK
2. For any Android ROM
Shutdown the phone >> hold CAMERA + POWER buttons
_________________________________________
- How do i know im in Fastboot mode?
After you press the combo buttons and the phone starts you be able to see the LG logo and just after that the screen will clean and turn dark-blue, nothing else. If that happens congratulations! you are in Fastboot mode.
NOTE: it has been told that in some firmwares the fastboot mode screen turns out blank. If you experience that dont panic! you might want to try another firmware with the normal fastboot mode.
_________________________________________
- Usage of the Fastboot commands
NOTE: to start using Fastboot is assuming you already have installed SDK with all the tools
1. You need to place the *.img files you are going to flash into
C:\*SDK\tools\ (Windows)
Home/username/*SDK/tools (Linux)
Click to expand...
Click to collapse
2. Plug your phone with a USB cable to your computer
3. Open a Terminal (Windows|Linux) and issue the following commands:
Code:
fastboot erase recovery
------------------------------------
fastboot flash recovery recovery_clockwork_x.x.x.x_swift.img
fastboot -w
fastboot erase boot
fastboot erase system
fastboot flash boot boot.img
fastboot flash system system.img
fastboot -w
fastboot reboot
* fastboot erase recovery | use when reinstalling clockwork recovery
* fastboot -w | is for wipe data/cache and make a factory reset
[HOW-TO] Fix Russian Profile | Swiftdroid
THANKS TO tejasdj12 FOR THIS FIX
There are 2 ways to Fix Russian Profile:
METHOD #1:
Copy the profiles.xml file to /data/system folder. Reboot.
* If the first method did not work then you have a second method
METHOD #2:
1. Open Root Explorer or any other file manager
2. Find /system/build.prop file and edit these sections:
Code:
'ro.product.locale.language=ru' to 'ro.product.locale.language=en'
'ro.product.locale.region=RU' to 'ro.product.locale.region=US
3. Save the File
4. Reboot into recovery and wipe user data/factory reset. Reboot.
[HOW-TO] Change default fonts | Custom ROMs
THANKS TO sonnysekhon FROM XDA!
* Tested on CM7 ROMs | PM me if it works with/without CM6
METHOD #1: [Install zip from recovery]
1. Download the Font you like from here:
2. Mount your phone and put the .zip into SDcard/
3. Unplug your phone and reboot it into recovery.
4. After that, go to “install zip from sdcard >> choose zip from sdcard >> select your copied zip file”
5. After it installs it, select “reboot system now”
________________________________________________
METHOD #2: [Using ADB tools | Data2System by Anton_ch users]
1. Download the Font you like from here:
2. Unzip the folder to your desktop. You will see 2 folders:
META-INF
System
3. Open System folder and copy fonts folder to C:\*SDK\platform-tools\
4. Plug your phone to the computer
5. Open a CMD terminal and type:
Code:
cd C:\*SDK\platform-tools
adb devices
adb remount
adb push fonts /system/fonts
adb kill-server
exit
6. Unplug your phone. Reboot
DONE!
________________________________________________
* If you want to go back to default-fonts, download and repeat steps 2-6 from METHOD #2
[FAQ] My Phone is bricked !!! | GUIDE
THANKS TO ilovelg FROM MODACO!
So you failed to read the TUTORIAL and bricked your phone while trying to flash GT540, here is what you should try to do:
[HOW-TO] Repair your device if you see only LG logo | Nothing else happens when you boot your device
Make sure you use USB ports that are in back of youre PC, dont use front ones.
Disable LGE Virtual Modem. In your Windows operating system, go to Control Panel > System > Hardware > Device Manager > Modems > Right click on LGE Virtual Modem and click Disable.
Try to reflash your phone again, in the normal way.
____________________________________________
[HOW-TO] Repair your device if it feels like dead | When you click power button nothing happens (Note that this may or may not work)
Make sure you use USB ports that are in back of youre PC, dont use front ones.
Disable LGE Virtual Modem. In your Windows operating system, go to Control Panel > System > Hardware > Device Manager > Modems > Right click on LGE Virtual Modem and click Disable.
Try to boot your phone into Emergency/Download mode (VOL DOWN + POWER).
If the phone booted into Emergency/Download mode, launch KDZ Updater.
In TYPE dropdown menu, choose EMERGENCY.
Load KDZ(ROM) and flash your phone.
If the phone failed to boot into Emergency/Download mode (VOL DOWN + POWER), launch KDZ Updater.
In TYPE dropdown menu, choose CS_EMERGENCY.
Load KDZ(ROM) and flash your phone.
____________________________________________
THANKS TO fishears FROM XDA!
[HOW-TO] Repair your device if you don't see LG logo, boot animation | Recovery doesn't show up
Download the French v20A and the out.kdz
Take out your battery, SIM and SD card
Plug USB into PC (but not phone yet)
Hold (VOL DOWN) button and plug USB into phone | *Phone goes into Download Mode
Run KDZ Updater
In TYPE dropdown menu, choose CS_Emergency mode
Load French V20A ROM and flash it
When it's finished pull out USB again and hold (VOL DOWN) and reinsert USB to put phone back in Download Mode
Launch KDZ Updater (still in CS_Emergency mode)
Load out.kdz and flash it
You should now have your boot animations back and you can flash whatever ROM you want to use.
____________________________________________
LAST RESOURCE:
If the phone still doesn't work, take your phone to local LG Warranty service or your Operator where you got the phone. Tell them that after you turned the phone off, it doesn't seem to turn back on again!
Click to expand...
Click to collapse
[HOW-TO] Change default low system sounds | Sound Scheme
THANKS TO miroslav_mm & Glay-z FROM 4PDA!
Introduction:
Sources were taken from the phones Nokia, Sony Ericsson, iPhone, HTC and others converted to a good quality and matched to the "my taste, for a full sound experience through our LG GT540 speaker! No pop, rock and techno is not here! ​
Also, as a bonus, was changed bootanimation(CyanogenMod 7.0) and tuned the system started for 2.1 ROMs!
- Requires ROOT
- Require recovery v3.0.2.4 +
- The installation is via recovery: Update.zip
-----------------------------------------------------------------------------
- Data2System by Anton_ch users cannot install zip from sdcard, instead replace with Root Explorer or push files with adb tool. Please take a look in the Thread to see how-to do it.
The path is:
Code:
/system/media/audio/alarms
/system/media/audio/notifications
/system/media/audio/ringtones
* In almost all the versions i've made there is not need to do this as i've already done it, only the clean versions users might use it!
Sound Scheme for LG GT540 v1.0 by miroslav_mm
* Works on firmware version 2.1 (A, B, D, Quarx) | 2.2.1 (only partially replaces the tunes as there are more than 2.1)
Were replaced by all the usual sounds of SMS, alarm clock, income calls!
update.zip (16.69MB)
Sound Scheme for LG GT540 v2.0 by Glay-z
* Works on firmware version 2.3.2 | 2.3.3 | 2.3.4
Were replaced by all the usual sounds of SMS, alarm clock, income calls, all the keys and the camera!
update3.zip (15.18MB)
Sound Scheme for LG GT540 v3.0 by Glay-z
* Works on firmware version 2.3.2 | 2.3.3 | 2.3.4
Unlike version 2.0 it does not replace the key sound but instead installed a new font
update5.zip (33.03MB)
Sound Scheme for LG GT540 v4.0 by Glay-z
* Works on firmware version 2.1 | 2.3.2 (ignore the bootanimation) | 2.3.3 | 2.3.4
Were replaced all the system sounds and added CM7 bootanimation as a bonus
update10.zip (45.34MB)
[TUTORIAL] Data2System method by Anton_ch | Custom ROM's
PREREQUISITES:
------------------------------------
* Have Ubuntu in your PC by: Live CD, installing with Wubi, installing with a Virtual Machine or if you want to give it a long try installing directly to your PC.
* Set up Ubuntu with Android-SDK tools: [How-to] Set up SDK/ADB/FASTBOOT in Ubuntu 10.10
* Once everything is set and working download IMG_tools.zip then unzip in home/username/IMG_tools/
* FLASH THE ROM/FIRMWARE YOU WANT TO MODIFY WITH THIS METHOD
INSTRUCTIONS:
------------------------------------
FIRST PART
[Rebuild the kernel with a modified init.rc]
SECOND PART
[Flash new kernel, fit system in /data, modifications]
1. Go in recovery > mounts&storage and mount / system and / data
2. Open a terminal and type:
$ cd ~/android-sdk-linux_x86/platform-tools
$ adb shell
First make sure that operation is possible:
# df
Will be a similar conclusion:
# Filesystem 1K-blocks Used Available Use% Mounted on
# Tmpfs 85908 0 85908 0% / dev
# / Dev/block/mtdblock1 65536 1160 64376 2% / cache
# / Dev/block/mtdblock4 250880 122344 128536 49% / system
# / Dev/block/mtdblock6 141 824 1156 140 668 1% / data
Size used in the /system 122,344 KB
Total size in /data partition 141824 KB
3. Hence system will fit in /data (estimate with a margin of 3-4 MB just in case)
As 122344 is < than 141824 = IT FITS! / Until 138 MB size in /system is safe to go
If it does not fit - clean /system from unnecessary:
# cd /system/app
# ls
# rm example.apk
If it fits, has more free space and you want to install apps:
# exit
Install applications of interest, here are some how-to's:
<< You can fill the partition until you get 138MB to be safe >>
[HOW-TO] Install LG IME Full
[HOW-TO] Change default fonts | Custom ROMs
[HOW-TO] Replace Files | Set permissions
[HOW-TO] Change default low system sounds | Sound Scheme
$ adb push ...
If it fits but you don't want any modification in it, then we proceed...
# exit
4. Put boot-new.img into ~/android-sdk-linux_x86/platform-tools/ folder and type:
$ adb push boot-new.img /data/
$ adb shell
# flash_image boot /data/boot-new.img
Now go to the directory /data and clean it
# cd /data
# rm -r *
On the lost + found - do not pay attention, everything is OK
Go to /system and copy all to /data
# cd /system
# cp -a * /data/
Process is not fast ... wait
Now clear the /system
# rm -r *
5. In the recovery unmount /system and /data
6. You can immediately make a backup of what happened.
I am on switdroid M5. I tried method 1 above for two different fonts and both failed with similar messages.
E:Error in /sdcard/Font_stock.zip (status 0)
Installation aborted.
[email protected] said:
I am on switdroid M5. I tried method 1 above for two different fonts and both failed with similar messages.
E:Error in /sdcard/Font_stock.zip (status 0)
Installation aborted.
Click to expand...
Click to collapse
Maybe because you have the latest recovery installed and its not compatible with that script, but try second method works for everybody anyways
EDIT: Please DO NOT POST IN HERE, LET'S KEEP THE THREAD CLEAN, PM me if you have a question or something to say.
Veronica
[HOW-TO] Create a EXT4 & SWAP partition on Windows / Linux
Thanks to pyroblazer from XDA!
*** PRINT THIS HOW-TO ***​
WINDOWS
What is needed:
* gParted / Ubuntu Live CD image
* Blank CD-R / WUBI for Ubuntu
* Software to burn a .iso image
* USB cable / card reader
1) Download the stable version of gparted Live CD (.iso) from here:
http://gparted.sourceforge.net/download.php (133.6 MB)
Or download Ubuntu (.iso) Live CD, which is always good to have:
http://www.ubuntu.com/download/ubuntu/download (685,29 MB)
If you already have an Ubuntu image good for you !
2) Once downloaded Burn it using your favorite burning software (i use Ultra ISO), it will burn as bootable by default.
If you don't have a blank CD-R and want to give ubuntu a try you can install it with WUBI on windows as any other program.
3) Restart your computer and enter to the BIOS (usually by pressing F2/del) ,in boot menu change the boot order to bring your CD drive on the top and then exit saving changes with F10
4) Once your computer restarts, it will boot from the CD and you will see some weird lines on ur screen, the you'll come to a page where u have 4 options, select the 1st one.
5) Once started it will ask you for preferred language, select ur language by typing the numbers given and hit enter, after that it will again give u 3 options PRESS 0 AND HIT ENTER
-----U Will get a blurred screen now bt dont worry -------
6) Now u should have booted into gparted, wait for a dialog to open, then you would be able to see your computer's hardisks
7) Plug your phone to the pc & Turn on USB storage / put your sdcard inside a card reader and connect it to the pc
8) On the right-hand side top corner you can select to see ur SD card (dropdown list of all the storage devices connected to the PC)
9) After selecting the SD card you will see ur SD card in the main screen(along with the partitions, if any)
10) Right Click on you FAT32 SD card partition and then click Resize partition
11) A box will appear to resize the space for a new partition. Choose the size you want to make it (Just think about the size of EXT4 partition + 32 MB [recommendable] SWAP you want to give in the 'Free space following box'. Leave it as PRIMARY and then clik add.
12) Now you'll see 2 partitions, one FAT32 and the other one is unallocated, right click on the unallocated one and click new then type 32 in the free space following box, make sure its also on PRIMARY in the create as box, and then u can select any file system you want (EXT2,3,4) then click add
13) Now only 32 MB will be shown as unallocated. Right click on that and click new, don't change anything, except the file system box, select it as linux SWAP, then click add
14) Now click apply. Congratulations!!!!!!! You are done with the partitioning of your SD card!!!!
On the top left of your screen u can see an icon named as exit/turn off, click on it and then select reboot and click ok... ur pc will restart and boot to windows....
UBUNTU LINUX
What is needed:
* USB cable / card reader
The proceedment is almost the same as above, because gParted belongs to linux and Ubuntu already comes with gParted application so that means you are ready to go!
1) Plug your phone to the pc & Turn on USB storage / put your sdcard inside a card reader and connect it to the pc
2) Open Gparted > Right Click on you FAT32 SD card partition and then click Resize partition
3) A box will appear to resize the space for a new partition. Choose the size you want to make it (Just think about the size of EXT4 partition + 32 MB [recommendable] SWAP you want to give in the 'Free space following box'. Leave it as PRIMARY and then clik add.
4) Now you'll see 2 partitions, one FAT32 and the other one is unallocated, right click on the unallocated one and click new then type 32 in the free space following box, make sure its also on PRIMARY in the create as box, and then u can select any file system you want (EXT2,3,4) then click add
5) Now only 32 MB will be shown as unallocated. Right click on that and click new, don't change anything, except the file system box, select it as linux SWAP, then click add
6) Now click apply. Congratulations!!!!!!! You are done with the partitioning of your SD card!!!!

[MOD-HOW TO] Root with One click root - Superboot.img

Hi all,
Here is a alternative method (faster) to root the Nexus S (I9020 and I9023), not need to flash custom recovery.
The aim of the One click root, by Paul O'Brien method is to replace the stock boot.img by a superboot.img (with su and Superuser.apk) to obtain root access.
APPLY THIS AT YOUR OWN RISK!
Intructions:
1- Prerequisites:
- USB drivers installed
- Nexus S recognised in bootloader mode
- Unlocked bootloader
For these manipulations: here (I9020T) or here (I9023 & I9020a)
2- Process
- Download the file "Build_NexusS_One-click-root.zip" corresponding to your build (very important !) : here
WARNING: GRJ22 version: issue with Bluetooth, don't use it, unless you don't care bluetooth, I will try to solve this problem.
While waiting to find a solution, just flash the stock boot.img (2.3.4) if you have the BT problem, for this:
In bootloader mode, type in the console (or terminal...): "fastboot flash boot boot.img". Bluetooth will work and you keep root access.
Click to expand...
Click to collapse
- Unzip it in a directory
- Turn On the phone in bootloader mode (by holding down the Power and Volume Up buttons)
# Windows:
Just double click "install-superboot-windows.bat" (in the extracted folder)
# Linux
- Open a terminal (Ctrl + Alt + T)
- Change directory to the extracted folder:
Code:
cd /.../"Build_NexusS_One-click-root"
- Type:
Code:
chmod +x install-superboot-linux.sh
- Then:
Code:
./install-superboot-linux.sh
# Mac
- Change directory to the extracted folder:
Code:
cd /.../"Build_NexusS_One-click-root"
- Type :
Code:
chmod +x install-superboot-mac.sh
- Then:
Code:
./install-superboot-mac.sh
Your Nexus S is now rooted !
Adapted from: http://android.modaco.com/topic/327000-07mar-gri40-colour-revert-superboot-rooting-the-nexus-s/
PS: sorry for my language.
I appreciate you trying to help but if an unlocked bootloader and drivers are required then why not just fastboot flash recovery and install the su zip in recovery. IMO this is unnecessary really.
Sent from a lounge chair on my deck.
What is the easiest and fastest ?
1- double clic on a file or
2- flash recovery + flash su.zip in recovery ?
This method isn't necessary you're right, like I said it's an alternative "method".
Chamb' said:
What is the easiest and fastest ?
1- double clic on a file or
2- flash recovery + flash su.zip in recovery ?
This method isn't necessary you're right, like I said it's an alternative "method".
Click to expand...
Click to collapse
Flash recovery + flash su zip gives you, more control I think also I'm tired of people flash ROMs and then having problems and whining about how they need step by step directions when you suggest adb to help them fix it... I mean if you are gonna mod and hack at least learn what you are doing first....
/end rant
Also yes clicking is easier but IMO installing, the drivers (which your method requires) IS the hardest part.
This worked perfectly for me. Couldn't figure out the other way of rooting but this was simple so thank-you
Sent from my Nexus S using XDA App
Bluetooth cannot be enabled anymore
After rooting the Nexus S with Android 2.3.4 with this rooting instruction I cannot enable Bluetooth anymore. When I try to enable Bluetooth it says "Turning on.." but stops after two seconds and goes back into disabled Bluetooth state.
Bluetooth worked before just fine. Why did this happen and how can I resolve it?
Log file entries when switching on BLuetooth:
Code:
DEBUG/BluetoothService(120): Bluetooth state 10 -> 11
VERBOSE/BluetoothEventRedirector(562): Received android.bluetooth.adapter.action.STATE_CHANGED
INFO/bluedroid(120): Starting hciattach daemon
ERROR/bluedroid(120): bt_enable: Timeout waiting for HCI device to come up
DEBUG/BluetoothService(120): Bluetooth state 11 -> 10
VERBOSE/BluetoothEventRedirector(562): Received android.bluetooth.adapter.action.STATE_CHANGED
This is a problem I've seen occur after the root, not with this method but it can happen apparently, some people had this issue.
But I do not know the cause, the kernel is 100 % stock.
Try this:
- delete the superboot folder (/) and the su file (/system/xbin) with a root explorer
- then reboot the phone in bootloader mode and flash the stock boot.img (2.3.4) by typing "fastboot flash boot boot.img"
Now you're unroot
- then retry the one click root

[HOW-TO] Modify system files without root

I was experimenting how to modify system files on a stock system image without installing superuser and thought I'd share what I found:
What you need:
android platform tools (ADB and related files, FASTBOOT)
custom recovery (I used TWRP). You need to be able to gain adb root access, which is not possible using a 'production' image (to quote google's error message when I tried this) which is why you need to have a custom recovery. WARNING!! If you perform an oem unlock of your device to unlock the bootloader, you will be forced to wipe your device, proceed at your own risk! I am not responsible for what you do with your device.
Administrator access on your pc (if using windows)
In my example I was modifying /system/etc/gps.conf to use local time servers for faster GPS lock. To do this I rebooted into my custom recovery, mounted the system partition (rw) and used:
Code:
adb pull /system/etc/gps.conf
I then edited the file locally to use the desired NTP server with notepad++.
following this I used:
Code:
adb push gps.conf /system/etc/gps.conf
At this point I rebooted and used:
Code:
adb shell
to run the cat command on /system/etc/gps.conf and confirm my updates were now visible in the updated gps.conf file.
Hi friend! Can you help me?
C:\adb>adb push gps.conf /system/etc/gps.conf
failed to copy 'gps.conf' to '/system/etc/gps.conf': Read-only file system
reijr said:
Hi friend! Can you help me?
C:\adb>adb push gps.conf /system/etc/gps.conf
failed to copy 'gps.conf' to '/system/etc/gps.conf': Read-only file system
Click to expand...
Click to collapse
In TWRP mount system
I've used this before to change my build.prop
After updating to the latest build on Nexus 5, this no longer works.
I can pull and push the build.prop boot on reboot the original file returns.
Any ideas ?

[GUIDE] Upgrade 4.5.15 rooted & encrypted -> 5.0.2 WITHOUT DATA/SETTINGS LOSS

as usual, if anything goes wrong, no responsibility etc
The official update tutorial for rooted users doesn't keep app data, only internal storage! This tutorial keeps EVERYTHING
This method allows updating from 4.5.15 (unlocked, encrypted, rooted) to 5.0.2 without any data (sys settings + app data + user data) loss
A FAQ section is present at the end of this post and will be regularly updated.
List of files to download while doing the following steps:
OOS 5.0.2 ROM
Codeworkx TWRP recovery
Latest Magisk
Terms and software used in this guide:
Fastboot / Bootloader = bootloader of the phone, it's a very low level mode of the phone that allows booting into recovery. Can be accessed by using the advanced reboot menu (enable in dev options) or by "adb reboot fastboot".
Recovery = a small operating system on the phone that allows you to do various operations even when the main OS (Android) is broken. This includes flashing ROMs, modifying stuff on the storage, etc. It's the Android swiss army knife. If you can get a phone to boot TWRP, then you can do almost anything.
Magisk = rooting software that uses a systemless method to keep SafetyNet working. Systemless = instead of modifying the system, every change is put in a separate image that is mounted "over" the system. When the system tries to access a file modified by Magisk, instead of reading it from the partition, it reads it from Magisk. It's recommended to use Magisk instead of SuperSU as of 2018.
ADB = tool that allows controlling the phone from your PC through USB. You can use it when you're in Android if USB debugging is enabled in the settings, or when you're in TWRP. Here, we mostly use it for transferring files directly (without MTP) and running commands (using "adb shell")
Note: For this guide you will be required to download and install Magisk. If you don't want your phone to be rooted, then at the end of this guide reboot into TWRP, wipe both caches and re-flash the OS. This will uninstall Magisk and any other root patch. Beware: it will reflash stock recovery, so if you ever want to re-root, you'll need to reboot to fastboot and flash TWRP manually.
Convention for commands that you will have to run:
a command line starting with "C:" means that it should be run on your PC
a command line starting with "~ #" means that it should be run on your phone (through adb shell) while in TWRP
a command line starting with "OnePlus5:/ $" means that it should be run on your phone (through adb shell) while in OxygenOS
Although the commands start with "C:", this is just for readability purposes. You should run everything from inside an empty directory with enough disk space and writing access.
Your phone will have to be plugged in to your PC from the beginning to the end. Also, make sure it has at least 80% battery before beginning, just in case.
I know, the tutorial is huge. This is simply due to the fact that if I just wrote "make a nandroid backup of this and that, flash, and restore the backup while doing this", then some people may encounter problems because not everyone knows how to do a nandroid backup, restore it, etc. Also, there are a lot of things that need to be done precisely that way and not another way, which explains why the tutorial is huge. Also, you may notice that there is a lot of commands to run throughout the tutorial, this is because that way, I'm sure that at the end, you will have done everything like I did it on my phone, so that if you have a problem it's much easier to figure out where it comes from.
Summary of what you need to do (this is only a SUMMARY to give you a preview of what the whole thing looks like, you shouldn't follow it except if you're really an expert since a lot of things need to be done precisely, instead you should follow the easier complete steps below):
Make a Nandroid backup of /data
Backup files on internal storage
Wipe everything (internal storage + /data + system + caches), and then format data (important!)
Push and flash the OOS zip
Wipe caches and reboot (to Oreo!)
When it reboots, make sure everything (features, like Wi-Fi and fingerprint sensor) works. Don't "save anything" though, everything you do will be erased when we'll restore your backup. This is just a "test drive" for Oreo.
Reboot to TWRP, wipe Data and restore the /data backup
Run the three commands to fix Wi-Fi and fingerprints
Reboot (to System) and check everything works (don't do anything, don't change any setting, just make sure it works)
Reboot to TWRP, rename the "Android" folder to "Android_oreo" on sdcard, delete everything else on sdcard and restore your internal files
Rename the freshly restored Android (nougat) folder to "Android_nougat" and rename "Android_oreo" to "Android".
Flash Magisk, wipe dalvik+cache and reboot to System
When in Android, everything should work except some apps won't have their data. This is normal. Open a terminal (either on your phone using Termux or from your PC using adb shell), elevate using su and rename "Android" to "Android_oreo" and "Android_nougat" to "Android" (this is so that it correctly restores permissions)
If everything works fine, delete the "Android_oreo" folder
First, if you have Xposed Framework (systemless or not) installed, uninstall it. Next, if needed, uninstall any Magisk module that is "Nougat-only" to prevent any problems afterwards.
Boot the phone to bootloader/fastboot (either using advanced reboot, or by using volume down button when you start your phone) and boot to the TWRP recovery by doing
Code:
C:\> fastboot boot twrp-3.2.1-0-oreo-8.1-codeworkx-cheeseburger.img
from your PC.
Next, in TWRP, make a backup of /data (using the Backup button). Then, still while in TWRP, run the following commands:
Code:
C:\> adb shell
~ # cd /sdcard
/sdcard # tar cvf twrp.tar TWRP
/sdcard # md5sum twrp.tar
<< md5 checksum of twrp.tar >>
/sdcard # exit
C:\> adb pull -p /sdcard/twrp.tar
When the above command has finished, make sure that the checksum of the received twrp.tar file matches the one previously displayed.
If it doesn't match, delete the file and run adb pull again. Don't continue following this guide until you have received a 1:1 (checksum-wise) backup of /data.
Code:
C:\> adb shell
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
~ # rm -rf /sdcard/TWRP
~ # rm /sdcard/twrp.tar
That was for /data. Now, the backup for the internal storage:
Code:
~ # cd /sdcard
/sdcard # du -csh
<< you should see here the total size of sdcard, that'll give you an idea of how long it'll take >>
/sdcard # tar cvf sd.tar element1 element2 element... elementN
<< in the command above, replace "element1..N" by a space-separated list of what you want to have in the backup.
Keep in mind that your list HAS to contain the element "Android" (case is important). It contains the app data.
Let's say for example you want to keep only the photos you have taken (and nothing, nothing else that was on internal storage).
The photos are in the folder DCIM, so the command will look like this:
tar cvf sd.tar Android DCIM
(because you want DCIM, and Android has to be in the list, no matter where)
>>
/sdcard # md5sum sd.tar
<< md5 checksum of sd.tar >>
/sdcard # exit
C:\> adb pull -p /sdcard/sd.tar
When the above command has finished, make sure that the checksum of the received sd.tar file matches the one previously displayed.
If it doesn't match, delete the file and run adb pull again.
Keep in mind that anything you don't put in that list will not be backed up and will be lost!
Now, you have a backup for all the important stuff so we can start doing the real sh*t.
Now, the important step:
Go back to the TWRP home screen, press "Wipe", "Advanced Wipe" and there check "Dalvik / ART Cache", "Cache", "System", "Data" and "Internal Storage". Confirm using the slider at the bottom of the screen. Press the home button, then "Reboot" and "FastBoot". Now, type the same fastboot command as in the previous step to boot the recovery image. You'll enter the recovery as before.
Now, on your PC, in the terminal, type
Code:
adb push -p OnePlus5Oxygen_23_OTA_029_all_1801292040_d71af3d.zip /sideload
(note: here, we are not using "adb sideload", we are really using "adb push"). In TWRP, click Install, in the file manager go to /sideload and select the OOS zip file. Confirm by sliding. If you get an error, go back to home, click Mount and ensure System is not checked. Then try installing again. If it still does not work, reboot to fastboot, type command again, get to the recovery and install again.
When the zip-file is installed, go home, click "Wipe", "Advanced Wipe" and check both caches and confirm. Then, go home, click "Wipe" and then "Format Data". Then, go home, click "Reboot" and then "System". Your phone will now reboot to Oreo. It will take a long time, but do not turn off the phone. Let it run. On my phone, it took on average 2 minutes for that boot.
You'll be greeted by the "first boot" page. It'll ask you if you want to restore a backup or start anew, choose start anew. Connect to your Wi-Fi network and Google account. Follow all the instructions until you get to the home screen. There, make sure everything works (especially Wi-Fi and fingerprint sensor). Don't save your fingerprints yet, they will be erased afterwards. If everything works, you can continue following these instructions. If not, post a comment down there.
Now that you're at the home screen, go in the settings, About Android and click the build number 8 times to enable Developer Options. Go in there and enable advanced reboot. Then, reboot your phone into fastboot/bootloader using the power button. Type the exact same command as before to start TWRP. Once that you are in TWRP, run the following commands:
Code:
C:\> adb push -p twrp.tar /sdcard/
C:\> adb shell
~ # cd /sdcard
/sdcard # tar xvf twrp.tar
/sdcard # cp /data/misc/wifi/WifiConfigStore.xml /sdcard/
In TWRP, click "Wipe", "Advanced Wipe" and check only the "Data" partition. Confirm. Press home, then "Restore" and choose the backup in the list. Confirm to restore. Back to the terminal, we need to run the following commands otherwise Wi-Fi and fingerprints won't work:
Code:
/sdcard # cp WifiConfigStore.xml /data/misc/wifi/
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
Note: the command above are ran from your PC in an adb shell while the phone is still in TWRP.
Reboot the phone to system and ensure Wi-Fi and fingerprints are still working. Right now you should already see your old home screen and all your apps, but the internal storage isn't there yet. Reboot in fastboot, run the command to get in TWRP.
Once TWRP has booted, run the following commands:
Code:
C:\> adb push -p sd.tar /sdcard/
C:\> adb shell
~ # cd /sdcard
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
/sdcard # rm -rf Alarms Albums DCIM Download Movies Music Notifications Pictures Podcasts Ringtones
/sdcard # ls
<< now, look at the list of files that were printed, and rm anything left that is not called "Android" or "sd.tar"
<< WARNING: dangerous command! double check everything is correct before pressing enter! >>
if when you do rm <the thing> it tells you it's a directory, then do: rm -rf <thething>
if there's a folder called SomeFolder, do "rm -rf SomeFolder"
next, run this:
/sdcard # ls
Android sd.tar <-- expected output
/sdcard # mv Android Android_oreo
/sdcard # tar xvf sd.tar
/sdcard # mv Android Android_nougat
/sdcard # mv Android_oreo Android
If you don't have Magisk somewhere on your sd card, download it and upload it using MTP or adb. Then flash it using the Install button. Clear dalvik/cache and reboot to system.
When the phone has booted (again, it might take time), make sure USB debugging is enabled and run the following commands:
Code:
C:\> adb shell
OnePlus5:/ $ su
<< here, you might see a Magisk screen asking for superuser access. Allow. >>
OnePlus5:/ $ cd /sdcard
OnePlus5:/sdcard $ mv Android Android_oreo && mv Android_nougat Android
Now, try some apps and make sure all the data is there (especially games and Netflix/Hulu/etc). If everything is there, and the phone works properly, go back in the terminal and type:
Code:
OnePlus5:/sdcard $ rm -rf Android_oreo
Optionally, start the TWRP app and flash it, it can always be useful. You can also reboot to fastboot to do that.
Now reboot your phone (normal reboot) one last time.
There, working OOS 5.0.2 / Android 8.0.0 phone with no data loss.
Frequently Asked Questions
How long does the whole thing take?
Highly depends on the amount of data you have on your phone. Since it the USB port only supports USB 2.0, it may take 4 or 5 hours in total.
Will doing this void my warranty?
No.
Will I be able to install future OTA updates using the regular download-reboot-flash-twrp procedure?
Yep. Just use the regular method as you would have on Nougat.
Will I lose my data?
If you follow all the instructions, no. Even if you don't follow them, as soon as you have made a backup of /data and internal storage, then no matter how bad you screw up you could always get a working phone back.
I followed the instructions and now my phone doesn't work
Boot in TWRP, wipe everything, reflash.
questions will be added there in the future
Having WiFi and fingerprint issues
You sure it is a good idea to just delete those files? I would have guessed that I need to replace these (nougat version from backup) with the oreo version to have it working just like before the restore.
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
I'm having the issues with wifi and fingerprints. Neither one is working. I'll try to figure out how to fix this.
@zdimension Thanks for this guide, I don't have time to test it yet, but I have a question
pdluke said:
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
Click to expand...
Click to collapse
At this point in the procedure, adb shell is still using root (before flashing magisk) ? How is that possible ? Does the adb /sideload preserve root ?
olivier380 said:
@zdimension Thanks for this guide, I don't have time to test it yet, but I have a question
At this point in the procedure, adb shell is still using root (before flashing magisk) ? How is that possible ? Does the adb /sideload preserve root ?
Click to expand...
Click to collapse
These commands should be run while the phone is in TWRP. Also note that adb /sideload is not used here, only adb push.
pdluke said:
You sure it is a good idea to just delete those files? I would have guessed that I need to replace these (nougat version from backup) with the oreo version to have it working just like before the restore.
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
I'm having the issues with wifi and fingerprints. Neither one is working. I'll try to figure out how to fix this.
Click to expand...
Click to collapse
If you delete them, they will be generated automatically at the next system boot. But you could also make a backup of those three files before wiping /data, store that somewhere, restore Nougat /data and then restore your backup of those three files. The result would be the same.
Note: actually, not exactly. Erasing the first file won't change anything since it's not used anymore in Oreo, but the two other files contain the fingerprint configuration (list of saved fingerprints). So,
Either you remove the files and you have to save your fingerprints again at next boot
Either you restore them from an Oreo backup and you'll get the fingerprints you had saved during the "first boot" procedure when you rebooted the phone right after flashing the OS
But the result is mostly the same: everything works. Deleting the files ensures you get something clean. If you restore from an Oreo backup I can't guarantee the result (as it may interfere with other files from the Nougat backup).
10 bucks to make a script to do this all for me haha.
@zdimension Thanks for the clarification Another thing you might add to the files to download would be Magisk (optionally). In this kind of guide, I've always find it useful to download everything first.
olivier380 said:
@zdimension Thanks for the clarification Another thing you might add to the files to download would be Magisk (optionally). In this kind of guide, I've always find it useful to download everything first.
Click to expand...
Click to collapse
Oops, forgot to add it
I added the link, and also instructions for how to un-root afterwards for those who would want it.
To improve the guide, here are some ideas :
- You should highlight that rm -rf is a very dangerous command, and that it needs to be checked twice (especially the targeted folder)
- It could be useful to use the du -csh command to check the size of a folder (to estimate the backup time for example).
- As a safety measure, one could md5sum the tar file before and after using adb pull
What do you think ?
olivier380 said:
To improve the guide, here are some ideas :
- You should highlight that rm -rf is a very dangerous command, and that it needs to be checked twice (especially the targeted folder)
- It could be useful to use the du -csh command to check the size of a folder (to estimate the backup time for example).
- As a safety measure, one could md5sum the tar file before and after using adb pull
What do you think ?
Click to expand...
Click to collapse
Thanks for the ideas! I updated the post (and I added a changelog at the bottom for future reference).
Followed guide for successful upgrade from 4.5.15 encrypted, unlocked bootloader w/ Magisk root.
One note, after the first complete wipe and flash of the full ROM, it was getting stuck on first boot and never completed. Discovered that I needed to not just wipe the Data partition but Format it in TWRP, to clear out the old encryption I think. Magisk wouldn't install either until I did this.
@debork thanks for the positive feedback (all the merit goes to @zdimension of course)
@zdimension there are many people in the other thread https://forum.xda-developers.com/oneplus-5/how-to/official-oxygenos-4-5-2-7-1-1-ota-t3627003 that tried (unsucessfully) to upgrade from 4.5.15 to 5.0.1, maybe a link to this topic could be useful for them (if it's not too late).
Regarding the
Go back to the TWRP home screen, press "Wipe", "Advanced Wipe" and there check "Dalvik / ART Cache", "Cache", "System", "Data" and "Internal Storage".
Click to expand...
Click to collapse
I think it should be highlighted in red, since it is the actual "clean flash" (AFAIU, correct me if I'm wrong).
if we only have the BL unlocked non root and stock recovery can we only ota without any loss of data ?
debork said:
Followed guide for successful upgrade from 4.5.15 encrypted, unlocked bootloader w/ Magisk root.
One note, after the first complete wipe and flash of the full ROM, it was getting stuck on first boot and never completed. Discovered that I needed to not just wipe the Data partition but Format it in TWRP, to clear out the old encryption I think. Magisk wouldn't install either until I did this.
Click to expand...
Click to collapse
Thanks for feedback, I will add that to the guide (although it worked with just Wipe for me )
zdimension said:
Thanks for feedback, I will add that to the guide (although it worked with just Wipe for me )
Click to expand...
Click to collapse
Have you rooted the 4.5.15 with Magisk or SuperSU (which is not compatible with Oreo anymore) ?
olivier380 said:
Have you rooted the 4.5.15 with Magisk or SuperSU (which is not compatible with Oreo anymore) ?
Click to expand...
Click to collapse
I stopped using SuperSU when it was sold to that shady company. Also, Magisk is better imo.
quick05 said:
if we only have the BL unlocked non root and stock recovery can we only ota without any loss of data ?
Click to expand...
Click to collapse
Official OnePlus support said that nothing is guaranteed if your bootloader is unlocked. But since you're on stock recovery + non rooted, you could always try. But backup everything first. Some people here on XDA have reported that it doesn't work, though.
Just followed your guide with no problems. Thank you very much!! I can confirm also that you need to format data after the wipe otherwise it gets stuck in a bootloop!
Thanks so much for this. I was able to successfully follow the guide and get upgraded to 5.0.1 without losing any data. In fact, I even messed up one step by failing to include the Android directory in the sdcard.tar backup (perhaps that should be more explicit), but it doesn't seem to have affected everything; all of my apps seem to have retained their data.
A few notes:
1. The file size of twrp.tar was ~14GB but when executing the pull command, it recognized it as only ~1.3 GB. As a result, the pull was not complete until it reached over 1000%. All the more reason to do the md5 check.
2. As others stated, I needed to format the data partition, not just wipe it.
3. I might recommend also including a "summary" version somewhere on what this guide does. Scrolling through the guide the first time, it seemed pretty daunting, but really all that you're doing is: backing up data partition and internal storage; wiping device; flashing Oreo ROM; tweaking a few files; and restoring backed up data and internal storage.
Thank you again so much! Glad to finally be on Oreo.
elight3 said:
Thanks so much for this. I was able to successfully follow the guide and get upgraded to 5.0.1 without losing any data. In fact, I even messed up one step by failing to include the Android directory in the sdcard.tar backup (perhaps that should be more explicit), but it doesn't seem to have affected everything; all of my apps seem to have retained their data.
A few notes:
1. The file size of twrp.tar was ~14GB but when executing the pull command, it recognized it as only ~1.3 GB. As a result, the pull was not complete until it reached over 1000%. All the more reason to do the md5 check.
2. As others stated, I needed to format the data partition, not just wipe it.
3. I might recommend also including a "summary" version somewhere on what this guide does. Scrolling through the guide the first time, it seemed pretty daunting, but really all that you're doing is: backing up data partition and internal storage; wiping device; flashing Oreo ROM; tweaking a few files; and restoring backed up data and internal storage.
Thank you again so much! Glad to finally be on Oreo.
Click to expand...
Click to collapse
Thanks for the feedback! I'll add a summary to the guide.

How To Guide Extract Boot Image (for Root) - the DSU-Sideloader Method (and Other Tutorials)

Very nice to see Y700 get it's own place on XDA! I myself had just bought the 12GB version and have been very satisfied. The tutorials and info related to this model had been very difficult to come by and mostly in other languages, so I had to do my own research and exploration. So far I was able to flash ROM and extract it's boot image for root thanks to the following tutorial (in Japanese)
boot.imgを入手できない機種でMagiskを導入する方法【DSU Loader】
Android端末のカスタマイズやRoot権限の使用が可能となる「Magisk」ですが、一部例外を除き、導入に…
smartasw.com
The boot image extraction part is trickier as Y700's roms come in GSI form. But with a workaround we can still achieve the same goal. (I heard that you can also use QFIL to do that but I haven't been able to make the tool work, so if someone else can make a tutorial that'd be great)
First you need to prepare:
- DSI-Sideloader from https://github.com/VegaBobo/DSU-Sideloader/releases
- Magisk Manager from topjohnwu's GitHub repo
- a GSI ROM with built in root permission. The one the tutorial was using: https://github.com/phhusson/treble_experimentations/releases/tag/v402 --> go download "system-squeak-arm64-ab-vanilla.img.xz" (~600MB, smallest needed to fulfill the task)
- turn on developer mode and ADB debugging. Get Google SDK platform tools ready and USB drivers installed.
Connect your Y700 to a computer. Check if ADB works.
Next, install the DSI-Sideloader app. Also extract the .xz package you downloaded above to get the .img image (should be ~1.7GB in size)
Copy the image to your Y700 tablet. Open the DSI-Sideloader app, load the image, set userdata size to default (2GB). You can leave image size unchanged.
NOTE: if you have an SD card inserted, click on "config" and check "Unmount SD", or just eject your SD card from tray. Failing to do so will result in error in the install step.
After you're done, click "Install". Once finished there will be a pop-up with commands you need to enter in the terminal of your choosing. On your computer navigate to the directory containing executables of Google SDK platform tools, fire up terminal, enter the 1st command (says non-root) as instructed, and run it.
You will see a progress bar in the drop-down notification area which will complete in a moment and prompt you to reboot. Do that from there.
After reboot you will be running the modded Project Treble ROM, with root access. It's a full fledge OS but once you shutdown / reboot you will go back to your own OS. Treat it as a LiveCD of some sort.
While still connected, turn on dev mode + ADB debugging and go back to terminal for some ADB work. Next we will be extracting boot image under the current environment, made possible by it's built-in root permission.
Run the following line by line:
Bash:
adb shell
Bash:
su
Bash:
cd /dev/block/bootdevice/by-name/
Bash:
mkdir /sdcard/backup_img
Bash:
for file in *; do
if [[ "${file}" = boot* ]]; then dd if=/dev/block/bootdevice/by-name/"${file}" of=/sdcard/backup_img/"${file}".img ; else continue ; fi
done
The 4th command creates a new directory storing extracted boot image, in our case /SD card/backup_img; and the 5th command is the meat of the entire process. It consists of 3 lines, key in one at a time and press "Enter". First line is "for...do", second is "if [[..." to "fi", third is just "done".
After some time the extracted boot image will be stored under the directory specified by the 4th command, in our case /sdcard/backup_img . They are stored in the temporary user space and once you reboot to your original OS you won't be able to access them again. So you need to turn on File Transfer mode, go to the actual directory on your PC and move them to your computer. They have the filenames "boot_a.img" and "boot_b.img" . After you're done, just reboot as usual and you'll get into your old OS.
Now you have the boot images, all that's left is to use Magisk Manager to patch them, enter fastboot mode, and flash the patched images using the following commands:
fastboot flash boot_a patched_img_A.img
fastboot flash boot_b patched_img_B.img
(Rename as needed)
And now your Y700 is rooted.
The linked Japanese webpage also talks about working Android 12 / 13 GSI flavors, patches, and ways to set up your Y700.

Categories

Resources