Sei sulla pagina 1di 7

[Oppo R819][Guide] Flashing Stock Recovery After

Using TWRP

By Distan7
Indonesia Hebat
I'm sure some you ever heard of CWM or TWRP, useful recovery packages able to make Nandroid backup
& restore, wipe your data etc. It's also needed in times you need to flash custom ROM such as MIUI for
R819. In simple words, TWRP is packed with tons of features in contrast to stock Oppo Recovery.
However after flashing TWRP, no matter how many times you flash ColorOS with clean install + wipe
data, TWRP never gets replaced. There are reasons to revert back to stock Oppo Recovery --- bring back
the device to its' pristine out-of-the-box condition, or maybe you want to return your product or else.
Some folks want to try TWRP but if there's no way to revert back to Oppo Recovery, this will look like a
one-way journey and they hesitated.
This guide here will tell you exactly how easy it is to revert back to Oppo Recovery once you have TWRP
installed.
What you need to have first :
1. Root your device properly. If you had flashed TWRP I'm sure you know how to root R819.
2. A file explorer that can access /system partition (Root Explorer, ES File Explorer, etc as long as
it's able to show the content of /system) or simple Terminal Emulator
3. Why you need #1 and #2 ? Because you have rename a file in /system partition, and this
requires root access.
Detailed steps :
1.
2.
3.
4.
5.
6.
7.

Open your file explorer and browse to /system folder


Find this file : recovery-from-boot.bak
Rename that file to recovery-from-boot.p
You'll need to mount your /system partition with read+write (rw) access first
Reboot your device, or twice to be sure
After that, reboot to recovery
You'll have Oppo Recovery back

Story behind the screen :


Each time ColorOS boots it will check if recovery in the phone is Oppo Recovery; else ColorOS will flash
Oppo Recovery. All resources needed are already within ColorOS ROM so no flashing tools needed. This
automatic checking is done by a script in /system/etc/install-recovery.sh and the resource for recovery
installation is in/system/recovery-from-boot.p.
Somehow first time R819 booted into TWRP and then --- after you're finished with flashing, wiping,
backup etc --- reboot into system, the 2nd file above will be renamed to /system/recovery-from-

boot.bak. So even though the automatic script install-recovery.sh gets executed in each boot, no change
in recovery will ever happen due to file system-recovery-from-boot.p not found. All we need is to rename
the file back to /system/recovery-from-boot.p so script /system/etc/install-recovery.sh can finish its' job.
I tried this myself, and for assurance after I had Oppo Recovery back, I flashed TWRP, and tried
reverting back to Oppo Recovery with steps above and it worked.
PS : Original thread for this discussion is here [ColorOS] Need Stock Recovery for R819

[Oppo R819][Guide] Mod Your Partition : 2GB and


3GB

By Distan7
Indonesia Hebat
Modding partition for MT6589 involves hex-editing two files EBR1 and EBR2 which you can find in ROMs
that can be flashed using SP Flash Tool. Editing these files is easy, you only need to change a few things
and flash them. Finding such ROM, in other way, is not so easy for this phone.
What I share here is a Aroma Installer file you must flash in TWRP (I didn't try with Oppo recovery so
please don't ask). Install / flash the zip file just like flashing ROMs and it will start-up a GUI and you just
follow the instructions.
First, for the sake of common understanding let's agree with these terms below so you'll know what I
mean when I said SD Card or Internal etc.

Phone Storage / SD Card : This is where you keep your music, photo, video, downloaded files
etc.
System Storage / Internal : This is where your phone stores installed apps with their data, dalvik

files etc.
Oppo ROM : Old default ROM in R819 before official ColorOS (green bootlogo).
ColorOS : The current official ROM for R819 (silver bootlogo)
Stock ROM / AOSP ROM for R819. Some refer this to Stock ROM, some say AOSP ROM.

Now here are the steps to do this. Looks complicated and advanced ? Well maybe, but not until you try
them.
A. Root your device (skip if you're rooted already)
You can do this with simply running an application called Framaroot. Thread at xda-dev here. Choose the
latest version, or you can just donwload Framaroot-1.8.1.apk
1. Install Framaroot then open Framaroot
2. Choose Install SuperSU and tap on Boromir. You can also try with Faramir (it depends on
Framaroot version)
3. If you see a message saying "Success" then you're rooted. Just reboot your device.
4. If Framaroot suddenly closed with no message, just simply re-open Framaroot and re-do the
Rooting Process

B. Flash TWRP Recovery & Nandroid Backup (skip if you have done this already)
We'll need TWRP Recovery to do this process.
1. Download TWRP recovery first. Thread at xda-dev here or you can just download openrecoverytwrp-2.6.3.0-R819.img.
2. Open Google Play and install Mobile Uncle Tools
3. Flash TWRP using Mobile Uncle Tools :
o put the downloaded openrecovery-twrp-2.6.3.0-R819.img in root folder of your SD Card
o Open Mobile Uncle Tools
o Choose recovery update
o Choose openrecovery-twrp-2.6.3.0-R819.img (it should be on top of the list)
o Reboot into recovery and see if you can see TWRP
4. Make Nandroid Backup
5. Reboot back to system.
C. Backup, backup, backup
You need to make backup, many kind of backups. Nandroid backups, Application Backup and also your
entire SD Card backup.
1. If you're using ColorOS you can use built-in app called "Backup & Restore". It make backup of
your contacts, messages, MMS, call logs, Calendar, Clock (and alarm), Weather, Settings and
Theme. It also make backups of your user installed apps and data. Or maybe you have the all
powerful Titanium Backup or Helium or other kind of apps that can do backup, please do so.
Make backups.
2. Connect your device to PC and make backup of your SD Card. Everything. This SD Card partition
will get resized and needs to be formatted. So this means you'll have a copy of your Backup you
made using Application, and Nandroid backup made by TWRP.
D. It's Flashing Time
You're rooted, twrp-ed and backed-up. Now it's time for flashing
1. Download OPPO-R819-ReParted-v1.5-by_Distan7.zip and copy to your SD Card.
2. Boot into recovery (TWRP). If you find this hard to do, just open Google Play and
download Quick Boot and open it.
3. In TWRP, tap Install, choose my mod zip file and follow the instructions. You can choose
between five partitions size for your Internal storage : 1 GB (Factory Default), 2 GB
(recommended), 2.5 GB (my current settings), 3 GB and 3.5 GB. Don't ask about 4 GB please.
4. After installation, don't forget to Wipe SD Card. Remember SD Card gets partitioned and needs to
be formatted. If during boot there's a message about encryption or storage needs repair, just go
to settings and find Factory Reset.
5. Oh by the way, I did tell you to backup stuffs before you start the installer, right ?
E. Restore

Why do you make backups ? So you can restore stuffs. Here are some reading for restoring data :
1. Your SD Card is now around 1 GB to 2 GB smaller in size, so don't get confused when your data
won't fit into your SD Card as it used to.
2. Restoring Nandroid Backup in TWRP works for me, but some users said they had problem with
Google Apps sync after nandroid restore. I don't know if it's related to my mod or not.
3. You can restore from your backup made in "Backup & Restore" or using Titanium Backup or else.
4. Don't forget to check your APN, sound settings, bluetooth pairing, WiFi etc.
Small talks
I tried this many, many times, testing the partition result and also the installer. I was about to release
EBR1 and EBR2 to be flashed with Flash Tool, but I remember that Meteos APK and ReParted could also
flash EBR files. I don't understand anything in Meteos smalife file while ReParted makes more sense. It
basically edify updater-script executed under Aroma installer.
I also found out that if you don't have any apps installed on SD Card before installing this mod, there's a
good chance you don't have to do a factory reset. All my apps are installed at internal, and flashing this
mod many times with different sizes and I didn't have to restore a single app or settings. But SD Card do
need to be formatted.
Oh by the way, please leave feedback in the forum so we all can learn too.
Change logs and Downloads
2014-01-05 : v1.5 - Add 2.5 GB and 3.5 GB mod.
2014-01-04 : v1 - 2 GB and 3 GB mod
Credits :
1. ReParted script is authored by Xakep from lenovo-forums.ru
2. Aroma Installer for ReParted is modified by rainextra
3. Aroma Installer itself is created by Amarullz
4. Mod 2GB and 3GB is made by myself

How I Test This Mod :

My phone is running ColorOS v1.0.0i-full. I didn't try this on Stock AOSP or Oppo ROM. In fact I
don't have AOSP ROM. However I don't see any reason why this shouldn't work on AOSP ROM or
Oppo ROM.
I'm using TWRP for recovery. Will this mod work using Oppo Recovery ? I don't know. Maybe
someday I'll try. I tested with Oppo Recovery (stock Color OS recovery) and the installer can not
run. So you'll need TWRP.

How to Make Your Own EBR Mod :


Inside the zip file you'll find EBR1 and EBR2. These are the original file (1 GB). The other files are selfexplained by their file name. If you want to make a 4 GB go ahead yourself. Here's a how-to in xda-dev,
the one I found easier to follow. What you need is a hex editor (HxD or WinHex).
EBR 1 (Hex Offset : 000001E0)
1 GB : 00 00 83 00 00 00 00 28 22 00 00 00 20 00 00 00
2 GB : 00 00 83 00 00 00 00 28 22 00 00 00 40 00 00 00
2.5 GB : 00 00 83 00 00 00 00 28 22 00 00 00 50 00 00 00
3 GB : 00 00 83 00 00 00 00 28 22 00 00 00 60 00 00 00
3.5 GB : 00 00 83 00 00 00 00 28 22 00 00 00 70 00 00 00
EBR 2 (Hex Offset : 000001C0)
1 GB : 00 00 83 00 00 00 00 54 40 00 FF D7 BD FF 00 00
2 GB : 00 00 83 00 00 00 00 54 60 00 FF D7 9D FF 00 00
2.5 GB : 00 00 83 00 00 00 00 54 70 00 FF D7 8D FF 00 00
3 GB : 00 00 83 00 00 00 00 54 80 00 FF D7 7D FF 00 00
3.5 GB : 00 00 83 00 00 00 00 54 90 00 FF D7 6D FF 00 00
Use my EBR1 and EBR2 as your base point, see the changes from 1GB to 2GB to 3GB and read the
thread above, you can figured out the hex code for editing. Do the same with EBR2. Yes you need to edit
both file. I bet making a 2.5 GB or a 4 GB mod isn't hard.
How To Flash Your Own EBR Mod :
Now supposed you've made your 4 GB Mod : EBR1-4GB and EBR2-4GB. Open my zip file (no need to
extract) and add these two files along with their friends.

Next step is to modify two files : aroma_config and updater-script

aroma_config
Here's before editing :
[CODE] "<~settings.resize>","",2,
"1GB", "Default Factory",0,
"2GB", "Recommended",0,
"3GB", "For more Space",0
# "2,5GB", "<~settings.resizeo3>",0,[/CODE]
Make the change into this :
[CODE] "<~settings.resize>","",2,
"1GB", "Default Factory",0,
"2GB", "Recommended",0,
"3GB", "For more space",0,
"4GB", "Give me MORE !",0[/CODE]

updater-script
Here's before editing :
[CODE]#if file_getprop("/tmp/aroma-data/customize.prop","selected.1") == "4"
# then
#
package_extract_file("E25", "/dev/ebr2");
# endif;[/CODE]
Make the change to this :
[CODE]if file_getprop("/tmp/aroma-data/customize.prop","selected.1") == "4"
then
package_extract_file("EBR1-4GB", "/dev/ebr1");
package_extract_file("EBR2-4GB", "/dev/ebr2");
endif;[/CODE]
Then all you have to do is replace aroma_config and updater-script in the zip file.
Any feedback would be welcome

Potrebbero piacerti anche