Camera2API enabled in build.prop, but can't use manual mode? - Xiaomi Redmi 4a Questions & Answers

I'm trying to get the Google HDR+ caamera to get working on my Redmi 4A. I've tried this guide https://forum.xda-developers.com/redmi-4a/how-to/redmi-4a-how-to-install-google-camera-t3728439 and flash the .zip file in TWRP. I've opened my build.prop to see that persist.camera.HAL3.enabled is on and it is, but according to manual camera compatibility i don't have manual mode enabled
how do I fix this?
I'm running AEX 5.7 on my Redmi 4a
Many thanks!

Open your terminal (Enable it in Developer Option)
To check if you've enabled Camera2Api. Type this in Terminal:-
Code:
getprop | grep camera
If you don't have it enabled, do this
Type in:
Code:
su
Code:
setprop persist.camera.HAL3.enabled 1
Reboot your phone after doing it

Related

Getting rid of the emulated CD drive and unknown devices in MTP mode [Partial Fix]

When you connect your MIUI device to the computer through USB in File Transfer (MTP) mode (that is, not in Photo Transfer), it also emulates a CD-ROM drive. The ISO image for the fake CD contains a copy of Mi Assistant, a device management tool for the PC, which is in Chinese only and can be downloaded from the Internet anyway. Basically, it's all useless and mildly annoying.
View attachment 3137500
Here's what you need to do to get rid of it:
Step 1. Edit /system/build.prop and add the line:
Code:
persist.service.cdrom.enable=0
Step 2. Edit /init.qcom.usb.rc and where it says:
Code:
on property:sys.usb.config=mtp
(a) Change the first line to remove mention of mass_storage (this is for the CD only):
Code:
write /sys/class/android_usb/android0/functions mtp
(b) Remove these two lines:
Code:
write /sys/class/android_usb/android0/f_mass_storage/lun/ro 1
write /sys/class/android_usb/android0/f_mass_storage/lun/file /data/miui/cdrom_install.iso
Similarly, where it says:
Code:
on property:sys.usb.config=mtp,adb
(a) Change the first line after the above to:
Code:
write /sys/class/android_usb/android0/functions mtp,adb
(b) Remove these two lines:
Code:
write /sys/class/android_usb/android0/f_mass_storage/lun/ro 1
write /sys/class/android_usb/android0/f_mass_storage/lun/file /data/miui/cdrom_install.iso
Step 3. Delete the ISO image file to free up some space.
File location: /data/miui/cdrom_install.iso
And here's how to do it:
Using Android Debug Bridge from the command line:
Code:
adb root
adb shell "mount -o remount,rw /system"
adb shell "echo persist.service.cdrom.enable=0 >>/system/build.prop"
adb pull /init.qcom.usb.rc
Now use your favorite editor to make changes as described above in step 2.
Code:
adb push init.qcom.usb.rc /
adb shell "mount -o remount,ro /system"
adb shell "rm -f /data/miui/cdrom_install.iso"
adb reboot
Using ES File Explorer:
Download from Play Store or the developer's website. Install. Open. In context menu (hold leftmost button for 1 second), switch Root Explorer to On (this will fail). Go back to the home screen. Open Security, Permissions, Root Access. Put the switch next to ES File Explorer to On. Now you can switch back to ES File Explorer, and follow the steps 1-3 above. Use the built-in editor the make changes in the files.
Unknown USB devices when connected in MTP mode
When your device is connected in MTP mode (File Transfer) there are 3 unrecognized USB devices. To check if you have them too, go to Control Panel and choose Device Manager or run mmc devmgmt.msc from the command line (screenshot 1). The devices appear to have no hardware IDs (screenshot 2) and their class number seems to be {c897b31c-e8d2-59e9-a212-ccf0962fe102} (full registry dump provided as attachment).
View attachment 3137478 View attachment 3137479
This problem appears to be caused by the CD-ROM emulation as well: the number of devices will actually increase to 4 when it's switched off following the instructions above, which means there must be one extra step to get rid of it completely. This doesn't seem to cause any problems and the issue appears to be purely cosmetic. If I have time to investigate it further, I will report the conclusions back here. Meanwhile, if anyone has an idea what the cause is, please feel free to share it (might also be a driver issue).
Disclaimer: there might be some mistakes in what I wrote. Please use at your own discretion. This should work with a "developer" stock ROM out of the box, otherwise you'll need to set-up root access first.
Update for a total fix, and a more elegant approach
So the missing link to make the mysterious devices disappear is to edit /init.qcom.usb.rc and where it says:
Code:
case "$cdromenable" in
0)
Comment out (put the # sign) in front of:
Code:
#echo "" > /sys/class/android_usb/android0/f_mass_storage/lun0/file
The best way to make the whole change seems to be to unpack boot.img, for example with Android Image Kitchen, apply the patches (diffs attached), rebuild the image, and flash it. The persist.service.cdrom.enable=0 property can be set in /default.prop so that all the changes are contained within the boot image. In summary:
Code:
unpackimg boot.img
echo "persist.service.cdrom.enable=0" >>ramdisk/default.prop
patch ramdisk/init.qcom.usb.rc < init.qcom.usb.rc.diff
patch ramdisk/init.qcom.usb.sh < init.qcom.usb.sh.diff
repackimg
cleanup
adb reboot bootloader
fastboot erase boot
fastboot flash boot image-new.img
fastboot reboot
@ Aqq123 thanks for the write up, I have a Mi 4C and the iso file is not in /data/miui/ but it still shows up when connecting to pc

[Guide] Enable Tethering on Android N Build NPC56P

As I mentioned in the "request thread...
This should work for all carriers however I've only testing on Sprint.
The problem on Android N is with dm-verity. Follow the guide to get root as well as dm-verity disabled so you can make changes to build.prop through custom recovery.
Here's how:
1) Enable USB debugging
2) In a terminal on your PC
- adb shell
- settings put global tether_dun_required 0
3) Download this boot.IMG from phh, for build NPC56P here: https://superuser.phh.me/nexus/shamu...erity-r189.img
4) Flash it using fastboot:
- sudo fastboot flash boot *path-to-downloaded.IMG*
5) Then with the volume buttons select TWRP recovery.
Then: under "Mount" check 'system' to mount system partition
- sudo adb shell
- echo net.tethering.noprovisioning=true>>/system/build.prop
6) Reboot device and enjoy tethering.
Extra) If you want root, just download Phh's SuperUser from the play store.

