In order to fulfill the basic functions of our service, the user hereby agrees to allow Xiaomi to collect, process and use personal information which shall include but not be limited to written threads, pictures, comments, replies in the Mi Community, and relevant data types listed in Xiaomi's Private Policy. By selecting "Agree", you agree to Xiaomi's Private Policy and Content Policy .
Agree

Tips & Tricks

Tutorial For You
Subscribed
Subscribe

[Tutorial] [Guide] How To Enable Camera2API in Your MIUI Device Without Root

2018-05-04 14:08:31
78286 331

Hi Mi Fans!
Many of you may know the HDR+ & portrait mode results with Google Camera app in Pixel devices and some developers have ported that camera app to work with many devices, but a main reason that still many are unable to use it is, the app needs Camera2api enabled in your device.

Most of the tutorials on internet or youtube are by rooting your device and installing magisk/magisk modules or by editing the build.prop using file explorers which also needs root access for your device, due to which many users who doesn’t want to root their device aren’t able use the Google Camera app.
Today by using this guide you can enable  Camera2api and use Google Camera in your device without rooting your device.

Please proceed with caution, as I don’t take any responsibility if you do anything wrong in this process or for breaking any exisiting features of your camera app.

I am showing this tutorial from Redmi Note 5 Pro device running on MIUI version 9.2.6.0 with an unrooted device.

Prerequisites:
  • Unlocked bootloader of your device
  • Working TWRP recovery img file for your device
  • PC with adb installed
  • Manual camera test/Root checker apps in your device to check status.


Let’s quickly jump into the guide now.

1. To unlock bootloader for your device please follow this guide. Learn how to unlock the Bootloader of your Mi Phone
2. Download TWRP for your device and place the img file in the same folder where you have saved the adb files and rename it to twrp.img
( Redmi Note 5 Pro users can download this TWRP Redmi Note 5 Pro twrp.img credits: Shahan_mik3, vasishath )
3. Configure adb in your PC download adb from here adb.zip and extract it to any folder in your PC.
ADB.zip (4.49 MB, Downloads: 1456)

How to Enable Camera2API:

1. Now connect your device to your PC using the USB cable and change the connection mode to Transfer files.

2. Go to Settings - About Phone - Tap 7 consecutive times on MIUI Version to enable developer options, and go to Settings - Additional Settings - Developer options and enable USB debugging option.

3. Open the folder of adb in your PC, hold the shift key on your PC keyboard and right your mouse on the empty space in the adb folder and select “Open command window here”

4. Now enter the following command in the command window/PowerShell window which will show the serial number of your device and status of connection.
adb devices

Keep your phone screen unlocked as it may ask for USB debugging authorization, as shown in step 2, 2nd screenshot.

5. Once your device is detected as shown in above screenshot, you can boot into fastboot mode in your device by using the Volume down+Power key simultaneously in power off mode of your device or by using the following command in cmd.
adb reboot bootloader

This will boot your device into fastboot mode as shown in image at 2nd step.

6. Now we need to boot into TWRP recovery for your device temporarily, it will not affect your device.
To do this enter the following command and hit enter key, make sure recovery name is twrp.img and it is placed in the adb folder.
fastboot boot twrp.img


7. Once you hit enter your device will temporarily boot TWRP recovery like this.
You will see the screen like on left screenshot, swipe the blue colour arrow bar to right side too enter into the TWRP recovery options.
(We don’t need to do anything from the recovery, keep the device connected to PC and rest it aside)


8. Now once again enter the “adb devices” command and hit enter to check the connection of device with PC.

It will show your device serial number and recovery as status.

9. Now we need to edit the build prop to add a line which enables Camera2API for that we will need to start adb shell using the following command.
adb  shell

After entering the command hit enter key

10. Once the adb shell opens up you need to add a line for enabling Camera2api, copy paste the below command and hit enter
setprop persist.camera.HAL3.enabled 1


11.  After that we need to exit the adb shell using the exit command, enter the command as shown below and hit enter.
exit


12. Now you need to reboot the device, you can do that from the recovery or just by using the following command.
adb reboot


enter the command as shown and hit enter key.

13. That’s it once your device boots up it will have Camera2api enabled and the TWRP which we booted above will be removed (if followed the steps)

Redmi Note 5 Pro, MIUI Stable 9.2.6.0 update without rooting or any issue for updates.

14. Now you can install the Google Camera mods available for your device and install it.

