Adb command to permanently disable android 12 mic, camera indicators [migrated] - android

This question was migrated from Stack Overflow because it can be answered on Android Enthusiasts Stack Exchange.
Migrated 23 days ago.
I want to permanently disable the microphone and camera usage indicator on Android 12.
I tried the following ADB command, but it only disable for some minutes: adb shell cmd device_config put privacy camera_mic_icons_enabled false default.
I also tried these commands but nothing changes; it only works for some minutes.
echo off
adb shell cmd device_config put privacy camera_mic_icons_enabled 0
PAUSE
adb reboot
(
echo echo off
echo PAUSE
echo adb reboot
)> adbReboot.bat
Enter
adb reboot
How to permanently disable these indicators?

Related

Activate ADB wireless without USB connection to the device

I found several isntructions to activate ADB over wireless network instead USB connection (like this) but I have a problem: my device has the USB port broken.
I cannot execute adb tcpip 5555 because that, so I need to activate ADB over wireless if I want to use ADB to control the device.
Is there any way to do that without rooting the device? I tried several commands on a terminal emulator, but I didn't accomplish my objective.
Any proposal on that?
I have managed to do this using ssh with the following script. It might require some small adjustments (our platform is using systemctl, for one, so you might need to change those calls).
#/bin/bash
if ! command -v sshpass &> /dev/null
then
echo "sshpass could not be found. Please install it by running 'sudo apt install sshpass'"
exit
fi
IP="192.168.0.111"
USERNAME="user"
PASSWORD="password"
if [ $1 -a $1 == "disable" ]
then
read -n 1 -s -r -p "To disable adb over WiFi please plug in the USB cable and press any key."
adb disconnect $IP
adb kill-server
sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME#$IP "setprop service.adb.tcp.port -1; systemctl stop adbd; killall adbd &>/dev/null; systemctl start adbd &>/dev/null"
else
read -n 1 -s -r -p "To enable adb over WiFi please unplug USB cable and press any key."
adb kill-server &>/dev/null
sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME#$IP "setprop service.adb.tcp.port 5555; systemctl stop adbd; killall adbd; systemctl start adbd &>/dev/null"
adb kill- &>/dev/null
adb connect $IP &>/dev/null
fi
echo "Done!"
If your device is running Android 11 or above then you can accomplish this without initially needing to connect the phone to PC via USB as mentioned in the official Android developer site (link).
If the Android device is running Android 10 or below then there is no straightforward way without initially connecting USB (link).
Duplicate of
Run/install/debug Android applications over Wi-Fi?
Adding to it, if you install Android Studio Bumblebee version and your device OS is 11+,
there is a direct option to connect via Android Studio.
Here are the steps:
First, Connect your phone and machine on the same wifi network
on Phone:
Go to Developer Options -> Wireless Debugging -> Turn on the switch then tap on text Wireless Debugging
Select Pair device with QR code
on Desktop:
1.
Expand this drop down
Select Pair
Scan the QR code wait for some time and that's it!
Note: It disconnects frequently, has to be a bug which we should wait to get fixed

Android 7.1.1 multi-user support in emulator

I tried to get the multi-user support for my Android 7.1.1 AOSP emulator build on Ubuntu 16.04 64bit. The build gets run with lunch aosp_x86-eng and following the emulator with emulator64-x86.
I tried this solution but with no success:
adb shell
su
setprop fw.max_users 5
The Icon is visible for the first time when I wipe down the status bar, but disappears on releasing it:
Same like here:
adb shell setprop fw.show_multiuserui 1
adb shell setprop fw.max_users 4
I also tried to add an user by adb but without success.
After executing the commands I test it by using:
su
pm get-max-users
result is:
Maximum supported users: 4
Is there a barrier or something like that? Or do I need to edit the build? If I need to root the system, why is the property set to 4 users? And why is the icon shown on the first wipe and disappears after releasing?
Thanks!

Open USB Relay - Android

I have KMtronics USB relay which I want to control with my Android device. Is it possible to run the following Linux command:
#!/bin/sh
# sends on signal to the USB relay
echo -e '\xff\x01\x01' > /dev/ttyUSB0
I tried to execute same command with some Shell Executor apps but always either getting Permission Denied or Unable to create file/folder. Even I tried to run it on Rooted device too.
Permission problem could be solved like this:
echo -e '\xff\x01\x01' | sudo dd of=/dev/ttyUSB0

