To enable camera2api on stock ROM
1) Settingd> System > About Phone > build info : tap multiple times > this will enable developer options. Once activated , go to develop options and enable android usb debugging
2) boot into fastboot mode (power +vol up)
2) connect phone to pc via usb and open up command prompt windows in adb folder and give the command :
fastboot oem enable_camera_hal3 true
3) command : fastboot reboot
4) install gcam APK and enjoy
Notes : those who are facing error message "waiting for device'
Checkpoints :
1) reinstall max pro m1 device drivers after removing from device manager
2) in power on mode connect pc to usb and try giving command adb devices , accept pop up if any on phone and then try the fastboot procedure from step 1
3) sometimes u run out of luck hence try different machines (2 users reported success after they switched machines)
4) In some cases reported even after showing waiting message users were able to open gcam so even if waiting message shows up , try installing gcam and check whether it opens up. Good luck!