[CMD][A11]ADB Shell Commands For Blurred SystemUI, Pixel Signal Bars & Animation/Transition Speed 0.25

Hello People
Since a couple of days we have finally Android 11 for our xperia 1,
I searched the last days some on the internet and found these usefull ADB Shell Commands
# Blurred SystemUI
# Pixel signal bars
# Animation/Transition speed
What you need:
CMD window on your pc
Termux on your phone
(download in playstore)
Root
1: Blurred SystemUI
Open termux
Type: su
Grant root permissions
Type: resetprop ro.surface_flinger.supports_background_blur 1
Then type: pkill -TERM -f com. android.systemui
Then your device will reboot
Tadaa there you have Blurred SystemUI
(See attachment)
2: Pixel Signal Bars
Open cmd window on your pc
(hold shift + left mouse click)
Type:
1: adb shell cmd overlay enable com.android.theme.icon_pack.circular.systemui
2: adb shell cmd overlay enable com.android.theme.icon_pack.circular.settings
3: adb shell cmd overlay enable com.android.theme.icon_pack.circular.android
Reboot
3: Animation & Transition 0.25 speed
Open cmd window on your pc
(hold shift + left mouse click)
Type:
1: adb shell settings put global window_animation_scale 0.25
2: adb shell settings put global transition_animation_scale 0.25
3: adb shell settings put global animator_duration_scale 0.25
Reboot
Credits: Reddit & Niaboc79
res
:사랑:

[GUIDE] [Termux | Linux | WSL | Mac OS] Network Unlock and Enable OEM Unlocking for the OnePlus Nord N100

Moderator Announcement: THREAD CLOSED as duplicate of
OnePlus Nord | N10 | N100 [TMO/MPCS] Network Unlock & Enable OEM Unlocking (April 19th, 2021)
1.) ADB access must be enabled -Tap build number 7 times until Developer Options are enabled 2.) Enable USB Debugging -For PC-less enable Wireless Debugging Optional if PC-less 3.) Go to Play Store or F-Droid and download Shizuku 4.) Tap...
forum.xda-developers.com
***********************
1.) ADB access must be enabled
-Tap build number 7 times until Developer Options are enabled
2.) Enable USB Debugging
-For PC-less enable Wireless Debugging
Optional if PC-less
3.) Go to Play Store or F-Droid and download Shizuku
4.) Tap Shizuku in Terminal Apps and configure the shizuku file reflect the terminal package is "com.termux" and Start Shizuku
5.) Navigate to where the shizuku and shizuku.dex files are andn enter
cat shizuku > $PREFIX/bin/shizuku && chmod 755 $PREFIX/bin/shizuku
cat shizuku.dex > $PREFIX/bin/shizuku.dex && chmod 755 $PREFIX/bin/shizuku.dex && shizuku sh
TADA Now you have an ADB Shell locally on your OnePlus. One last command to enter.
settings put secure device_provisioned 0
Either nothing is returned or one word 'Success'is the only way to confirm the command was executed properly.
If with computer :
adb shell settings put secure device_provisioned 0
Congratulations your phone is now Network Unlocked. But wait, there's more to this groundbreaking method.
To enable OEM Unlocking in the Developers Menu this is where things get chipote-cray
In your terminal (termux, bash) enter this command
git clone {Mod edit} ESGN && cd ./ESGN/;mkdir -p lists;mv '0 - Pending.sh' Asus.sh Google.sh LG.sh Motorola.sh OnePlus.sh Samsung.sh Xiaomi.sh AOSP.sh Carriers.sh Huawei.sh Miscellaneous.sh Nokia.sh Oppo.sh Sony.sh zte.sh ./lists && bash detox.sh
Enter accordingly to onscreen prompts and then exit the script.
For finalization of effects Enter
adb reboot-bootloader
Toggle for the Start option.
Go to Network and Sim and there is confirmation that the Network Unlock is persistent. Go to Developer Options and viola, the Enable OEM Unlock button is enabled again. This is also persistent. Make sure to leave enabled in case of accidental/intentional factory reset. Good job everyone.
To get unlock code for the OnePlus.com/unlock_token form Enter
adb reboot-bootloader && fastboot oem get_unlock_code
0day from Jay . This isn't cosmetic, this directly impact's the kernel and is thus persistent.
Support for this is located
{Mod edit}