Set screenlock setting interactively

I want to set the screenlock mode to None in KitKat so I can run CTS.
I'm using the DragonBoard APQ8074 for development from Intrinsyc, and they just released their BSP for Android KitKat 4.4.2. Trouble is, it's unstable and the Security menu in Settings crashes. So I can't use adb shell to input keyevents 19, 20, 21, 22, 23 to navigate.
adb shell settings command seems like it should work for this, but it's not. I tried these commands against 4.2, 4.3 and 4.4, and they seem to assign the values, but they don't visually result in any changes.
shell#msm8974:/ $ settings get system lockscreen_disabled
null
shell#msm8974:/ $ settings put system lockscreen_disabled true
shell#msm8974:/ $ settings get system lockscreen_disabled
true
shell#msm8974:/ $ settings get system screen_brightness
102
shell#msm8974:/ $ settings put system screen_brightness 255
shell#msm8974:/ $ settings get system screen_brightness
255
Now I dunno if lockscreen_disabled is what I want, here, but Settings.java doesn't seem to provide a call to any sort of unlock_mode, so I dunno what else to do. I don't want to write an app to do this, I just want to set screen lock mode to None so I can run CTS. If I need to modify source, then make & flash a new image, I'm willing to do that, but I don't know what to modify. Thanks for any guidance.
Got it figured out.
1. Update settings.db using adb shell
shell#msm8974:/ $ su
shell#msm8974:/ # sqlite3 /data/data/com.android.providers.settings/databases/settings.db
sqlite3> update secure set value=1 where name='lockscreen.disabled';
sqlite3> .quit
2. Move or delete locksettings files
shell#msm8974:/ # mkdir /data/system/lock
shell#msm8974:/ # mv /data/system/locksettings* lock
adb reboot and good to go.
If there is no sqlite installed on the device use the following
1. Set Settings
adb shell settings put secure lockscreen.disabled 1
2. reboot to recovery
adb reboot recovery
3. remove locksettings db files
adb shell rm /data/system/locksettings.db
adb shell rm /data/system/locksettings.db-shm
adb shell rm /data/system/locksettings.db-wal
You should use lockscreen.disabled as the variable name in the setting command, and secure as the name space:
shell#msm8974:/ $ settings put secure lockscreen.disabled 1

How can I do factory reset using adb in android? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
How can I do the factory reset in android using ADB command? I had used adb reboot recovery command to get reset. But third party applications couldn't be cleared somehow.Is it correct way to achieve using ADB?
Actually, I want to do factory reset android devices through java code. What can be solution here?
You can send intent MASTER_CLEAR in adb:
adb shell am broadcast -a android.intent.action.MASTER_CLEAR
or as root
adb shell "su -c 'am broadcast -a android.intent.action.MASTER_CLEAR'"
After Android 8.0 and above with root permission from shell
am broadcast -p "android" --receiver-foreground -a android.intent.action.FACTORY_RESET
Try :
adb shell
recovery --wipe_data
And here is the list of arguments :
* The arguments which may be supplied in the recovery.command file:
* --send_intent=anystring - write the text out to recovery.intent
* --update_package=path - verify install an OTA package file
* --wipe_data - erase user data (and cache), then reboot
* --wipe_cache - wipe cache (but not user data), then reboot
* --set_encrypted_filesystem=on|off - enables / diasables encrypted fs
Warning
From #sidharth: "caused my lava iris alfa to go into a bootloop :("
For my Motorola Nexus 6 running Android Marshmallow 6.0.1 I did:
adb devices # Check the phone is running
adb reboot bootloader
# Wait a few seconds
fastboot devices # Check the phone is in bootloader
fastboot -w # Wipe user data
I have made it from fastboot mode (Phone - Xiomi Mi5 Android 6.0.1)
Here is steps:
# check if device available
fastboot devices
# remove user data
fastboot erase userdata
# remove cache
fastboot erase cache
# reboot device
fastboot reboot

Categories

Resources