• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE] Enable Camera2 API, EIS on stock Android Pie (temporary rooting)

Search This thread

shaman_

Member
Apr 15, 2015
42
14
this method worked for me, so i live it here
standart method didn't worked for me on pie, so i combined it with this method

You will need to download TWRP and Magisk Manager, Magisk
implied that you have installed ADB and Driver

Unlocking bootloader:
  1. Developer Option
    • 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”.
    • Settings -> Developer Option and Enable OEM Unlock and USB Debugging.
  2. Reboot to fastboot
    Code:
    adb reboot bootloader
  3. Unlocking bootloader
    Code:
    fastboot oem unlock
    device wil reboot and wipe. after setup repeat step 1-2
Rooting
  1. Booting Recovery
    this will boot twrp. be patient this is not instantly
    Code:
    fastboot boot twrp.img
  2. Copy Magisk.zip to device
    Code:
    adb push Magisk-v18.0.zip /sdcard
    output will be something like that
    Code:
    Magisk-v18.0.zip: 1 file pushed. 20.0 MB/s (4188255 bytes in 0.200s)
  3. Flash Magisk
    go to Install -> Select Magisk-v18.0.zip
  4. Rebooting
    Code:
    adb reboot
Enabling Camera2 API
After device boot
  1. Install Magisk Manager.apk
  2. Code:
    adb shell
  3. Code:
    su
    Confirm superuser rights on device
  4. Code:
    setprop persist.camera.HAL3.enabled 1
  5. Code:
    setprop persist.vendor.camera.HAL3.enabled 1
  6. Code:
    setprop persist.camera.stats.test 5
  7. Code:
    setprop persist.vendor.camera.stats.test 5
  8. Code:
    setprop persist.camera.eis.enable 1
  9. Code:
    exit
  10. Code:
    exit
    reboot device and check if all ok -> run Camera2 probe and check results
    Model:Mi A1
    Manufacturer:Xiaomi
    Build:9
    SDK:28
    SupportLevel:3
    SupportLevel HR:Level_3
    Manual exposure:1
    Auto exposure:1
    Auto exposure, always flash:1
    Auto exposure, auto flash:1
    Auto exposure, auto flash redeye:1
    AF Lock:1
    Manual focus:1
    Auto focus:1
    Auto focus macro:1
    Auto focus continuous picture:1
    Auto focus continuous video:1
    Auto focus EDOF:0
    Whitebalance off:1
    Automatic whitebalance:1
    WB: cloudy day:1
    WB: day:1
    WB: fluorescent:1
    WB: incandescent:1
    WB: shade:1
    WB: twilight:1
    WB: warm fluorescent:1
    AWB Lock:1
    RawCapture:1
Unroot device
  1. Run Magisk Manager and press Uninstall -> Complete Uninstall
Lock bootloader
  1. Code:
    adb reboot bootloader
  2. Hold volume buttom -
    it is very important to avoid wipe
  3. Code:
    fastboot oem lock
    divice will reboot to bootloader
  4. Code:
    fastboot reboot
I intentionally missed obvious steps such as renaming files twrp.img or magisk.zip and installing adb and drivers
 
Last edited:

mattijah

New member
Nov 9, 2014
4
0
51
plus.google.com
this method works fine for one of my mi A1. Gcam works good but I can't lock phone. After putting the command fastboot oem lock and reboot phone doesn't reboot fully. It starts and even first white screen flash but then screen turns black and phone doesn't response at all. I can still send comand unlock and than it is rebooting without wiping data so Gcam works but it remains unlocked.
With second phone I'm stuck in the recovery. After booting to twrp touch seems to be not working well or it doesn't work at all. Phone doesn't response, I can back to fastboot and repeat run recovery but it is the same again and again
Any advice?


Sent from my Mi A1 using Tapatalk
 

sipollo

Senior Member
Jan 4, 2015
577
458
There is a simpler method:
-Unlock bootloader (with vol- trick if you want to preserve data)
-boot Pie's patched_boot
-install Magisk Manager
-with a terminal emulator (after granting root access from Magisk Manager) type "setprop persist.camera.HAL3.enabled 1" without quotes and uppercase HAL
-Only if you want to you can relock bootloader (with vol- trick if you want to preserve data)
Enjoy
 

