FORUMS
Remove All Ads from XDA

[GUIDE] Enable Camera2 API Without Root [mido] [Unlocked Bootloader] [MIUI 9]

31 posts
Thanks Meter: 21
 
By A_K_S_H_, Member on 17th October 2017, 04:17 PM
Post Reply Email Thread
DISCLAIMER

I am not responsible for anything that happens to your device on following these steps. These are untested steps that worked for me and might work for you.

PREREQUISITES

1. PC with adb
2. Unlocked Bootloader
3. TWRP
4. MIUI 9 [Might work with other ROMs, not tested]
5. Lazyflasher zip

NOTES

1. If you are on a custom ROM, chances are that camera2 api is already enabled. Use Manual Camera Compatibility to verify.
2. If you are on MIUI, updating using ota might reset build.prop file. This might help, not tested. Update: I successfully updated to MIUI 9 Global 7.10.19 | Beta, see below for steps,
3. I am using Google Camera v4.4.020.163412804 on MIUI 9 Global 7.9.7 | Beta, and it is a HUGE improvement over the stock camera.

STEPS

1. Boot into TWRP. (Guide if you don't have TWRP)
2. Mount System.
3. Take NANDroid backup. (Optional but HIGHLY RECOMMENDED)
4. Connect to PC and execute the following command in terminal:
Code:
adb pull /system/build.prop
5. This copies build.prop to the current directory. (C:\Users\[USERNAME] by default on windows)
6. Copy it to another directory for backup.
7. Open in editor and add the following line at end:
Code:
persist.camera.HAL3.enabled=1
8. Save and exit.
9. Execute following commands:
Code:
adb push build.prop /system/
adb shell
cd system
chmod 644 build.prop
10. Copy lazyflasher to internal storage.
11. Flash using TWRP.
12. Reboot to system.
13. Use Manual Camera Compatibility Checker to verify.
14. PROFIT!
15. Install the latest Google Camera HDR+ Port. (Optional but HIGHLY RECOMMENDED ;P)

UPDATING MIUI

1. Download the official recovery zip from here.
2. Download latest TWRP from here
2. Reboot into TWRP.
3. Take NANDroid. (Optional, just in case . . .)
4. Transfer ROM zip, TWRP img and Lazyflasher zip to internal storage.
5. Flash ROM zip. (Took about 10 minutes)
6. Flash TWRP img. (Go to flash -> select flash image -> select twrp-[v].img)
7. Flash Lazyflasher zip.
8. Follow steps 4 through 9 of above instructions. (Yes, build.prop also gets replaced on update)
9. Reboot to system.
10. Wait patiently.
11. VOILA !!

LINKS

1. Manual Camera Compatibility Checker
2. Lazyflasher Zip
3. Google Camera HDR+ Port
4. Latest MIUI Recovery Image
5. Official TWRP for mido
6. Sources: (1) (2) (3)


Hope this helps. Try and comment if this works for you in other ROMs. Also let me know if anything is unclear.
The Following 12 Users Say Thank You to A_K_S_H_ For This Useful Post: [ View ] Gift A_K_S_H_ Ad-Free
 
 
17th October 2017, 04:18 PM |#2  
OP Member
Thanks Meter: 21
 
More
TWRP Tweaks (MIUI 9 Beta)

The method in this thread basically allows you to edit build.prop without rooting, which opens up a lot of possibilities. Here are some other useful tweaks to build.prop that I use.

(Note: If a line is already present in the file, edit the line otherwise add at end.)

1. Enable MIUI's full screen gestures
Code:

qemu.hw.mainkeys=0
2. Add EIS and disable noise cancellation
Code:

persist.camera.eis.enable=1
persist.camera.HAL3.enabled=1
ro.qc.sdk.audio.fluencetype=fluencepro
3. Turn off noise cancellation for audio recordings
Code:

persist.audio.fluence.voicerec=false
4. Fix Google Assistant talkback
Code:

mm.enable.qcom_parser=245389
Sources: (1)

Do reply if you are using some build.prop tweak and I'll add it here!
The Following 2 Users Say Thank You to A_K_S_H_ For This Useful Post: [ View ] Gift A_K_S_H_ Ad-Free
17th October 2017, 06:33 PM |#3  
Senior Member
Thanks Meter: 380
 
More
is it possible to make the flash-able zip work with stock recovery?
17th October 2017, 11:07 PM |#4  
mato_d007's Avatar
Senior Member
Flag San Luis
Thanks Meter: 642
 
Donate to Me
More
What does the lazyflasher zip actually do? A quick search on google shows a custom kernel installer.
18th October 2017, 06:27 AM |#5  
OP Member
Thanks Meter: 21
 
More
Quote:
Originally Posted by joefso

is it possible to make the flash-able zip work with stock recovery?

I am not sure if it is safe to flash zips from stock recovery. Even if you could, you would not be able to take NANDroid, so you are doomed if things go south. Still, if you want, you could try and then we'll know :P
18th October 2017, 06:34 AM |#6  
OP Member
Thanks Meter: 21
 
More
Quote:
Originally Posted by mato_d007

What does the lazyflasher zip actually do? A quick search on google shows a custom kernel installer.

The source of the lazyflasher zip (2 in sources) says:

Quote:

This device uses dm-verity

This means that swiping to allow system modifications will prevent you from being able to boot if you are using the stock kernel. In order to bypass dm-verity's boot prevention, you will have to install a kernel that has dm-verity disabled in the fstab.

When I was trying the adb method, I was getting a bootloop, because (I think) the system partition had been modified (new build.prop replaced old one). Flashing this zip solved this, so I guess it essentially allows modifications to the system partition.
The Following User Says Thank You to A_K_S_H_ For This Useful Post: [ View ] Gift A_K_S_H_ Ad-Free
18th October 2017, 10:22 AM |#7  
Senior Member
Thanks Meter: 380
 
More
Quote:
Originally Posted by A_K_S_H_

I am not sure if it is safe to flash zips from stock recovery. Even if you could, you would not be able to take NANDroid, so you are doomed if things go south. Still, if you want, you could try and then we'll know :P

I am willing to try because it would be great if this could work withouth using twrp, root or a unlocked bootloader.

Are the scripts compatible?
18th October 2017, 11:33 AM |#8  
OP Member
Thanks Meter: 21
 
More
Quote:
Originally Posted by joefso

I am willing to try because it would be great if this could work withouth using twrp, root or a unlocked bootloader.

Are the scripts compatible?

They should be, as I used them with stock MIUI, stock kernel. However, are you going to flash a zip on locked bootloader? Is that even possible? Why would modifications to the system partition be allowed with locked bootloader? What would be the point of locking if that is the case?
18th October 2017, 04:03 PM |#9  
Senior Member
Thanks Meter: 380
 
More
Quote:
Originally Posted by A_K_S_H_

They should be, as I used them with stock MIUI, stock kernel. However, are you going to flash a zip on locked bootloader? Is that even possible? Why would modifications to the system partition be allowed with locked bootloader? What would be the point of locking if that is the case?

I assumed that if OTA updates can be flashed through bootloader then by that logic /system could be modified too, right? hmmm


Quote:

In Android devices, Recovery is an Android-based, lightweight runtime environment separate from and parallel to the main Android operating system. Recovery's original purpose was:

to apply software updates to the device, e.g. OTA updates, and
to erase user data and cache, e.g. for troubleshooting or preparing the device for resale (factory reset) and
to run (another) external tool from microSD flash memory

https://forum.xda-developers.com/wiki/Recovery

19th October 2017, 03:35 AM |#10  
Senior Member
Flag Mumbai
Thanks Meter: 122
 
Donate to Me
More
Thanks... BTW..
You can simply add that line using any file manager with root permissions and after rebooting device it works..
20th October 2017, 09:12 AM |#11  
OP Member
Thanks Meter: 21
 
More
Quote:
Originally Posted by amit.tiger12

Thanks... BTW..
You can simply add that line using any file manager with root permissions and after rebooting device it works..

Read the title : WITHOUT ROOT
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