• 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

Stealtherthreat

Senior Member
May 8, 2017
95
27
I tried that but i need to unlock the bootloader again. Is there any other method?

---------- Post added at 08:53 AM ---------- Previous post was at 08:26 AM ----------



Let say I want to flash the magisk uninstaller, are these the correct steps?

1. Boot to bootloader
2. Unlock then reboot to system
3. Boot to bootloader
4. Boot twrp
5. Flash the magisk uninstaller then reboot

Is that all? What about camera2 API, EIS? Do I have to do it again?

---------- Post added at 09:36 AM ---------- Previous post was at 08:53 AM ----------



Ok now the magisk already uninstalled. I just simply long press the app and click uninstall. Not sure whether this way is ok or not but so far it seems ok.

Now I'm having problem to install the june security update. It keeps failing.
Check for the root. If it is not present then flash stock boot image and try updating again. If root is present then install magisk manager app again and flash uninstaller zip in it.
If the update still fails then you may have to flash the whole stock rom again from mi flash tool.
 

xilan_1129

Member
Nov 28, 2018
8
2
Check for the root. If it is not present then flash stock boot image and try updating again. If root is present then install magisk manager app again and flash uninstaller zip in it.
If the update still fails then you may have to flash the whole stock rom again from mi flash tool.

It is not root because I already unroot and lock the bootloader.
So, If I flash stock boot image, will it effect the camera2 api?

Sorry for so many question, I'm still noob.
 

abdullah-baig

Senior Member
Dec 7, 2013
124
54
lahore
Hi, i was wondering if this method still works ? I want try it on july patch , please help me out. I have been using camera2api since the first tool was released, so now for some reaosn i have to reset the phone, in that case i will lost the camera2api so is method legit to try on kuly patch ? With official twrp ? Please respond
 
Sep 2, 2015
32
7
Kuala Lumpur
Hi, i was wondering if this method still works ? I want try it on july patch , please help me out. I have been using camera2api since the first tool was released, so now for some reaosn i have to reset the phone, in that case i will lost the camera2api so is method legit to try on kuly patch ? With official twrp ? Please respond

I tried on my mi a1 yesterday.....camera2 api and eis enable..unroot...relock bootloader...all working fine except gcam apps...test so many version...usjng stock camera for now
 
  • Like
Reactions: abdullah-baig

abdullah-baig

Senior Member
Dec 7, 2013
124
54
lahore
I tried on my mi a1 yesterday.....camera2 api and eis enable..unroot...relock bootloader...all working fine except gcam apps...test so many version...usjng stock camera for now
Have you tried the latest twrp boot img ? And did you uninstall magisk via app ? Or magisk uninstaller zip? Which magisk did you use ? Given on in lino or latest ? Please respond
 
Last edited:

abdullah-baig

Senior Member
Dec 7, 2013
124
54
lahore
Meanwhile this method is good, but i have noticed if you use commands aprt form eis and camera2api, you wont be able to update to ota. Same case with me, i am not able.to install August ota , tried everything but failed.
 

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.