giobooo

Member
Feb 15, 2009
41
8
Rome
There is a simpler method:
-Unlock bootloader (with vol- trick if you want to preserve data)
-boot Pie's patched_boot
-install Magisk Manager
-with a terminal emulator (after granting root access from Magisk Manager) type "setprop persist.camera.HAL3.enabled 1" without quotes and uppercase HAL
-Only if you want to you can relock bootloader (with vol- trick if you want to preserve data)
Enjoy
Could you elaborate? How/where do you get pie's patched boot? How do you boot it?
Thanks.

Inviato dal mio Mi A1 utilizzando Tapatalk
 

manpildo

Senior Member
Dec 21, 2011
1,955
1,079
There is a simpler method:
-Unlock bootloader (with vol- trick if you want to preserve data)
-boot Pie's patched_boot
-install Magisk Manager
-with a terminal emulator (after granting root access from Magisk Manager) type "setprop persist.camera.HAL3.enabled 1" without quotes and uppercase HAL
-Only if you want to you can relock bootloader (with vol- trick if you want to preserve data)
Enjoy
Does this also enable EIS?
 

Lappariaja

Member
Dec 27, 2018
22
2
need help

After doing this step "Run Magisk Manager and press Uninstall -> Complete Uninstall" my device restart and stuck on screen with logo Android doll die. So I can't move to next step for lock bootloader. What must I do to fix this, thx and sorry for bad English.
 

priyambubai

Member
Oct 29, 2014
20
15
Kolkata
Works!!

I can confirm that the method actually works. Device-Mi A1 Stock,9.0 Pie December 5 patch. Screenshots are below.
 