15. This edit may not be lost with incremental OTA updates, but it will be lost incase of full rom updates, factory data reset or by installing fastboot rom, even if it is disabled you can enable it easily by following the above steps again.

Redmi Note 5 Pro updated from MIUI stable version 9.2.6.0 to 9.2.7.0 update and Camera2api is still enabled.

Note:
1. It may break some features of your camera in few devices like video calls from dialer app you will need to disable camera2api to bring it back, please proceed with caution.
2. If anything goes wrong you may need to flash fastboot rom so please take full backup of your data before trying out.
3. This process doesn't void your warranty, but still proceed on your own risk.
4. This process may work in any device running on Android Lollipop and above.
5. To disable Camera2api change the step 10 command to setprop persist.camera.HAL3.enabled 0 and follow all the proccess said here and everything will be normal as before enabling.

Thanks to MiAkash & Lavnidhi for their help and support in doing this guide.

Hope this helps the few users who doesn't want to root but like to use Google Camera Mods.

Rate

Number of participants 13 Experience +170 Pack Reason

View Rating Log

2018-05-04 14:08:31
Favorites582 RateRate
Tutorial For You
In the sea of knowledge, let us seek some oysters together. I'm here to share some tutorials on gadgets and software.
50 Article Description     1305 Subscribers
Subscribed
Subscribe

MIUI Support Team

lavnidhi | from mobile

#1

Yes , it works perfectly. I enabled it on my Redmi note 4 and updated via updater and still my api2 is enabled and google cam working.
2018-05-04 21:07:08
Proud Mi Fan

Moderator

Apiyush265 | from Redmi Note 4

#2

Woohoo!! thanks for it.. really needed and amazing
2018-05-05 06:46:19

MIUI Beta Tester

sanyaanuj | from Redmi 4

#3

wooow great problem solved...
2018-05-05 06:46:59

Mi FC President

DiLshad Sys | from Mi A1

#4

well explained
thanks bro wilk try on rn5p
2018-05-05 06:47:33

MIUI Beta Tester

dgandhi786 | from Redmi Note 4

#5

thaNks a lot bro !!1
2018-05-05 06:50:39

Master Bunny

h8mn | from MIX 2

#6

good info. thankx
2018-05-05 06:51:43
mi mIx2 n many mi goodies

Semi Pro Bunny

Apurv Gupta | from Mi MIX 2

#7

Thanks for this guide. Will try it.
2018-05-05 07:02:25

MIUI Beta Tester

1750087562 | from Redmi 4

#8

wow thanx
2018-05-05 07:16:31
Very nice bro
2018-05-05 07:35:13

MIUI Beta Tester

MAK | from Redmi Note 5 Pro

#10

Awesome, Great Tutorial with complete information, Thank you for sharing..
2018-05-05 07:43:21
androsamace
please sign in to reply.
Sign In Sign Up

Siva Abhi

Super Moderator

India 2nd year
APP scratch card
6th MIUI
Mi Max
2016 Diwali with Mi
3 Days Check-In
7 Days Check-In
21 Days Check-In
40 Days Check-In
70 Days Check-In
100 Days Check-In
1 Year Check-In
Shake!!Shake!!
Lucky Draw No.
500K Members
Mi Explorers
App Review
1 million members
June-100 replies in a month
July-100 replies in a month
Aug-100 replies in a month
Sep-100 replies in a month
Oct-100 replies in a month
Nov-100 replies in a month
Dec-100 replies in a month
100 ответов в декабре
1st Anniversary
My Poster My Life
MIUI 9
MIUI 7th Anniversary
2 million registered members
Newbie Member
Diwali
Twitter Medal
Mi Apps
Christmas 2017
2018 New Year Medal
ThrowBackWithMiCommunity
MIUI Instagram
MIUI Beta Tester
Mi Community Updater
Color Your Planet
Color Our Planet Game
STAR Bug Hunter
The Motivator
MIUI 10
MIUI Subscriber
MIUI 8th Anniversary
Eid Mubarak
5 Million Registered Users
Mi Music: 20 FREE Downloads
Ringtones Mania
10 Million Downloads
2019
Throwback With Mi 2018
Xiaomi's 9th Birthday
9 Years of MIUI

Read moreGet new
Copyright©2016-2019 Xiaomi.com, All Rights Reserved
Content Policy
Quick Reply To Top Return to the list