FORUMS
Remove All Ads from XDA

[How to] Enabling cam2 (GCAM) for every android version with temp root + keeping OTA

350 posts
Thanks Meter: 239
 
By minnuss, Senior Member on 18th November 2018, 05:46 PM
Post Reply Email Thread
This guide worked for every OREO version, and also is working for PIE !

You will enable camera2 on your phone, and keep it stock afterwards so it can receive future OTA updates.

1 - Unlocking bootloader
Unlocking bootloader, this command will delete/reset your phone, so do backup of files as needed.
First of all, enable the Developer Option.
To do this go to your Settings -> About -> Software Information -> More -> Now Tap on the Build Number 7-8 Times until you see a toast message “Developer option enabled”.

Now go back to settings -> Enable the OEM Unlock by going to Settings -> Developer Option and Enable OEM Unlock and USB Debugging.

Now connect the phone with your USB cable, use USB port 2.0 on your computer.
It should appear on your phone screen an asking for access privileges of your PC (device, maybe Linux), allow it.

Download ADB if you don't have it.
https://drive.google.com/file/d/1yCd...ew?usp=sharing

In ADB folder, double click "Open CMD here.bat".
AND FROM THIS TIME, YOU DON'T CLOSE THIS CMD AT ALL, UNTILL YOU FINISH THE WHOLE GUIDE

Code:
adb devices
Your device should appear with some random numbers like this
https://www.howtogeek.com/wp-content...10/image34.png

If it does, go to next stage, if it's not, you are not installed usb drivers corectly or did not enabled usb debugging.
Link for USB Drivers for Mi A2.
http://dl.adbdriver.com/upload/adbdriver.zip

Code:
adb reboot bootloader
Unlocking bootloader, this command will delete/reset your phone, so do backup of files as needed.

Code:
fastboot oem unlock
Phone will reboot, go to check developer options > usb debugging ON once again.

Code:
adb reboot bootloader
Again in fastboot we are unlocking critical partitions, and once again it will erase verything from the phone, so be sure to do the backup as needed.

Code:
fastboot flashing unlock_critical
Again when the phone reboot, check developer options > usb debugging ON.

2. Rooting the phone (temporarily)
Download stock boot and patched boot of android version you have, if you need versions for OREO, find somewhere in forum, here it is link for PIE.
10.0.8.0 https://drive.google.com/drive/folde...Rv?usp=sharing
10.0.7.0 https://drive.google.com/drive/folde...HV?usp=sharing
10.0.5.0 https://drive.google.com/drive/folde...5y?usp=sharing
10.0.4.0 https://drive.google.com/drive/folde..._0?usp=sharing
10.0.3.0 https://drive.google.com/open?id=1uO...Lu-naIIt8mprBT
"It seems like 10.0.3.0 OTA is withdrawn by Xiaomi due to numerous bootloops in stock phones."
My recommendation is to skip flashing this version, until next stable comes up !

10.0.2.0 https://drive.google.com/drive/folde...vN?usp=sharing
10.0.1.0 https://drive.google.com/drive/folde...15?usp=sharing
9.6.17.0 https://drive.google.com/drive/folde...9w?usp=sharing

Put the files in adb folder, both the stock boot.img and patched_boot.img.

NOW !
There are two methods, so you can choose between those two:
1. Faster and easier one with only booting patched boot
2. Slower with flashing, but this one will teach you how to flash and root your phone

1. ENABLING WITH BOOTING PATCHED_BOOT.IMG

In CMD type
Code:
adb reboot bootloader
Code:
fastboot boot patched_boot.img
When the phone starts, wait for magisk to appear in apps, or if it's not there, find it in apkmirror site, magisk manager, download, install from phone it is easier.
https://www.apkmirror.com/?post_type...magisk+manager
Then when you start magisk, it will ask you to download full zip, just skip it, your phone will now be rooted.

3. Enabling Camera2 api (lvl3)
In CMD type
Code:
adb shell
Code:
su
(this time look at the phone screen, allow root access ONCE)
Code:
setprop persist.camera.HAL3.enabled 1
For PIE and for using v6 Gcam ports three more commands, for OREO it is not needed.
Code:
setprop persist.vendor.camera.HAL3.enabled 1
Code:
setprop persist.camera.stats.test 5
Code:
setprop persist.vendor.camera.stats.test 5
Press ctrl+c to exit adb shell (windows) or just type "exit" and again "exit"

4. Unrooting the phone
Start magisk again, go to UNINSTALL, choose full uninstall, magisk will reboot the phone in process of uninstalling, and the phone should start normaly without Magisk installed, and with camera2 enabled, because nothing was flashed, you are DONE !