Attachments

  • Screenshot_20181228-131837.png
    Screenshot_20181228-131837.png
    120.5 KB · Views: 1,184
  • Screenshot_20181228-131859.png
    Screenshot_20181228-131859.png
    131.4 KB · Views: 1,147
  • Screenshot_20181228-131910.png
    Screenshot_20181228-131910.png
    114.1 KB · Views: 1,169
  • Screenshot_20181228-134357.jpg
    Screenshot_20181228-134357.jpg
    188.2 KB · Views: 1,159

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    this method worked for me, so i live it here
    standart method didn't worked for me on pie, so i combined it with this method

    You will need to download TWRP and Magisk Manager, Magisk
    implied that you have installed ADB and Driver

    Unlocking bootloader:
    1. Developer Option
      • 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”.
      • Settings -> Developer Option and Enable OEM Unlock and USB Debugging.
    2. Reboot to fastboot
      Code:
      adb reboot bootloader
    3. Unlocking bootloader
      Code:
      fastboot oem unlock
      device wil reboot and wipe. after setup repeat step 1-2
    Rooting
    1. Booting Recovery
      this will boot twrp. be patient this is not instantly
      Code:
      fastboot boot twrp.img
    2. Copy Magisk.zip to device
      Code:
      adb push Magisk-v18.0.zip /sdcard
      output will be something like that
      Code:
      Magisk-v18.0.zip: 1 file pushed. 20.0 MB/s (4188255 bytes in 0.200s)
    3. Flash Magisk
      go to Install -> Select Magisk-v18.0.zip
    4. Rebooting
      Code:
      adb reboot
    Enabling Camera2 API
    After device boot
    1. Install Magisk Manager.apk
    2. Code:
      adb shell
    3. Code:
      su
      Confirm superuser rights on device
    4. Code:
      setprop persist.camera.HAL3.enabled 1
    5. Code:
      setprop persist.vendor.camera.HAL3.enabled 1
    6. Code:
      setprop persist.camera.stats.test 5
    7. Code:
      setprop persist.vendor.camera.stats.test 5
    8. Code:
      setprop persist.camera.eis.enable 1
    9. Code:
      exit
    10. Code:
      exit
      reboot device and check if all ok -> run Camera2 probe and check results
      Model:Mi A1
      Manufacturer:Xiaomi
      Build:9
      SDK:28
      SupportLevel:3
      SupportLevel HR:Level_3
      Manual exposure:1
      Auto exposure:1
      Auto exposure, always flash:1
      Auto exposure, auto flash:1
      Auto exposure, auto flash redeye:1
      AF Lock:1
      Manual focus:1
      Auto focus:1
      Auto focus macro:1
      Auto focus continuous picture:1
      Auto focus continuous video:1
      Auto focus EDOF:0
      Whitebalance off:1
      Automatic whitebalance:1
      WB: cloudy day:1
      WB: day:1
      WB: fluorescent:1
      WB: incandescent:1
      WB: shade:1
      WB: twilight:1
      WB: warm fluorescent:1
      AWB Lock:1
      RawCapture:1
    Unroot device
    1. Run Magisk Manager and press Uninstall -> Complete Uninstall
    Lock bootloader
    1. Code:
      adb reboot bootloader
    2. Hold volume buttom -
      it is very important to avoid wipe
    3. Code:
      fastboot oem lock
      divice will reboot to bootloader
    4. Code:
      fastboot reboot
    I intentionally missed obvious steps such as renaming files twrp.img or magisk.zip and installing adb and drivers
    2
    Thank you. It works also on Jan 2019 update tested with windows 10 latest update x64
    summary:
    1)adb (I used https://forum.xda-developers.com/showthread.php?t=2588979)
    2)Install magisk manager on device (https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445)
    3)enable developer option: Settings -> About -> Software Information -> More -> Now Tap on the Build Number 7-8 Times until you see a toast message “Developer option enabled”.
    Settings -> Developer Option and Enable OEM Unlock and USB Debugging.
    P.S. Remember that after bootloader unlock, usb debugging will be turned off so renanable it. I suggest to remove also security pin (settings\security and position\screen lock \none) for a fastest unlock
    4)unlocking bootloader by prompt ms dos (REMEMER this reset device):
    Enter in fast boot mode -> adb reboot bootloader
    Unlock bootloader -> fastboot oem unlock
    5)After autoreboot, reset usb debugging on. now we need to upload a temporary recovery to install correctly magisk
    so prompt ms dos: fastboot boot twrp.img (this is just an example if your boot img is in the same folder. In my case i renamed twrp,img to boot.img and locate it in c:/ . So the command for dos is fastboot boot c:/boot.img. After OK twrp recovery will be loaded.
    6)twrp will ask you to install it but we don't need it. before go on just put magisk files in sdcard: we can use adb push function or manually from device
    if you want to use adb just open prompt ms dos: adb push Magisk-v18.0.zip /sdcard (this an example, in my case i renamed magisk-18.0.zip in magisk18.zip and located in c:\, so the command was adb push c:/magisk18.zip /sdcard)
    After select in Twrp recovery Install and select the magisk path (SDCARD magisk zip file). After installation , select reboot system from twrp and select do not install twrp. the device will reboot
    7)now we have to complete installation of Magisk:
    Open magisk app and select install (direct installation, raccomanded) and select reboot device in app
    8)enable camera2api and eis for gcam :
    open prompt ms dos and digit:
    adb shell
    su (wait and look at the device for accept permission)
    setprop persist.camera.HAL3.enabled 1
    setprop persist.vendor.camera.HAL3.enabled 1
    setprop persist.camera.stats.test 5
    setprop persist.vendor.camera.stats.test 5
    setprop persist.camera.eis.enable 1
    exit
    exit
    adb reboot
    9)removing root and relocking bootloader
    Open magisk app and select uninstall (complete) . Device will rebooted
    Now let's relock bootloader: prompt ms dos and digit
    adb reboot bootloader (we renter in fastboot mode)
    NOW is important to hold and keep holding volume - (this avoid reset) and digit fastboot oem lock. the recovery will reboot and return in fastboot screen now you can stop to press volume - and send command fastboot reboot
    10)Install Gcam apk (choose one of suggested for xiaomi mi a1)
    1
    Does this also enable EIS?

    Yes, but if you want to be 100% sure you can type "setprop persist.camera.eis.enable 1" after the first command.
    1
    @shaman_
    Please Can you make a video of the process and share that...
    I did not understand the process
    1
    It works? I mean, everything on gcam with this tutorial work?

    BTW, that method wipe my data?
    Yes. Yes. Yes.
    Autofocus bug remains.