• 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

vishmallik

New member
Jul 8, 2018
3
0
Error 1 while uninstalling magisk

Hi.. I have followed your guide.. but while uninstalling magisk from device.. it says unsupport/unknown image format.. I also tried to uninstall by booting to twrp and then flash uninstaller.. but same error..so what should I do to uninstall it?
Btw.. two things happens while following your guide.. that might be the reason behind this error.
1. When I initially unlocked phone.. I pressed vol down to avoid data loss..but as your guide says it should boot to system..but in my case.. after entering command I was still in fastboot.. only the screen flashed one time.. I ignored this.. and continued to boot twrp.. then twrp booted but some commands operated automatically and as far as I remember..it shows.. unclocking process is successful and then fails to mount vendor 2-3 times then automatically booted to system.
2. When I boot to twrp again.. it asked to keep system read only..and I pressed yes..and flashed magisk... It shows it flashed successfully but also says.. failed to mount vendor.. I ignored that and after rebooting magisk worked normally.
vUsxekE
 

Carlos_EVH

Senior Member
Jul 30, 2013
124
105
Malaga, Sp
So, there are people with problems to update OTAs after this method. I enabled the Camera2 in my personal Mi A1 with the old method with magisk modules, but I don't know if this method is better than the other to do in another stock Mi A1.
 

DJBhardwaj

Recognized Contributor
Apr 23, 2011
5,050
2,707
27
Delhi
So, there are people with problems to update OTAs after this method. I enabled the Camera2 in my personal Mi A1 with the old method with magisk modules, but I don't know if this method is better than the other to do in another stock Mi A1.

That's because many users still have modifications like a modified boot, Magisk, etc on the inactive slot (They might have implemented them previously). Start by restoring the stock firmware to both the slots and then use this guide, you will never face any problems with OTAs.
 
  • Like
Reactions: Carlos_EVH

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.