2. ENABLING WITH FLASHING PATCHED_BOOT.IMG

In CMD type
Code:
adb reboot bootloader
Code:
fastboot getvar current-slot
Then when you see your active partition, flash the patched image.
Code:
fastboot flash boot_a patched_boot.img
OR if it was b partition active
Code:
fastboot flash boot_b patched_boot.img
Code:
fastboot reboot
When the phone starts, wait for magisk to appear in apps, or if it's not there, find it in apkmirror site, magisk manager, download, install from phone it is easier.
https://www.apkmirror.com/?post_type...magisk+manager
Then when you start magisk, it will ask you to download full zip, just skip it, your phone will now be rooted.

3. Enabling Camera2 api (lvl3)
In CMD type
Code:
adb shell
Code:
su
(this time look at the phone screen, allow root access ONCE)
Code:
setprop persist.camera.HAL3.enabled 1
For PIE and for using v6 Gcam ports three more commands, for OREO it is not needed.
Code:
setprop persist.vendor.camera.HAL3.enabled 1
Code:
setprop persist.camera.stats.test 5
Code:
setprop persist.vendor.camera.stats.test 5
Press ctrl+c to exit adb shell (windows) or just type "exit" and again "exit"

4. Unrooting the phone
Start magisk again, go to UNINSTALL, choose full uninstall, magisk will reboot the phone in process of uninstalling, prepare and hold down the volume button when phone restarts, your phone will go into fastboot.

Type the command for active partition
Code:
fastboot getvar current-slot
Code:
fastboot flash boot_a boot.img
Or
Code:
fastboot flash boot_b boot.img
Code:
fastboot reboot


This is it guys, you have enabled lvl3 (camera2), and unrooted phone, ready for next OTA updates.
Install camera2 probe from gplay to confirm.
https://play.google.com/store/apps/d...ra2probe&hl=en

Phone needs to stay with unlocked bootloader, because if you lock the phone, you will lose camera2, but do not worry, the future OTA updates will work.

If this guide helped you, please click the thanks button, that's all, cheers.
The Following 55 Users Say Thank You to minnuss For This Useful Post: [ View ] Gift minnuss Ad-Free
 
 
18th November 2018, 07:38 PM |#2  
Nebrassy's Avatar
Senior Member
Flag Lattakia
Thanks Meter: 359
 
More
If you're using temp recovery, just fastboot boot patched_boot.img, no need to flash, and once done just reboot
The Following 3 Users Say Thank You to Nebrassy For This Useful Post: [ View ] Gift Nebrassy Ad-Free
18th November 2018, 08:45 PM |#3  
Senior Member
Thanks Meter: 24
 
More
if i flash boot.img back i get stuck in android one screen
18th November 2018, 08:57 PM |#4  
minnuss's Avatar
OP Senior Member
Flag Belgrade
Thanks Meter: 239
 
More
Quote:
Originally Posted by idriff

if i flash boot.img back i get stuck in android one screen

On what android version were you ?
19th November 2018, 12:57 AM |#5  
Senior Member
Thanks Meter: 24
 
More
pie, i just flashed back the modified boot and it worked but now im rooted
19th November 2018, 01:06 AM |#6  
Senior Member
Thanks Meter: 39
 
More
What version google camera you guys using?
19th November 2018, 01:37 AM |#7  
Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by minnuss

This guide worked for every OREO version, and also is working for PIE !

You will enable camera2 on your phone, and keep it stock afterwards so it can receive future OTA updates.

1 - Unlocking bootloader
Unlocking bootloader, this command will delete/reset your phone, so do backup of files as needed.
First of all, enable the Developer Option.
To do this go to your Settings -> About -> Software Information -> More -> Now Tap on the Build Number 7-8 Times until you see a toast message “Developer option enabled”.

Now go back to settings -> Enable the OEM Unlock by going to Settings -> Developer Option and Enable OEM Unlock and USB Debugging.

Now connect the phone with your USB cable, use USB port 2.0 on your computer.
It should appear on your phone screen an asking for access privileges of your PC (device, maybe Linux), allow it.

Download ADB if you don't have it.
https://drive.google.com/file/d/1yCd...ew?usp=sharing

In ADB folder, double click "Open CMD here.bat".
AND FROM THIS TIME, YOU DON'T CLOSE THIS CMD AT ALL, UNTILL YOU FINISH THE WHOLE GUIDE

Code:
adb devices
Your device should appear with some random numbers like this
https://www.howtogeek.com/wp-content...10/image34.png