How To Guide How to use the Hardware Test App from ASUS on a Zenfone running a CustomROM

How to use the Hardware Test App from ASUS on a Zenfone running a CustomROM
The Hardware Test App from ASUS for the Zenfone 8 can also be used on a ASUS Zenfone 8 running a CustomROM.
But to get the App working on a CustomROM some efforts are neccessary.
The ASUS Hardware Test App needs the permission to modify system settings. To get this permission the app must be signed with the platform certificate used for the running Android OS.
And because these certificates are not available for the public for all public available CustomROMs (for some very good reasons ...) you must compile your own CustomROM for using the ASUS Hardware Test App on a CustomROM.
So -- for those who still want to continue: Here are the steps neccessary to run the Hardware Test App from ASUS for the Zenfone 8 on a phone running a CustomROM :
First copy the apk with the ASUS Hardware Test App from a Zenfone 8 running the original Android 12 from ASUS to your PC.
This is the file
/system/apps/SMMI_TEST/SMMI_TEST.apk
on the phone running the ASUS Android OS.
Now it's neccessary to sign the App with the platform key from your CustomROM:
In the OmniROM (and I assume that's also true for other AOSP based CustomROMs) the neccessary files, platform.pk8 and platform.x509.pem, are in the directory
Code:
./build/make/target/product/security
in your build tree for the CustomROM, e.g.
Code:
[[email protected] /data/develop/android/OmniROM]$ ls -l ./build/make/target/product/security/platform.*
-rw-------. 1 xtrnaw7 xtrnaw7 1219 Jun 25 09:39 ./build/make/target/product/security/platform.pk8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1460 Jun 25 09:39 ./build/make/target/product/security/platform.x509.pem
[[email protected] /data/develop/android/OmniROM]$
Now re-sign the apk file using these commands:
Code:
# remove the current certificate files from the apk (probably not neccessary -- but shouldn't harm)
#
zip -d SMMI_TEST.apk META-INF/CERT.SF META-INF/CERT.RSA
# do a zip align for the apk and write the output to SMMI_TEST1.apk
#
# (zipalign is part of the OTA tools)
#
/data/develop/android/otatools/bin/zipalign 4 SMMI_TEST.apk SMMI_TEST1.apk
# test the result (there should be NO output from this command)
#
/data/develop/android/otatools/bin/zipalign -c 4 SMMI_TEST1.ap
# and now sign the apk with the platform key from the development tree for your self compiled CustomROM
# (apksigner.jar is part of the Sdk from Google for Android)
#
java -jar ./Android/Sdk/build-tools/33.0.0/lib/apksigner.jar sign --key platform.pk8 --cert platform.x509.pem SMMI_TEST1.apk
That's it . The re-signed apk file SMMI_TEST1.apk should work on your CustomROM
To test it:
To test the signed apk do:
Copy the signed apk to the phone running your self compiled CustomROM and issue
Code:
ls -l /sdcard/Download/SMMI_TEST1.apk
# 25733396 in the next command is the size of the file /sdcard/Download/SMMI_TEST1.apk in byte
#
cat /sdcard/Download/SMMI_TEST1.apk | pm install -S 25733396
If you get an error like this
Code:
130|ASUS_I006D:/ # ls -l /sdcard/Download/SMMI_TEST1.apk
-rw-rw---- 1 u0_a111 media_rw 25733396 2022-08-04 19:02 /sdcard/Download/SMMI_TEST1.apk
ASUS_I006D:/ #
ASUS_I006D:/ # cat /sdcard/Download/SMMI_TEST1.apk | pm install -S 25733396
Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Reconciliation failed...: Reconcile failed: Package com.asus.atd.smmitest has no signatures that match those in shared user android.uid.system; ignoring!]
1|ASUS_I006D:/ #
something went wrong signing the apk. Just do it again.
To install the apk do:
If not already done:
Compile your own CustomROM (using the certificates used to sign the ASUS Hardware Test App!) and install it on the ASUS Zenfone 8. (see How to compile the OmniROM for the ASUS Zenfone 8 for how to compile the OmniROM)
Install Magisk on your phone running the self compiled CustomROM
Simulate a Magisk Module using these commands:
Code:
adb shell su - -c mkdir -p /data/adb/modules/SMMI_TEST/system/app/SMMI_TEST
adb push SMMI_TEST1.apk /sdcard/Download/
adb shell su - -c cp /sdcard/Download/SMMI_TEST1.apk /data/adb/modules/SMMI_TEST/system/app/SMMI_TEST/SMMI_TEST1.apk
adb shell su - -c chmod o+r /data/adb/modules/SMMI_TEST/system/app/SMMI_TEST/SMMI_TEST1.apk
and reboot the phone
Code:
adb reboot
After the reboot the ASUS Hardware Test App should be visible in the directory /system/app, e.g.
Code:
130|ASUS_I006D:/ # find /system/app/SMMI_TEST/
/system/app/SMMI_TEST/
/system/app/SMMI_TEST/SMMI_TEST1.apk
ASUS_I006D:/ #
To execute the ASUS Hardware Test App do
Code:
# open a shell on the ASUS Zenfone 8 (either local or via "adb shell"), become root user
su -
and execute
Code:
# switch SELinux to permissive mode (I currently do not know the neccessary SELinux policies to avoid this step ...)
#
setenforce 0
# and start the ASUS Hardware Test App from within the shell
#
am start -n com.asus.atd.smmitest/com.asus.atd.smmitest.main.MAIN
Do not forget to enable SELinux enforcing mode after the tests are done (or reboot the phone ...)
Code:
# switch SELinux to permissive mode (I currenlty do not know the neccessary SELinux policies to avoid this step ...)
#
setenforce 1
Sample Script to start the ASUS Hardware Test App
Code:
# simple script to start the ASUS Hardware App
CUR_SELINUX_STATUS="$( getenforce )"
CUR_USERID=$( id -u -n )
RESTORE_SELINUX_STATE="false"
if [ "${CUR_SELINUX_STATUS}"x != "Permissive"x ] ; then
if [ "${CUR_USERID}"x != "root"x ] ; then
echo "Either start this script as user \"root\" or set the SELinux mode to \"permissive\" using the command \"setenforce 0\" before starting this script"
exit 1
fi
echo "Setting the SELinux mode to \"Permissive\" ..."
setenforce 0
RESTORE_SELINUX_STATE="true"
else
echo "The SELinux mode is already \"Permissive}\" "
fi
am start -n com.asus.atd.smmitest/com.asus.atd.smmitest.main.MAIN 2>&1 | tee /sdcard/Download/test.out
if [ ${RESTORE_SELINUX_STATE} = true ] ; then
echo "Press return when done with the tests .."
read USER_INPUT
echo "Setting the SElinux mode back to \"Enforcing\" ...."
setenforce 1
else
echo "Do not forget to set the SELinxu mode back to \"Enforcing\" using the command \"setenforce 1\" "
fi
Trouble Shooting
If the boot process of the phone hangs after adding the pseudo Magisk Module for the ASUS Hardware Test App do:
Code:
# connect to the phone via adb (that should work!)
#
adb shell
# become root user
#
su -
# delete the file with the AUS Hardware Test App
#
rm /data/adb/modules/SMMI_TEST/system/app/SMMI_TEST/SMMI_TEST1.apk
# and reboot the phone
#
reboot
Most probably something went wrong signing the app or you did not do the zip align (there should be some messages visible in logcat to find the reason for the boot loop; check the output of logcat before rebooting the phone)
A useful test to find reason for the boot loop is :
Code:
# try to install the apk as root user
#
su -
# and then
#
setenforce 0
pm install /sdcard/Download/SMMI_TEST.apk
If booting the phone works but the App does not start make sure that the SELinux status is permissive.
Update 26.06.2022
The adb commands to create the "simulated" Magisk Module must be executed by the user root - fixed.
Added a sample script to start the ASUS Hardware Test Tool
Update 04.08.2022
Added instructions to to test if signing the apk was successfull
Thank you so much for your guides! This is very detailled documentation with good explanations!

Categories

Resources