If it does, go to next stage, if it's not, you are not installed usb drivers corectly or did not enabled usb debugging.

Code:
adb reboot bootloader
Unlocking bootloader, this command will delete/reset your phone, so do backup of files as needed.

Code:
fastboot oem unlock
Phone will reboot, go to check developer options > usb debugging ON once again.

Code:
adb reboot bootloader
Again in fastboot we are unlocking critical partitions, and once again it will erase verything from the phone, so be sure to do the backup as needed.

Code:
fastboot flashing unlock_critical
Again when the phone reboot, check developer options > usb debugging ON.

2. Rooting the phone (temporarily)
Download stock boot and patched boot of android version you have, if you need versions for OREO, find somewhere in forum, here it is link for PIE.
https://drive.google.com/drive/folde...15?usp=sharing

Put the files in adb folder, both the stock boot.img and patched_boot.img.
Code:
adb reboot bootloader
Code:
fastboot getvar current-slot
Then when you see your active partition, flash the patched image.
Code:
fastboot flash boot_a patched_boot.img
OR if it was b partition active
Code:
fastboot flash boot_b patched_boot.img
Code:
fastboot reboot
When the phone starts, wait for magisk to appear in apps, or if it's not there, find it in apkmirror site, magisk manager, download, install from phone it is easier.
https://www.apkmirror.com/?post_type...magisk+manager
Then when you start magisk, it will ask you to download full zip, let him do it, install full zip, your phone will now be rooted.

3. Enabling Camera2 api (lvl3)
In CMD type
Code:
adb shell
Code:
su
(this time look at the phone screen, allow root access ONCE)
Code:
setprop.persist.camera.HAL3.enabled 1
For PIE one more command, for OREO it is not needed.
Code:
setprop persist.vendor.camera.HAL3 enabled 1
Press ctrl+c to exit adb shell.

4. Unrooting the phone
Start magisk again, go to UNINSTALL, choose full uninstall, magisk will reboot the phone in process of uninstalling, prepare and hold down the volume button when phone restarts, your phone will go into fastboot.

Type the command for active partition
Code:
fastboot getvar current-slot
Code:
fastboot flash boot_a boot.img
Or
Code:
fastboot flash boot_b boot.img
Code:
fastboot reboot
This is it guys, you have enabled lvl3 (camera2), and unrooted phone, ready for next OTA updates.
Install camera2 probe from gplay to confirm.
https://play.google.com/store/apps/d...ra2probe&hl=en

Phone needs to stay with unlocked bootloader, because if you lock the phone, you will lose camera2, but do not worry, the future OTA updates will work.

If this guide helped you, please click the thanks button, that's all, cheers.

For me it worked, but in stock camera cant see any diferences, can someone link me a gcam apk to install?
19th November 2018, 04:42 AM |#8  
Junior Member
Thanks Meter: 11
 
More
Quote:
Originally Posted by minnuss

This guide worked for every OREO version, and also is working for PIE !

You will enable camera2 on your phone, and keep it stock afterwards so it can receive future OTA updates.

1 - Unlocking bootloader
Unlocking bootloader, this command will delete/reset your phone, so do backup of files as needed.
First of all, enable the Developer Option.
To do this go to your Settings -> About -> Software Information -> More -> Now Tap on the Build Number 7-8 Times until you see a toast message “Developer option enabled”.

Now go back to settings -> Enable the OEM Unlock by going to Settings -> Developer Option and Enable OEM Unlock and USB Debugging.

Now connect the phone with your USB cable, use USB port 2.0 on your computer.
It should appear on your phone screen an asking for access privileges of your PC (device, maybe Linux), allow it.

Download ADB if you don't have it.
https://drive.google.com/file/d/1yCd...ew?usp=sharing

In ADB folder, double click "Open CMD here.bat".
AND FROM THIS TIME, YOU DON'T CLOSE THIS CMD AT ALL, UNTILL YOU FINISH THE WHOLE GUIDE

Code:
adb devices
Your device should appear with some random numbers like this
https://www.howtogeek.com/wp-content...10/image34.png

If it does, go to next stage, if it's not, you are not installed usb drivers corectly or did not enabled usb debugging.

Code:
adb reboot bootloader
Unlocking bootloader, this command will delete/reset your phone, so do backup of files as needed.

Code:
fastboot oem unlock
Phone will reboot, go to check developer options > usb debugging ON once again.

Code:
adb reboot bootloader
Again in fastboot we are unlocking critical partitions, and once again it will erase verything from the phone, so be sure to do the backup as needed.

Code:
fastboot flashing unlock_critical
Again when the phone reboot, check developer options > usb debugging ON.

2. Rooting the phone (temporarily)
Download stock boot and patched boot of android version you have, if you need versions for OREO, find somewhere in forum, here it is link for PIE.
https://drive.google.com/drive/folde...15?usp=sharing

Put the files in adb folder, both the stock boot.img and patched_boot.img.
Code:
adb reboot bootloader
Code:
fastboot getvar current-slot
Then when you see your active partition, flash the patched image.
Code:
fastboot flash boot_a patched_boot.img
OR if it was b partition active
Code:
fastboot flash boot_b patched_boot.img
Code:
fastboot reboot
When the phone starts, wait for magisk to appear in apps, or if it's not there, find it in apkmirror site, magisk manager, download, install from phone it is easier.
https://www.apkmirror.com/?post_type...magisk+manager
Then when you start magisk, it will ask you to download full zip, let him do it, install full zip, your phone will now be rooted.

3. Enabling Camera2 api (lvl3)
In CMD type
Code:
adb shell
Code:
su
(this time look at the phone screen, allow root access ONCE)
Code:
setprop.persist.camera.HAL3.enabled 1
For PIE one more command, for OREO it is not needed.
Code:
setprop persist.vendor.camera.HAL3 enabled 1
Press ctrl+c to exit adb shell.

4. Unrooting the phone
Start magisk again, go to UNINSTALL, choose full uninstall, magisk will reboot the phone in process of uninstalling, prepare and hold down the volume button when phone restarts, your phone will go into fastboot.

Type the command for active partition
Code:
fastboot getvar current-slot
Code:
fastboot flash boot_a boot.img
Or
Code:
fastboot flash boot_b boot.img
Code:
fastboot reboot
This is it guys, you have enabled lvl3 (camera2), and unrooted phone, ready for next OTA updates.
Install camera2 probe from gplay to confirm.
https://play.google.com/store/apps/d...ra2probe&hl=en

Phone needs to stay with unlocked bootloader, because if you lock the phone, you will lose camera2, but do not worry, the future OTA updates will work.

If this guide helped you, please click the thanks button, that's all, cheers.

The post has some errors but I'm here to report you guys how I made it work.

adb devices
adb reboot bootloader
(I had the bootloader unlocked already so I didn't do those steps)
fastboot boot patched_boot.img
(Notice I didn't flash the patched image, you don't need to do that, my current partition was b, but that doesn't matter since I'm not flashing anything, I am just booting into the patched/rooted image)
(Installed magisk manager and rootchecker)
(magisk said it was rooted, so did root checker)
adb shell
su
(I gave the permission on my phone)
setprop persist.camera.HAL3.enabled 1
(If you check the post carefully, this line above is not the same one the OP has, that one is wrong, mine is right)
setprop persist.vendor.camera.HAL3.enabled 1
ctrl+c
adb reboot
(Notice I don't flash anything here as well, since I didn't flash the patched image, so if I reboot, it will boot into my stock boot image)
aaaaaaand it's done.
Thanks to the OP for his work, and please correct the line that is wrong. Cheers.
Google Camera working fine.
The Following 9 Users Say Thank You to Jamesismo For This Useful Post: [ View ] Gift Jamesismo Ad-Free
19th November 2018, 06:40 AM |#9  
Member
Flag San Juan
Thanks Meter: 17
 
More
Quote:
Originally Posted by Jamesismo

The post has some errors but I'm here to report you guys how I made it work...

Hello, thanks a lot!
It's works perfect!
Best regards!!!
19th November 2018, 06:58 AM |#10  
Senior Member
Thanks Meter: 108
 
More
Quote:
Originally Posted by hugomoya

Hello, thanks a lot!
It's works perfect!
Best regards!!!

Please don't quote OP for a single line of comment.
The Following User Says Thank You to [email protected] For This Useful Post: [ View ] Gift [email protected] Ad-Free
19th November 2018, 07:58 AM |#11  
minnuss's Avatar
OP Senior Member
Flag Belgrade
Thanks Meter: 239
 
More
@Jamesismo, thanx, I fixed the typo mistake, did not have the DOT in command line, it was not an error, just a typo, but thanx.

And yes, please guys, do not quote the first post.

In a guide, a neewbie can learn how to unlock bootloader, root the phone, enable cam2, and unroot the phone.
So he can choose, whether he wants to stay with rooted phone or not, or to unroot later if he wants...

I think that with this method, OTA will work even if he has Magisk installed, because nothing is changed in system, but that needs to be confirmed.
The Following User Says Thank You to minnuss For This Useful Post: [ View ] Gift minnuss Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes