text:
mount multiple ext4 partitions manually
I have rooted android phone running android 10. I have one ext4 partition created using :
  #  dd if=/dev/zero of=/sdcard/ext1.img bs=1M count=1024
  #  mkfs.ext4 -F /sdcard/ext1.img

which I mount using below commands:
  #  mknod    /dev/block/loop52  b 7 0
  #  losetup  /dev/block/loop52  /sdcard/ext1.img
  #  mkdir /mnt/ext
  #  mount -t ext4 -o rw,noatime  /dev/block/loop52  /mnt/ext

ext1.img file gets mounted successfully but when I create another ext4 file and try to mount in /mnt/ext2 using following commands. It gets mounted but the contents of ext1.img are shown in /mnt/ext2.
  #  mknod    /dev/block/loop62  b 7 0
  #  losetup  /dev/block/loop62  /sdcard/ext2.img
  #  mkdir /mnt/ext2
  #  mount -t ext4 -o rw,noatime  /dev/block/loop62  /mnt/ext2

What changes do I need to make to mount multiple ext4 files in android ?

You are using the same minor number for both devices. Second time you should do mknod /dev/block/loop62 b 7 1. But why are you doing mknod and losetup manually? Mostly devices have already a few (usually 8) loop devices created on boot (which you might be overwriting by using the same major/minor numbers). And mount command handles losetup on its own. Just do mkdir <mount_point>; mount <img_file> <mount_point>.

Using mknod /dev/block/loop62 b 7 1. then  losetup  /dev/block/loop62  /sdcard/ext.img gives error: losetup: /dev/block/loop62=/sdcard/ext2.img: Bad file descriptor.     Aren't those loop devices (created on boot) used by the system itself ?  Running mount  /sdcard/ext2.img /mnt/ext2  shows error: mount: can't setup loop device: No such device or address

Which losetup and mount binaries are you using? busybox, toybox, standalone? Share strace of both commands. Also do ls -l /dev/block/loop* and grep -H . /sys/block/loop*/loop/backing_file.

The problem is solved. I used the existing system /dev/block/loop*  i.e. /dev/block/loop0 and /dev/block/loop1.  Then mounted both ext4 files using :  losetup  /dev/block/loop0  /sdcard/ext.img ; mkdir /mnt/ext ; mount -t ext4 -o rw,noatime  /dev/block/loop0  /mnt/ext ;  losetup  /dev/block/loop1  /sdcard/ext2.img ; mkdir /mnt/ext2 ; mount -t ext4 -o rw,noatime  /dev/block/loop1  /mnt/ext2 .


text:
Android X86 Stuck on detecting android x86 on VMWARE with AMD CPU
If there's a link to a fix in another thread please tell me, but for now here's my problem
I want to use Instagram on an android emulator to upload reels since my phone is dead and I'm under lockdown, Neither any of the Advertised emulators work, I tried Nox,Memu,Bluestacks and LDPlayer and all of them when I install instagram the app stop working.
So back to the point;
I installed VMWare and download an android X86 VMDK and iso image, both doesn't boot, The iso one restarts on detecting android x86 and vmdk one gets stuck on detecting android x86, I tried Virtual box, same result.
How do I fix it?
Specs: Amd Athlon II x45,4GB Ram,Nvidia GT 220

So the Instagram web site isn't sufficient for you? Regarding Andorid-x86 we had a number of questions about that emulator and they all mention that the x86/32bit variant does not boot/work. Only the 64bit version seems to work.

I want to upload reels and photos, which is something you can't do anymore on instagram website

Which Instagram app version do you try to install? Make sure you are using the x86 version https://apkpure.com/de/instagram/com.instagram.android/variant/179.0.0.31.132-APK besides that I would recommend Genymotion or the standard emulator from Android SDK.

Genymotion gives an error when booting, I tried it

Then your CPU most likely misses the required virtualization features or those features are disabled in BIOS. In any way your PC lacks the minimum requirements regarding RAM. An recent Android emulator typically requires 2-4GB RAM for itself.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Tablet Homescreen Widgets for Specific Webpages
I'm looking for a way to make a custom shortcut on the home screen to open a specific browser to a specific site.  As a hypothetical example, I want to create a shortcut to birdwatch.com/watchnow with the birdwatch.com logo as the shortcut with a custom size and design.
I know how to launch specific apps as a custom widget with KWGT but I am unsure how to launch specific webpages.
I also know how to do it from within a browser but that leaves just a small 1x1 regular shortcut on the screen.
Does anybody know of a solution?

Typically within each web browser there is a function to create an "desktop icon". Have you tried that?

Yes, but that will only leave a little 1x1 shortcut I cannot customize.  I'm wanting to make a custom-sized widget link with text or an image as the shortcut.
I'm sort of stuck with it working halfway on both sides.  I can get the link working from a browser shortcut or a fancy link that doesn't go where I want with a widget.

That you can't customize the link is the fault of the web browser which created it. There are apps that can be used alternatively https://play.google.com/store/search?q=web%20link%20icon%20creator%20launcher&c=apps

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How to recover data from image?
I have an encrypted complete .img of the userdata partition.
What tools or steps can I take, with the assistance of my phone, to decrypt this image?
It is my understanding that decrypting it without the phone is usually not possible. Given that I do have the phone however, what can I do?

https://android.stackexchange.com/q/234692


text:
I can't downgrade webview nor update it because I'm locked out of play store. What can I do?
My mom's phone (yes, I know what you're thinking :-) suffered from the webview update glitch yesterday.
She thought that for whatever reasons it might have something to do with her credentials, so she set a new password from another device.
I know about the fix for that glitch, but can't do much about it using the recommended methods because now she's locked out of her Google account on her phone. Obviously, trying to update her credentials on her phone must bring webview which doesn't work.
It does sound like some kind of catch 22 that my very limited knowledge can't help me getting out of.
Any help would greatly appreciated, thanks for your attention.

If it is just for Play Store access you can create another Google account on device and this time save and write down user name and password!

Thanks for your reply Robert. Well I can't do any of that because I wouldn't be able to log into that account on the phone because that would bring the webview glitch back.

You can try to install Chrome respectively Android System WebView app (depends on the Android version which one is used for displaying WebViews) manually e.g. from ApkPure.com ApkMirror.com or a similar site. The web browser if not shown as WebView works, only the WebView itself is bugged.

I'm not certain of fully understanding you, do I need to try and bypass webview in favour of chrome ? Chrome is already installed on the phone and it seems to work fine, but how can I use it to log her back into her Google account on the phone ?

Chrome stand-alone works without problems, but if Chrome is used as System WebView component every app that uses it will crash if you have the defect version installed. I had this situation on my device. But this assumes Chrome is used as WebView provider. You can check which app is used as WebView in Android Developer Options (hidden by default).

Thanks Robert. I've enabled developer options, and went to see which app is used as webview provider. It's Chrome, the other option being webview itself but it appears to be disabled and can't be selected.

Then you have to upgrade chrome to the latest version to fix the WebView problem.

It worked, thanks Robert !

I've just done what @Robert wisely advised me to do which is to use an APK app to install the newest copy of Chrome to my mom's phone and thus benefit from the bug free version of webview to update her credentials and regain control of her phone. That's worked a treat.
Thanks Robert :-)


text:
Temporary rooting of android device
Recently, I was wondering if rooting needs to be a binary choice - root or no root. Can I have a phone that is unrooted, but for specific tasks, I temporarily root it, or temporarily get some privilege escalation for a specific app, and then back to unrooted either on reboot or some other way?
I was intrigued to see that there has been some discussion on such things in this stack exchange site:

temp root vs permanent root, where it was stated that "AT&T Samsung Galaxy Note 4 currently has temp root", but it seems a very old post
this answer about 4 leading root methods hints about "exploit based temp root methods", but it also says they are still in development or outdated

Any temp root method that somebody could point me to, that can be tried? It doesn't have to work on the latest android version, although if it does, even better.

For gaining temporary root permissions you need an vulnerable device and a matching exploit. Google and other manufacturer are fixing vulnerabilities every month, therefore what you are trying to do may be possible but it depends on your device. The older the device the higher the chance for a vulnerability you can use. But please keep in mind that everything you can do can also be done by a malicious app secretly in background. Therefore using vulnerable devices is a bit like playing with fire, the wrong app can destroy everything...

How to manually root a phone?

"Temporary root" is a wrong or at least vague term in my opinion. Root is root. You get the ability to run commands with UID 0, all of the (37 or more) Linux capabilities and a fully permissive SELinux context. If some capabilities are missing or SELinux context is not fully permissive, that's "incomplete root". But once you have root, it's up to you if you allow the apps to use root privileges or not. If you do, it's permanent root. If you don't it's temporary. So every rooting method can be considered permanent or temporary, depending on your choice.


text:
Adb sideload flashing file type recovery or fastboot
I want to flash rom through Adb sideload I am confused with zip.file used in sideload. is it recovery file or fastboot file?
I am downloaded both from
https://xiaomifirmwareupdater.com/miui/lavender/stable/V11.0.9.0.PFGINXM/

adb is unrelated to fastboot, you can either run adb commands with usb-debugging enabled in boot mode, or adb sideload command in recovery mode. fastboot commands work with fastboot mode only (no adb commands accepted) and requires unlocked bootloader


text:
Is there a way to log all access to the phone include a photo
Is there a way to setup an android phone so that it logs all access and takes a photo each time it's accessed?

By access, do you mean "attempts to unlock the screen"? If yes, there are already apps for your use case. E.g. https://play.google.com/store/search?q=anti%20theft%20catcher&c=apps&hl=en_US&gl=US

Not just attempts each time it's unlocked. The phone may be accessed with a correct password by multiple people


text:
Settings won't open because of Samsung Experience Service after Software Update
I updated my android today and now the settings app won't open. I can access all settings through the search function of the launcher except Samsung specific ones.
I connected the phone to my pc to see the logs and here is the stack trace from logcat:
FATAL EXCEPTION: main
Process: com.android.settings, PID: 17254
java.lang.RuntimeException: Failed to call observer method
at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:226)
at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent(ClassesInfoCache.java:194)
at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks(ClassesInfoCache.java:186)
at androidx.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged(ReflectiveGenericLifecycleObserver.java:37)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:361)
at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:300)
at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:339)
at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:145)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:131)
at com.android.settingslib.core.lifecycle.ObservablePreferenceFragment.onStart(ObservablePreferenceFragment.java:80)
at com.android.settings.dashboard.DashboardFragment.onStart(DashboardFragment.java:266)
at com.android.settings.homepage.TopLevelSettings.onStart(TopLevelSettings.java:192)
at androidx.fragment.app.Fragment.performStart(Fragment.java:2756)
at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:355)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1192)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1354)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1432)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1495)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2620)
at androidx.fragment.app.FragmentManager.dispatchStart(FragmentManager.java:2578)
at androidx.fragment.app.FragmentController.dispatchStart(FragmentController.java:258)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:550)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:201)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1435)
at android.app.Activity.performStart(Activity.java:8207)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3806)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2295)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:596)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

Caused by: java.lang.SecurityException:
Failed to find provider com.samsung.android.mobileservice.profileProvider for user 0; expected to find a valid ContentProvider for this authority
at android.os.Parcel.createExceptionOrNull(Parcel.java:2385)
at android.os.Parcel.createException(Parcel.java:2369)
at android.os.Parcel.readException(Parcel.java:2352)
at android.os.Parcel.readException(Parcel.java:2294)
at android.content.IContentService$Stub$Proxy.registerContentObserver(IContentService.java:1229)
at android.content.ContentResolver.registerContentObserver(ContentResolver.java:2630)
at android.content.ContentResolver.registerContentObserver(ContentResolver.java:2618)
at com.samsung.android.settings.homepage.TopLevelSamsungAccountPreferenceController.onStart(TopLevelSamsungAccountPreferenceController.java:95)
at com.android.settingslib.core.lifecycle.Lifecycle.onStart(Lifecycle.java:124)
at com.android.settingslib.core.lifecycle.Lifecycle.access$100(Lifecycle.java:55)
at com.android.settingslib.core.lifecycle.Lifecycle$LifecycleProxy.onLifecycleEvent(Lifecycle.java:222)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:222)
... 36 more

Caused by: android.os.RemoteException: Remote stack zrace:
at com.android.server.content.ContentService.registerContentObserver(ContentService.java:388)
at android.content.IContentService$Stub.onTransact(IContentService.java:482)
at android.os.Binder.execTransactInternal(Binder.java:1190)
at android.os.Binder.execTransact(Binder.java:1159)

So the relevant part seems to be:
Caused by: java.lang.SecurityException:
Failed to find provider com.samsung.android.mobileservice.profileProvider for user 0; expected to find a valid ContentProvider for this authority

What I've tried so far:

Restart the phone
Restart the phone in safe mode
Reinstall Samsung Experience Service
Reinstall com.android.settings
Reinstall com.samsung.android.mobileservice

I think because there are Samsung related settings in the settings main menu, it causes a crash. Any ideas on how to get the settings back?
PS: Please don't suggest a factory reset. That is cause for another headache.
PPS: Previously, I had uninstalled Samsung bloatware via "adb shell". But that had never caused problems. So maybe now one missing package could be the culprit?

Unfortunately, I caved in and did a factory reset. I made sure not to delete "com.samsung.android.mobileservice" when cleaning the bloatware (of which there is a ton).

It's caused by uninstalling com.osp.app.signin. If you simply uninstalled the package for --user 0 (which most debloating scripts do), then you can reinstall it with
adb shell cmd package install-existing com.osp.app.signin

Thanks for the suggestion. In my case, the answer is too late to the party. But let's hope it helps others, or maybe me when I get a new phone in the future. :)

YES - thank you!!! (I had gone down the same path of uninstalling some bloat for samsung and must have accidentally uninstalled this one; didn't notice until ages later when I tried to open the settings app and of course could not remember which of the uninstalled apps was the issue)


text:
OTG disconnects when screen turns off
I am using OTG external drive constantly. But it will always disconnect when the screen turns off. This causes data loss issues. I tried to find any related settings in system settings and developer options, but no luck. I tried to disable battery optimization etc.. None of them works.
Btw, I am running Andriod 10 (non rooted) (Sony model).
Do anyone know how to fix the issue or workaround it?
Thanks a lot.

@alecxs thanks a lot for your reply. I think the problem is due to the built-in filesystem driver. I tried some third-party FAT32 and exFat drivers and they don't disconnect when screen turns off. But third-party drivers have some limitations, for example unable to really mount the drive on un-root device. I think I am out of luck on this device's built-in driver. Btw, the issue doesn't happen to all android devices. I think it's model specific issue.

Check your battery setting, if there is something like battery saver when screen turns off.


text:
Unable to switch hw keyboard language
Do I have to buy HW keyboard located to my native language in order to be able to write in my native languag ?
So far, everytime I connect HW keyboard which has natively only EN characters, I am not able to write interpunctions and any special characters of my native language, despite Android shows that my native language is choosen.
I've used stock (LG keyboard), gboard, swiftkey
nothing helped, once HW keyboard is connected, only English and characters which are on the keyboard physically marked, I can use.
Thank you

An USB keyboard is language independent (except for it's key printings), it simply sends keycodes of pressed keys. What character is assigned to each key only the OS knows which processes the keycodes.

So, it simply doesn't work. Shame


text:
USB ethernet goes to sleep, has to be reconnected to restore
I have an old Nexus 7 tablet running LineageOS that still works but has poor battery life. I've set it up in a fixed location with AC power instead. Its location has poor wifi so I've added a UGreen micro-USB 100Mb ethernet adapter, which also provides power. It does work correctly when first plugged in, so the device is supported by Android - it gets an IP address and communicates without wifi.
Shortly after the screen goes to sleep, the NIC goes down. I assume this is some sort of power-saving mode. However, it doesn't come back up when the tablet is woken. It has to be unplugged and plugged back in to work. Is there a setting I can change that will leave the NIC enabled at all times? Or at least resume the ethernet connection when it wakes up.
Android version: 7.1.2
LineageOS version: 14.1

As a workaround you may want to look into how to keep the screen/display off after X minutes while preventing the phone from going into sleep mode. If phone doesn't go into sleep mode at all, your adapter should keep working.

@Firelord yes, I've considered that. It is a workaround though - the tablet only gets used for about an hour a day, so keeping the screen awake for the other 23 seems wasteful.


text:
Swap back & recent button
I am using Moto-g30 running Android 11 (Pure-stock ROM with moto bloat). By default it's using three button navigation bar with the following layout
back; home; recent
I'm trying to swap the recent & back button for easy right handed accessibility. So far I've tried these possible solutions to change the order.

Look inside system settings to change the order. - No Success
Use adb command settings put secure sysui_nav_bar "space,recent;home;back,space" - No Success

Any other alternative to achieve this without root permissions ?


text:
Alphanumeric symbols in the data/app directory?
Why are the names of the applications replaced with alphanumeric characters in the data/app directory? I am seeing this when accessing the directory through an adb shell.

See this question, it's answer and the comment for answer to your question.


text:
Detect which type of SSL Pinning is being used on Android Applications
Is there a way to detect what the Android Application is using as SSL Pinning. Whether it is certificate Pinning , Public Key Pinning or Hash Pinning ?
I am doing a study on local Android Applications and would like to collect data on what type of Pinning these applications are using.
TIA

Reverse engineer the apps using Jadx, apktool, JEB, Ida, Ghidra, .... But that is more a topic for https://reverseengineering.stackexchange.com Of course you need sufficient programming skills to understand the decompiled code. The more you know about Android development and reverse engineering the easier you will understand the decompiled code.

The official documentation for Android Developer mentions a little bit about this. Btw, I know an app that uses public-key pinning. However, there's no easy way except to reverse engineer the app and analyze the code.


text:
Help with ultra power saving mode bug
I have a Samsung Galaxy S5 with a major problem. One night while turning the phone to Ultra Power Saving Mode the phone immediately shut down. I left the phone o charge and the next morning I woke up the whole entire phone system was gray, it had no color, I thought this was just a glitch so I left the phone to at least make it settle but afterward that it was still gray and had no color, I had access to all my apps but it was just that everything was gray. I have restarted the phone and removed the SD card multiple times but nothing seems to work. I have even gone into settings and tried turning on Emergency mode but nothing happens. Kindly please help me with my problem and sorry about my grammar as English isn't my first language. Have a nice day


text:
Android 8 confirmation before restart
Is it possible to configure Android 8 to ask for confirmation before powerdown/restart? Is that option manufacturer dependant?

isn't the selection screen for shutdown/reboot itself already confirmation dialog enough for you? just tap on back (or any area outside the popup) and the dialog dissappeares

Android does not offer this feature by itself (barring restart confirmation after applying system update).

It is possible that OEM customized ROMs or custom ROMs provide this feature. If you're device is rooted, it is possible - one way I am aware of is using GravityBox Xposed module


text:
How to know the address of the dns server I m using?
Simple question but I couldn t find the answer anywhere. It is not part of ip informations and the information is not trivial when being connected to the Internet over lte.
getprop | grep dns is returning nothing.

Check in dumpsys connectivity or dumpsys netd. Se details here: https://android.stackexchange.com/a/205740/218526

busybox nslookup www.google.com if you have it

@alecxs you re confusing with Windows. It doesn t tell about the current nameserver.


text:
Do all apps lose state when the phone is locked?
I use Rune for music. It takes Rune a bit of time to find its controller on the network. If, after starting some music playing, I then lock the phone, when I come back Rune starts all over to locate its controller. I had a similar experience with Sony's 'imaging edge' app for remote-controlling my camera. As soon the phone locked, I had to go through the elaborate connection process all over again.
Is there any way to change this behavior?

An app loses it's state if it is killed. This can happen if the Android OS is running out of RAM or on some devices this may also happen by a very aggressive battery saving feature.

There's no shortage of memory. On my moto g7, perhaps I've made an bad setting choice for battery saving.

https://dontkillmyapp.com


text:
Android SD card encryption
I was looking at some encryption standards and was wondering, what kind of encryption algorithm does Android's SD card encryption use? Is it AES 128 or a different algorithm?

Android uses adoptable storage to encrypt SD card. AES-XTS-256 to encrypt files and AES-CBC-CTR-256 to encrypt filenames.

Thanks! I thought that it would use AES 128 due to performance limitations.


text:
I want to download torrent files to a fashdrive attached to modem or router (local server ) by initiating the download from the mobile device
I want to download torrent files from my mobile but since I don't have enough storage I want the files to be downloaded to my local server (the flashdrive/pendrive attached to my modem which can be accessed wirelessly), Is there a way to do this?
I don't want my laptop running continuously for downloading torrent files, instead I would like to use my mobile phone but the problem is that I have very limited storage in my android device. Is there a way to download to a remote Pendrive or storage device attached to my modem or router?
Thanks in advance.

I don't think that a Bittorrent app exists that can work the way you want. In my opinion you should better get yourself a Raspberry Pi or a similar tiny computer. Those devices require very little power and can be configured very flexible if you are willing to learn Linux. The chance is high that there is already a Bittorrent client for Linux that can be controlled using an Android app.


text:
What's the best way to protect my rooted Android 7 from malware and hacking?
Considering I have to use cellular data and being not connected to the internet is not an option, what measures can I take or tools I can use to keep myself protected from prying eyes?
My first step will be to do a clean rom flash in case I'm infected already, but as soon as I do that, I'd like to ensure that I remain clean and protected because I would be using my phone for very private data. What can I do? Besides the obvious and common sense stuff of course.
Android 7 | Rooted | Moto C Plus

Your question is difficult to answer in general because using a known to be insecure device is always a risk. How large the risk is and how to reduce it depends on how you use the device and what apps and use cases are the minimal set you don't want to miss.

Questions like this are sort of open-ended, in the sense that there is no definitive answer out there. Everyone can suggest this or that thing and claim theirs is the best way. They might not even bother to demonstrate how their solution improves upon existing ones. How would you evaluate them then?


text:
ADB wireless :- problem with IP
I use adb wireless tcpip connection but every time I connect my device to my router it assigns a new IP address to my android device which requires me to plug my phone again and restart adb in tcpip with the IP address provided, I dont want this to happen every time, I just want to enter the same IP address and put adb connect <ipaddress>:<tcpip_port> and connect to my device.
i tried to use static IP for the network using the mobile but due to some reason this restricted me to use  internet(it was connected to the modem but not able to use internet).
More info:
Android 10
MIUI 12
redmi note 7s
i use scrcpy and have created a bat file(.cmd file) which when clicked runs a series of commands to connect to my phone wirelessly using adb and mirror the screen and control it remotely but because my router assigns a different IP ever time i connect my phone i have to edit the bat file.
Even if I type the commands manually without connecting the device with USB cable (adb connect <ipaddress>:<tcpip_port>) it says: unable to connect to <ip addr>:5555: cannot connect to <ip addr>:5555: No connection could be made because the target machine actively refused it. (10061) , then i have to connect it with USB cable and again start the adb in tcpip.
What is the use of adb wireless connection if I have to connect it to pc by USB every time (at the beggining) to make it wireless for that specific time.

This can be a device and/or a router problem. Check the MAC address shown for the phone in the router web UI. If it changes then MAC address randomization is implemented wrong in your device. If not make sure to enable the option to assign always the same IP to the device via DHCP. This option is available in normal routers.

hostname is whatever name your residential gateway has assigned to your phone ip address (line 3). you can find it in router settings or from nslookup

IP address is not the problem here. reason is your phone is unrooted therefore the wireless app is unable to start adbd. so you have to plug in usb cable each time and switch to wireless regardless of IP address. This is fixed in android 11
however, regarding your IP issue you can use hostname instead (it is hard-coded here in %device%)

@echo off
setlocal enabledelayedexpansion

set device=android-6cf1b33d5e54da8d

for /F "delims=[] tokens=2" %%f in ('ping -n 1 -w 1000 -4 !device!') do (
  set client=%%f
  echo %%f | findstr /r /c:"\<[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\>" > NUL 2>&1 && goto connect
)
echo !device! device not found
pause
goto end
:connect
adb connect !client!:5555
scrcpy -s !client!:5555
:end

Thanks for the replay, but I'm new to batch scripting, can you please explain me the substitutions I have to make in the above code.(How do I get my device id  and little more about the code please)

https://stackoverflow.com/q/2613826 https://stackoverflow.com/q/5898763


text:
How does Samsung store pictures marked as favourite in the Gallery app?
I had marked a number of pictures as favourite on Samsung S10 Plus, I then renamed the DCIM folder to 2021_Backup (I had backed up my pictures onto a hardrive). After this I could not see any pictures in the favourites folder. I am assuming Samsung stored the list of all favourites somehwere and had a pointer to the actual image. Once I changed the folder named it lost that pointer and could not show those pictues. I have renames the fodler back to DCIM and that hasn't helped either. Something else is missing. Again, I am guessing the DCIM file got a different internal filename when I renamed it or something.
Any ideas on how I can get those favourites. I had spent a while marking them.

Your Gallery app might have identified the images, not directly, but via MediaStore. Mediastore is an indexed collection of some file types. Once you renamed the directory, MediaStore most likely reindexed all the files in it, so index number changed. Then, when you renamed back, index number must have changed again. These index numbers would always differ from the numbers your Gallery app used to identify, access and mark your images as favorites. Since files at such index numbers don't exist, your Gallery app can't show you favorites. That's my guess.

Goign back IMO is a lost cause. Your app would probably be having favorites entry in a database with files identified by mediastore provided indexes. You can verify this by looking the private and public app data directory of your Gallery app. You would need root access though. I don't have a Samsung device or I would have confirmed this already. BTW, are you using default gallery app or a third party gallery app?


text:
Prevent user from installing any applications
I have Galaxy J1 smartphone with OneUI and I have to prohibit installing any applications on it. I tried disabling appropriate activity in PackageInstaller, but that can be bypassed with Factory Reset in settings. Installing any AppLock applications does not help, because then can be easily removed by just booting into "Safe Mode". Is there a way I can achieve my goal?

Disable app installation is the job of an Mobile Device Management (MDM) system. However factory reset is always possible.

What MDM system can I use at home for free (I need it for single device)?


text:
Does software update decrease device performance?
I’ve been using an Android tablet for a month, and I’ve just got a notification on an update for my tab for Android 11 or One UI 3 (not sure if they mean the same thing). I’m on Android 10.
Based on my experience in using iOS devices, every major update decreases my older device’s performance and battery life for some reason. I’m used to seeing updates as something to avoid.
Do software updates have any bad effects on an Android device’s performance/battery life?

Apps tend to grow because of new features, new bug fixes for certain devices or Android versions. Larger apps have more code to execute, and require more RAM.


text:
(ROOTED PHONE) Using WiFi and LTE Simultaneously
I have a rooted Google Pixel 4a and an IoT device which I connect to over WiFi. This WiFi network does not have internet connectivity and simply serves as a way to control the IoT device. I have a termux process (it is run within an Ubuntu chroot jail) with which I want to be able to get information from the IoT device (over WiFi) and then POST it to a server (over LTE). I have tried so hard to get this to work. I'm fairly sure this should be possible with root access but I've exhausted my options at this point. Here's what I've tried:

Connecting to WiFi normally. Doesn't work because even though Android knows the WiFi has no connectivity, it still attempts to connect through it. To be clear, I have mobile data always on and I'm able to ping through LTE interfaces while connected to my IoT WiFi. It baffles me why Android doesn't direct traffic to LTE for non local IPs when it knows WiFi is down. This functionality should come out of the box in my opinion.

Changing the routing tables. This doesn't work since the LTE interface being used tends to change names at seemingly random times so the entries must be kept up to date. I can't seem to bind processes to interfaces from the command line either (but you can from the ConnectivityManager), as far as I'm aware. This is the disadvantage of circumventing the system commands for these things and directly modifying them. I am not notified of any changes or any other things going on and stuff simply stops working.

Assigning my IoT network a static IP with no gateway. This works on Apple phones but not on Android. It still attempts to access the network through the WiFi even with a 0.0.0.0 gateway.

Bypassing the GUI WiFi connection system to try to connect to WiFi from the terminal. This involves turning WiFi off, then using iwconfig to link it to the right network so Android still thinks it's in LTE only mode. Doesn't work because wlan0 interface doesn't permit this action on Android, even with sudo (couldn't figure out how to give myself permission to do so).

[PENDING] I'm trying to see if I can build a wrapper app that runs this process from inside it. Then, using the ConnectivityManager, I can bind the process to use the LTE interface. Then, I run a second process which is piped into the first which handles all communication with the IoT device, and I bind it to use WiFi. I'm not sure whether this strategy works but it seems very hacky. Also, I'd prefer a more elegant solution.

Looking at the Android source to find out how ConnectivityManager's bind process to network interface works and if there is an equivalent instruction for the command line. I have not found anything yet.

If any of you has insight on new strategies or has suggestions on how to fix my approaches to any of the above, let me know! Thanks in advance for your help!


text:
How to turn off the vibration, which happens when phone call is connected or the camera is turned on?
I've seemed to turn off all the vibration settings, including settings for camera application, but it keep vibrating when I turn my camera on (by pressing side button twice), the same happens when I call someone and they answer the call.

Android 10
Phone: King Kong Mini 2
I use Microsoft Launcher.


text:
How to install recovery image with fastboot? (Asus zenfone go 5.5 zb551kl)
I have an old phone "Asus Zenfone go TV zb551kl" and I am trying to fix it so I can give it to my nephew. It had a problem where the only thing that it can load is the "fastboot". And, it says "Invalid boot image!!" whenever I boot recovery or normal boot. I just want to install the stock recovery image so I can re-install the stock ROM.
I'm just wondering if someone can help me with my problem.

Does this answer your question? Bootloop issue and can't go to recovery mode


text:
How to get back media if media not restored during restoring without affecting recent chats and media?
So I backed up my whatsapp a month ago and then while restoring I was not able to find a wifi source so it just stopped restoring media, only the chats were restored. Now after a month use I have more chats and some media, what do I do to bring back all the older media and keep all the latest chats and media?


text:
Is it possible for an Android alarm clock app to not turn on the screen when it rings?
Recently, I asked this question requesting recommendations for an Android alarm clock that does not turn on the screen when it rings on Software Recommendations StackExchange.
The reason I do not want the screen to come on while the alarm is ringing is because I want to reduce battery drain while the alarm is ringing.
I have yet to receive any responses, and I'm still searching for such an app.  That got me wondering: Is it even possible for an Android alarm clock app to not turn on the screen when it rings?

Definitely possible the app decides if just a tune is played or other actions are taken. My favorite Teatimer works this way. You may need to change some config settings.

@Robert Thanks Robert.  I'm looking at Teatimer now to see if it can also work as an alarm clock.  How can one tell if it is actually leaving the screen off vs. displaying all black pixels?

@Robert I might have figured out a method to determine if the screen is just filled with black pixels or is actually in standby (which I'm not sure if that's the same as screen off... do you know?).  Many Android devices have an LED that will illuminate when the device is charging and is in standby.  From what I can tell, that LED is not illuminated when the device is charging and not in standby.  So that LED may be a good indicator.  I'm not sure if this technique works in all cases though.

@Robert I tested the Teatimer app you recommended, and the LED I mentioned stays illuminated when the timer sounds, so if my test is accurate, then it looks like the screen is truly off.  (Curious if you know of another test.)

Are you talking about the notification LED? That LED is just an LED without any connection to the screen. It can be addressed by any app if I remember correctly via the notification system. In any way you can also disable blinking in timer settings.

@Robert Yes, the notification LED.  In this case, I'm just using it as a possible technique to see if the screen is really off or just filled with black pixels.  Do you know of a better way?

As I said the LED has nothing to do with the screen. And why would someone show a black screen? I am not sure if this is possible at all if the device is locked. I would check logcat for screen events.

@Robert To answer your question, see https://github.com/JonasBernard/FakeStandby


text:
USB Camera for Google Duo in Philips Android TV
I have a Philips 49pus7503 Android TV. As you know, Google allows Duo calls on Android TV at late 2020. As I read in Google Duo in Android TV article from Google, it says that "Simply connect USB camera to TV, after that you can use this camera with microphone also.". I connect my old Logitech C270 camera, however Duo cannot find the camera. How can I do ? Thanks.

Looking at the Philips 49pus7503 manual online I don't see any mention of supporting a USB webcam.
And sadly, the Android Compatibility Definition Document gives device manufacturers the option of not supporting:

7.5.3. External Camera
MAY include support for an external camera that is not necessarily always connected.


text:
Can you connect to multiple vpns at the same time on android 11?
I have an always on VPN connection for security and privacy. I would like to connect to my home vpn for Music Player Deamon access. I would not like to announce my home IP to every WiFi I use. Can I and how to multi hop VPN on android 11, also second hop is conditional as I only want traffic for my system. I do not have root.

Does this answer your question? How to connect to multiple VPN in android

Not possible without root. With root you need to do manual configuration which requires at least basic familiarity with CLI.


text:
Internal storage shows is mounted twice on a Pixel 4a
I have a rooted Pixel 4a on LineageOS 18. For some reason, whenever I plug my phone into my PC for file transfers I am seeing two internal storage drives being mounted. The Pixel 4a doesn't support SD cards, it's all internal storage. How do I make it show just 1 internal storage drive?

Check the device manager if the device is there also seen twice. Change the device manager view to "Devices by connection" to see related USB devices together.


text:
Sharing Apps between Accounts (due to user age)
Good Morning Everyone,
Before I ask the question about sharing apps between Android users, I wanted to quantify the use case. This is because I don't want to come across as trying to illegally distribute apps in any way.
We have a tablet in the house that was specifically purchased as my child has a learning development disability. That means I have purchased a lot of apps from the Play Store to find things that were to help this. In the past it was easy; they were not adept enough to work out how to buy things on tablets. Now she is older and wiser, as is their sibling. Both are still single digit in age.
So the tablet is a Samsung Galaxy Tab A6, running Android 8.1 - stock updates, no root, no modifications.
In the past, when multi-user first appeared, I was able to buy apps from my Play Store, and it would appear on her non-admin user. I understand that this is now not possible though, and certainly I have not been able to achieve this with anything I have downloaded in recent memory.
The problem is though that both children are still under 10, so can not have their own Play Store account to have a Family set up.
So is there anyway to get around this? preferably without rooting the tablet? I am quite happy to wipe their account from the tablet if that helps things.

Copying apk from admin to other users is doable, so is their installation. But I don't actually know how this "share" feature you  are talking about used to work. Did it involve sharing not just the app but also its data (that is, whatever you did in the app using admin account was visible to child user)? Another issue is licensing check.Two accounts one license may not work for some apps,depending upon what license  verification  parameters are used by an app.

I will be honest and say "I can't remember either." I am sure it was just in Settings when multi-user came in, with a list of apps you could expose to all users. Apparently Google has a Family management option for under 13s but it looks like I also have to share my payment method with them.


text:
Looking for LineageOS 17.1 download link for vivalto3gvn (Samsung Galaxy V/Ace NXT/Trend Neo)
According to stats.lineageos.org, the Samsung model codename vivalto3gn has OS versions of 13.0, 15.1 and 17.1. I did a little more searching, but I couldn't find download links for 15.1 and 17.1. The latest version I can find is 14.1 from this website. Do these versions really exist or are they caused by reporting errors?

Your device was never supported by LineageOS officially. The old 14.1 version seems to be an unofficial version which means that typically one developer who owns the phone implemented the necessary changes for making LineageOS work on your device, but if those changes were ever published is unknown.
Why there are no newer versions is unclear, may be the device hardware was too restricted (it has only 512MB RAM which is way too small for modern Android versions) or the developer who created the 14.1 version got a new device and lost interest in developing new versions for the old device.
In the end you have to take it as it is, there is one 14.1 version for your device but nothing newer.


text:
Where app drops sdk version info
Long story short i used appcloner to spoof android SDK version to lower to get messenger chat heads as they were on android 10 and lower. I copied the installed app, so now i got .apk with all that info and when i install it from that file it still works. App must dropped info about android SDK into it's files, but i cannot find where. Does anyone could help me with that?
My goal is to inject this file into original messenger apk so that i could update this app from official messenger .apk

Hi, it seems you're accidentally creating a new account. Please refer to how to merge your accounts so that you can regain ownership of the question and post comments on any post under your question. Thanks.

If an app behaves differently on a higher or lower Android version, then it uses code like that (before the app has been compiled):
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M){
    // do something on Android 6+
} else {
    // do something on Android before version 6
}

Such code structures will be present in multiple classes of the app. If you want to forge the Android version in the original app you have to decompile the APK using apktool modify every occurrence of such a structure e.g. by replacing the access to android.os.Build.VERSION.SDK_INT which queries the device's Android ADK version and replace it by a constant like 29 for Android 10 and the rebuild the APK using apktool, zipalign and sign (apksigner) it and then you are ready to install the app.
Unfortunately apktool does only generate Smali code and not Java code, which makes the whole task much more difficult as Smali is very low level and not easy to read.
There may be existing programs/apps that already do such modifications in an automated way, unfortunately I don't know or use such apps.

Thing is that I managed to fool app thinking that it runs on Android 10, and copying whole installed app to another device works as well, so this info should be somewhere in files that it runs on Android 10. The goal is to copy this file and inject it into stock messenger app

@Kamkol You wrote you used appcloner (whatever that is you forgot to provide a link in your question) for that. If the app does not actually clone the app but just runs the app in a different context it is possible to forge the runtime information in memory. As I wrote the info of the current Android version is not in the app but in the process itself at run-time.


text:
Show remote android emulator window in local
Hi I've configured Android development environment in a remote dedicated server running Ubuntu 20.04 with the help of the tutorial https://proandroiddev.com/how-to-setup-android-sdk-without-android-studio-6d60d0f2812a.
Installed related tools by sdkmanager --install platform-tools emulator "build-tools;30.0.3" "platforms;android-30" "extras;android;m2repository" "extras;google;m2repository" "system-images;android-30;google_apis;x86_64" "system-images;android-30;google_apis_playstore;x86_64" "patcher;v4"
Created the avd by avdmanager --verbose create avd --force --name "generic_30" --package "system-images;android-30;google_apis;x86_64" --tag "google_apis" --abi "x86_64"
I had to install apt-get install libgl1-mesa-dev libglu1-mesa-dev to run the Android Emulator.
Ran the emulator with emulator -avd generic_30 -noaudio -no-window -no-boot-anim -gpu off -screen touch and it ran with desired output.
emulator: Android emulator version 30.5.5.0 (build_id 7285888) (CL:N/A)
emulator: ERROR: FeatureControlImpl.cpp:269: Feature control already exists in create() call
handleCpuAcceleration: feature check for hvf
emulator: feeding guest with passive gps data, in headless mode
emulator: WARNING: Your AVD has been configured with an in-guest renderer, but the system image does not support guest rendering.Falling back to 'swiftshader_indirect' mode.
cannot add library /home/arnab/.android/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
added library /home/arnab/.android/emulator/lib64/vulkan/libvulkan.so
cannot add library /home/arnab/.android/emulator/lib64/vulkan/libvulkan.so.1: full
emulator: INFO: GrpcServices.cpp:301: Started GRPC server at 127.0.0.1:8554, security: Local
Your emulator is out of date, please update by launching Android Studio:
 - Start Android Studio
 - Select menu "Tools > Android > SDK Manager"
 - Click "SDK Tools" tab
 - Check "Android Emulator" checkbox
 - Click "OK"

emulator: INFO: boot completed
emulator: INFO: boot time 24232 ms
emulator: Increasing screen off timeout, logcat buffer size to 2M.
emulator: Revoking microphone permissions for Google App.

From my Windows 10 machine created SSH tunnel with the command ssh -NL 5554:localhost:5554 -L 5555:localhost:5555 user@xx.xx.xx.xx and connected adb with adb connect 127.0.0.1:5555.
With the command I could see that the device is also connected.
Connected devices & emulators
Searching for devices...
┌───┬─────────────────────────┬──────────┬───────────────────┬────────┬───────────┬─────────────────┐
│ # │ Device Name             │ Platform │ Device Identifier │ Type   │ Status    │ Connection Type │
│ 1 │ sdk_gphone_x86_64_arm64 │ Android  │ 127.0.0.1:5555    │ Device │ Connected │ USB             │
└───┴─────────────────────────┴──────────┴───────────────────┴────────┴───────────┴─────────────────┘

Until this everything has worked as expected (or I think so).
Now my question is how to show the emulator window in my local Windows machine? It's possible I think. At-least this is how SauceLabs or other online mobile test suites may be working. Do you know any solutions as such for this?

What you are asking is just the standard x11 forwarding e.g. via SSH which works with all X11 programs. On Windows side you need an X11 server for displaying the forwarded windows. Alternatively you can install xrdp on the server and use Remote Desktop Client to start a GUI session on the server. Or you can try to use scrcpy via adb connection.

I tried with xrdp first. But it didn't work due to some unknown reason. And the emulator screen always remained black. Also somehow VNC also didn't work for me. I'll surely look into scrcpy.

Did you ever get this sorted?


text:
My galaxy M10s stuck on download mode showing 'error verifying vbmata image'. Samsung galaxy M107f
I had rooted my galaxy m10s with eftsu to fix Imei NG status. then I wiped EFS but no longer started, just stack on samsung logo even if i wipe data. then I locked bootloader in download mode. and now it just keeps on download mode and shows 'error verifying vbmata image' and 'vbmata:no sign info'.
so guys please help me what shall i do?

https://www.xda-developers.com/samloader-download-updates-samsung-galaxy


text:
Login to YouTube app with different Google account w/o gmail access
I can login to YouTube with a different Google account, but this account got saved in setting/ system/ account section, which means whoever get access to the tablet can access my gmail also. Is there anyway just login to YouTube only?

Sorry but Login to an Google account always activates it on your device an thus allows access to all Google services. That is the purpose of a Single-Sign-On system - even if you don't want it to work this way.


text:
How to process live sound output
I'm new to android and new to anything related to soundprocessing.
The thing is, I have a simple deep learning model to eliminate noise (barking dogs, cars, ...). I want to apply (use) it to the sound output on android phone (ex: when I call messenger, the sound comes from my friend have barking, I will turn on my app to get rid of dog barking, I will turn on my app to eliminates dog barking) but I don't know how to do it. I have found an architecture on Windows that shows where my model is located:

On picture display shows both incoming and outgoing sound for a conversation, It adopts the driver and IOCTL protocol to interfere with the transfer of sound from user mode to the kernel and vice versa, is it the same in android? . Can someone tell me how it looks in android or any information, I've seen something here but for a novice like me it's too little information. Thank everybody!

As you already pointed out the diagram is for Windows and thus can't be applied to Android. Furthermore on Android you can't install drivers or system components. Please note that app development and ROM development is considered off-topic here. This community focuses on Android (power) users, not developers.

@Robert Thank you so much


text:
How to remove the persistent 'Mobile data turned off' message on Android 7.0?
When I turn cell data off on a Samsung Android 7.0 non-rooted phone, the Phone app always displays a notification that data is turned off.  This results in 2 issues:

The notification area gets cluttered with too many notifications.
The Phone app icon notification badge in the launcher always shows at least 1 notification.  This is an issue because it is supposed to indicate how many phone calls have been missed.  Sometimes the device has cell data turned off, and sometimes it has it turned on; thus, there is no consistency with the meaning of that important icon's notification badge.

The notification is persistent, and cannot simply be swiped away.
Is there a way to resolve these issues that are caused by the persistent unwanted 'Mobile data turned off' notification?

Related question for an older version of Android (Android Marshmallow) with a different device manufacturer: Block "Mobile Data Turned Off" Notification


text:
Recover data from Samsung Galaxy A40 after factory reset
I’m trying to recover data (especially the contacts and photos) from a Samsung Galaxy A40 that was recently factory reset. Syncing data to the Google account was disabled, so that route wasn’t successful.
I tried to get an image of the internal flash. However, with adb shell, I can’t access /dev/block/mmcblk0 because of missing permissions.
I didn’t find anything particular helpful in the stock recovery. Running a custom recovery seems to require unlocking the bootloader. However that potentially opens security holes. Will that further wipe the data?
Do you have any other ideas how to recover the contacts and photos from the device?

Are you aware that recent Android devices are by default encrypted and a factory rest usually erases the used key? Thus even if you would manage to read the flash block device you will find just undecryptable garbage.

after factory reset there is nothing to recover anymore, you can therefore safely unlock bootloader now (if you still want)


text:
How to determine which app or service is frequently writing to storage and causing lagging?
When I turn on the screen on a sleeping (but not powered off) high-end Samsung Android 7 Nougat device, the device is often very unresponsive (lagging) for 20-200 seconds.
Using the excellent Simple System Monitor (SSM), I can see that it's not a CPU or RAM issue.  There also is only minimal network activity during this time.  The issue appears to be something writing to internal storage.  In all the SSM graphs, it's the only graph that shows a high level of activity during the unresponsive period.
How can I determine which process is performing all that writing to internal storage ?  The device is not rooted, nor does it have external storage.

I don't think non-rooted Android would get you anywhere. See https://android.stackexchange.com/q/214229/96277

I/O overhead is usually not the reason of lagging on devices using flash storage. On Android devices it's mostly a bug in the display HAL or the foreground app (be it a user app or the OS itself; the SystemUI app) which blocks the main UI thread. Logcat can be more helpful in this case. Otherwise tracing apps activities isn't possible without root as Firelord mentioned.

@IrfanLatif Thanks. I notice it the most if I launch Google Play store shortly after turning on the device.  Any tips to resolve that particular issue (besides never use Google Play apps... which is tempting!)?

As I said, logcat is the first thing you should see to figure out what's going on in the background when the UI hangs. That may lead to a conclusion, and possibly the solution.

@IrfanLatif Thanks... I'll capture some logs and take a look.  Do you have a favorite logcat app?  I haven't needed to logcat in so long that I can't recall what I previously used.

No sorry. I never used an app to get logcat.


text:
WhatsApp overrides do not disturb
Android 7. A contact accidentally initiated a video call at 04.58 and my phone briefly let out a notification ( brief as I'd guess she presumably killed the call pronto?). I've just double checked and Do not disturb is set to prevent all apps' notifications at night, including WhatsApp.
Any ideas as to what happened? How I can prevent this again?

Are calls permitted as an exception?

There doesn't seem to be a setting for that, at least not one that I can find. The caller is not on my exceptions list and notifications/WhatsApp doesn't go any more detailed than "override do not disturb", which is set to off.

i guess your device was on deep sleep until call woke it up, then device started to realize it's night time now and instructed WhatsApp to shut up immediately, but it was already too late ;)

I wondered if that was feasible: That seems to be a reasonable assumption.  Somewhat defeats the DND, but I suppose at least it did kick in. After we were woken up..m

exclude the clock from battery optimizing maybe it helps


text:
Recover OPPO A9 2020 (Android 10) from forgotten PIN(6 digits => 1000000 probability)
I have tried more tools to recover oppo A9 2020 (Model CPH1937; patch: oct,2020; Android Version: Android 10; ColorOs Version: 7) from the forgotten PIN. I'm using Snapdragon 665 device. Since I couldn't get FRP unlocking tool, I have tried to wipe device or atleast reset /data to recover OPPO A9 2020. In anyway (either wiping or recovering) how can i recover by tools without BOX?.
I recognished, EDL mode is the only way to recover phone from PIN.
Tried ways,

Tried to build brute-force machine.
I know 6 digit PIN protection is not big deal to predict the right PIN among 10,00,000 numbers. (10 lack numbers from 000000 to 999999).

 Enter PIN
  ......
   1 2 3       // This is the structure and prediction rate for any single try (1/1000000)100 => (probability100)%
   4 5 6       // If Android accept keyboard even from lock screen it will be possible.
   7 8 9       // 8279 programmable keyboard or 8051 controller will be the brute-force machine.
     0      // I recognished using emergency call type *#899# (Works in Oppo A9 2020) -> manual test -> last title panel (on topbar) write/read log -> It will asks for PIN (safest way to try PINs it won't show timer after certain attempts you can try infinite times using programmable keyboard). note: It won't Erase your data and applications. You don't need to spend more internet packs, It is the best method to find old "PIN". You can unlock your phone with this. Not best for password, I don't know about pattern .
I'm 100% sure, It will work. "If your android can recognize keyboard in lock screen and if has secret log write option"
chip not available in my district shops. But available in online shopping(use trusted shopping sites). The dare is, I don't have mobile to use mobile banking now to work with above option.

Wipe mobile via Google account phone recovery (find my device),

=> Mobile internet and location service both were turned on but google find my device didn't detect mobile after phone locked.

Used MSM Download tool to recover device (Stock ROM + setup file = 6.5Gb).

=> Mobile didn't responds to windows after 15 seconds of EDL mode. Prompts(log, message or whatever) to restart device(every time after 15 seconds).

Asked(via call) oppo store to help.

=> Oppo store not present in my district to go :-(.

Given to service center,

=> Again refered OPPO Store :-(.

Used QFil (Python and linux) it seems to be work.

=> There is no clear command list for repartitioning using .img file. How to use QFil?
=> Signature verification failed even for Stock ROM. notable: I don't even tried to flash custom ROM and OPPO A9 2020 has almost all feature ie. Dolby, HIGH performance mode(Game Boost), floating window apps(*supported Apps), Dark Mode, Custom snapshot, OPPO secure storage(CHIP level encryption), Recovery Mode Encryption(This is why I can't wipe my device via Recovery :-(. ),...etc.

Used QFil(Prebuild GUI Application) in windows.

=> Sahara protocol Error => Read 0 bit header in Rx (Fixes more annoying and not available).
=> Respose timeout

**Used QDL tool for linux from these channels,

Via snap package manager
Via Official git source code repository
Prebuild download**

=> Starts to work (from the debug log). But not writing (and still stuck there before writing into port(ttyUSB0))
qdl --storage ufs --include path/to/image/ prog_firehose_ddr_ufs.elf rawprogram0_ufs.xml patch0_ufs.xml

To point snap,
/snap/bin/qdl --storage ufs --include path/to/image/ prog_firehose_ddr_ufs.elf rawprogram0_ufs.xml patch0_ufs.xml

To point current(git cloned directory) working directory("."),
./qdl --storage ufs --include path/to/image/ prog_firehose_ddr_ufs.elf rawprogram0_ufs.xml patch0_ufs.xml

After the installation of prebuild(downloaded) from internet,
$ which qdl
/usr/bin/qdl  <= pointing 'make install'/apt/dpkg/yum/pacman/... installation
$ qdl --storage ufs --include path/to/image/ prog_firehose_ddr_ufs.elf rawprogram0_ufs.xml patch0_ufs.xml

Result does not have any error and stucks after displaying details about device(ventor id, product id, device id, ...etc).

Tried EDL tool(edl.py) available with QFil(Python, [used Linux] CLI no-GUI),

Used following command to format userdata partition,
$ python edl.py --debug --memory ufs --loader ../extracted/prog_firehose_ddr_ufs.elf r userdata userdata.img

The error result was,
No such volume named 'userdata'

***I'm proved to have such secure device(Just lol).
How to remove PIN in mobile with/without wiping whole data?.
If can, How to unlock using FRP method?.
Any methods available without opening device body and without Box?.
Any kind of suggestion, which you can give?.***
I only used these commands in these(above) tools, If you know tool usage or methods or new tools please kindly share to help people and for me too.

the bruteforce part is nonsense, there is a timeout (30 sec) after 10 attempts, increases after 30 attempts up to 1 day from 140 attempts on. but EDL mode is good choice, you should be able to wipe data and frp, all you need is oppo signed firehose programmer for sdm665

@alecxs Thanks, Yeah I know, Also I could not recognize that till opening engineer mode(on OPPO A9 2020). So I'm keep trying since yesterday But it seems to be night mare. It didn't make time delay even after too many attempts only when you are in engineer mode. I have highlighted This above -> *I recognished using emergency call type #899# (Works in Oppo A9 2020) -> manual test -> last title panel (on topbar) write/read log -> It will asks for PIN (safest way to try PINs it won't show timer after certain attempts you can try infinite times using programmable keyboard)

@alecxs I could not get correct sdm665 for oppo. Stock ROM's signature is not working. Does other(OPPO) ROM's signature will work?. Where i can download (without bricking) it?. Thanks in advance.

the qualcomm factory loader (firehose programmer) is independent from ROM, so yes any sdm665 loader will work as long as it is for Oppo (or Realme) device

gatekeeper is limiting timeout on lower level (TEE) so attempts will (silently) fail with(out) warning no matter what mode you try

Thanks @alecxs I will try it. Then let you result.

search for collections like
romprovider.com,
firmware27.com,
leakite.com,
github.com,
tuserhp.com,
firmwarego.com

not sure if that is of any help (haven't downloaded don't know what it is) https://gulzarsps.blogspot.com/2020/05/oppo-a9-2020-cph1937-ufs-full-dump.html

That's(https://gulzarsps.blogspot.com/2020/05) other ROM with changed name :-/. I could not find correct prog firehose UFS for smartdragon 665. latest Qualcomm chips uses dual hash encryption on from qualcomm and another hash signature from Manufacturer(OPPO).

Hi, i think the easiest and the most convenient way would be to pay somebody who has access to the care tools of Oppo. They can flash the device in 5 minutes and you'll be good to go again.


text:
Accessing a phone after factory resetting it with adb
I have a smartphone running Android 6.0.1. The screen is broken and unresponsive so I control the phone using adb and scrcpy, but to run adb I had to turn on "USB debugging" from "Developer options". I want to know that whether after factory resetting(using adb) will I still be able to access the phone with adb? Since the "USB debugging" option would get turned off after a factory reset, would I still be able to access the phone using adb?

i think you gave the answer in your question already. what you can do is permantly enable adb (and disable the RSA authorization) by flashing modified boot or system, that will survive factory reset. depending on device there are several flash methods. unlocked bootloader is required for flashing via fastboot, therefore the more important you should enable OEM unlocking in developer options (if available) as long as you still have access via scrcpy

https://android.stackexchange.com/q/213116

You won't have USB debugguing after a factory reset.
Perhaps you could tweak a custom rom to do so, i never tryed myself, but ie TWRP recovery have adb enabled by default.


text:
Where does your Samsung phone store its default ringtones?
So my grandma gave me a Samsung Galaxy J2 Prime from 2017, and it doesn't have any SD card inserted. So where does my phone store its defalt ringtones and notification sounds? I tried going to Android>data>system>media>audio>ringtones but it seems it doesn't have the system folder. Can someboy help me with this?

what you are looking for is on system partition. what you see is actually just the content of emulated sdcard on userdata partition. enable usb-debugging and type 'adb shell ls /system/media/audio/ringtones' in terminal
https://www.xda-developers.com/google-releases-separate-adb-and-fastboot-binary-downloads

@alecxs I came to post the same path. Post your comment as an answer and I will upvote it.

@ReddyLutonadio solid answer should include how to access/copy ringtones, where to add custom ringtones and which format (ogg, mp3) on unrooted device. we have lot information already but do you know canonical location?
How to extract default ringtones from Android device? //
List of special Android SD card folders? //
Android Folder Hierarchy //
What is /storage/emulated/0/?

@alecxs "do you know canonical location?" No, I don't. However, I have checked a Samsung and a non-Sansung phones; Both have the sounds located on /system/media/audio/ with these 3 sub-folders being common: notifications, ringtones and ui. The non-Samsung phone also add a sub-folder alarms. All of them contain files with ogg format only. Does/do your phone(s) have different formats?


text:
What URL can I hit to initiate call?
I'd like to be able to hit a URL with CURL from my laptop, and have it cause my android phone to initiate a phone call, on speakerphone if possible.
I'm using a Linux laptop with Firefox browser, and I have tel: links set to run a bash script.
I'd like my script to send a GET/POST to some google cloud API which subsequently sends a command from the cloud to my phone that causes my phone to initiate a phone call hands-free to a number I send in the GET/POST.
I will use this to make tel links clickable in my laptop's browser.  Browsing on android sucks.  Calling from a "hangouts tab" in the laptop sucks.  Combining in this way will avoid the most things that suck, which is my new years resolution.
I may also use this to automate calls to appointments/meetings that I need to attend.  i.e. at the correct time, my phone simply auto-joins whatever zoom meeting, without me having to remember it.  Bonus points if this API can also, optionally begin the call on mute.

Chrome browser supports this natively. Otherwise, I don't think there's network-based API to initiate a call on stock Android (without 3rd-party apps/API).

So.  Chrome browser doesn't use a network-based API to do this?  Must be sorcery I guess.  That aside, changing the browser I use every day, have for years, and depend on, doesn't solve this even if that path of destruction wasn't important.  It doesn't address scheduled call initiations, which I could trivially put in a cron job with an API.

Looks like it uses their internal push notification service between Chrome desktop to Chrome mobile.


text:
Is the fingerprint template generated by the vendor-specific library or the sensor?
My understanding based on the online resources is that there is a vendor-specific fingerprint library running in the TEE which is responsible for communicating to the fingerprint sensor hardware as well as enrollment, matching, ... of fingerprints.
What is unclear to me is what the sensor's output is? Does it generate the fingerprint template, or it sends just the raw fingerprint data to the library and the template is generated by the library?

I would assume that the finger print sensors are pretty dumb and just send the raw data to the TEE. See also https://source.android.com/security/authentication/fingerprint-hal#implementation

Yes I've seen this page, but even this page doesn't say where the template is generated.

best is to follow enroll() in sources down to the rabbit hole, don't you think?

It is not specified, but as only the TEE and the fingerprint driver has access to the raw fingerprint data the template generation has to be performed in one of them (or directly in the fingerprint sensor).


text:
How are AOSP compiled .img stores in phone flash?
There are the contents of a Xiaomi image for some phone that I downloaded. It is a fastboot image. I think that it means that it can be flashed by fastboot.
├── AP
│   ├── APDB_MT6768_S01__W2006
│   └── APDB_MT6768_S01__W2006_ENUM
├── BP
│   ├── DbgInfo_LR12A.R3.MP_HUAQIN_Q0MP1_MT6769_SP_MOLY_LR12A_R3_MP_V98_P75_2020_12_11_16_34_1_ulwctg_n
│   ├── MDDB_InfoCustomAppSrcP_MT6768_S00_MOLY_LR12A_R3_MP_V98_P75_1_ulwctg_n.EDB
│   ├── MDDB.META_MT6768_S00_MOLY_LR12A_R3_MP_V98_P75_1_ulwctg_n.EDB
│   └── MDDB.META.ODB_MT6768_S00_MOLY_LR12A_R3_MP_V98_P75_1_ulwctg_n.XML.GZ
├── BP_IN
├── CheckSum_Gen
├── check_sum.sh
├── flash_all.bat
├── flash_all_except_data_storage.bat
├── flash_all_except_data_storage.sh
├── flash_all_lock.bat
├── flash_all_lock.sh
├── flash_all.sh
├── flash_gen_crc_list.py
├── flash_gen_md5_list.py
├── flash_gen_resparsecount
├── hat_extract.py
├── hat_flash.sh
├── images
│   ├── boot.img
│   ├── cache.img
│   ├── Checksum.ini
│   ├── crclist.txt
│   ├── cust.img
│   ├── dtbo.img
│   ├── exaid.img
│   ├── gsort.img
│   ├── lk.img
│   ├── logo.bin
│   ├── md1img.img
│   ├── MT6768_Android_scatter.txt
│   ├── oem_misc1.img
│   ├── preloader_merlin.bin
│   ├── recovery.img
│   ├── scp.img
│   ├── sparsecrclist.txt
│   ├── spmfw.img
│   ├── sspm.img
│   ├── super.img
│   ├── tee.img
│   ├── userdata.img
│   ├── vbmeta.img
│   ├── vbmeta_system.img
│   └── vbmeta_vendor.img
├── libflashtoolEx.so
├── libflashtool.so
├── libflashtool.v1.so
├── Log
│   └── ADPT_20201218-033445_0.log
├── md5sum.xml
└── misc.txt

I never compiled Android. I'm gonna buy an SSD just for that, but meanwhile I'm trying to understand the output of the AOSP project when I build everything.
I found this: https://stackoverflow.com/questions/65450678/how-is-the-aosp-project-built/65527251#65527251 which explains how some .img are built. For example, this is how system.img is built: system.img
Looking at the structure of the ROM above, I guess the only things produced by AOSP are the .img. I guess the flash_all.sh is an script that flashes all the images to the flash memory.
How are those images stored in the flash memory? How does fastboot knows where to place each .img?
If we look at the flash_all.sh:
fastboot $* flash cache `dirname $0`/images/cache.img
if [ $? -ne 0 ] ; then echo "Flash cache error"; exit 1; fi
fastboot $* flash recovery `dirname $0`/images/recovery.img
if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
fastboot $* flash boot `dirname $0`/images/boot.img
if [ $? -ne 0 ] ; then echo "Flash boot error"; exit 1; fi

it passes a different name for each .img. Maybe there's a 'fastboot server' on the phone that knows where to place each image?

partitions have labels. kernel creates symlinks you can show 'ls -d $(find /dev/block -name by-name)/*' in adb shell. actually the fastboot commands are very basic. preloader decide which boot mode and will execute fastboot program from lk partition (i believe it's already the 3rd state in boot chain) https://www.lieberbiber.de/2015/07/04/mediatek-details-partitions-and-preloader. scatter file is for SP Flash Tool in download mode (not fastboot)

please note that super is actually three partitions in one (system vendor product) and fastboot can not handle this. therefore fastboot is splitted in two stages and the second stage is executed from somewhere different https://source.android.com/devices/bootloader/fastbootd


text:
Exporting a CA certificate from Android to Android?
I'm trying to install an openssl CA certificate on my Pixel 5, previously I was able to install it directly through the app I was using on my old Pixel 2 but with the new security measures this is no longer an option and I'm attempting to take this into my hands.
This is my first time trying to do this on any of my phones.
I got the CA certificate off my computer by downloading the app through an android emulator. The file was originally saved as a .dll file and I just changed the end of the file to a .pfk. I believe it is now in the correct format as it recognized by my phone.
When I go to install the ca certificate I am asked for a password to extract the certificate. I opened the file as a text document and read through it thinking I would be able to find it in there. After reading I thought the password was "callback", but that doesn't seem to work.
Is there some kind of application I can run to retrieve the password?

There is something wrong with your question. A dll files can never be used as pfx file. Only p12 files can be renamed to pfx. May be you should give more details on what certificate (with private key) you want export/import and seven more important for what purpose you need it.


text:
Need help connecting a Pixel 3xl on Android 11 to a Sony ax5000
Wondering if anyone has any troubleshooting tips for my problem. I have a pixel 3 XL that is running up to date android auto and Android.
When attempting to connect my pixel 3xl to my Sony ax5000 head unit, my phone doesn't seem to recognize that it is connected to an android auto cable. I'm fairly confident everything is fine with the head unit and cable, as my wife's phone (a Samsung) and other devices are able to detect and connect to the device without problem using the same and other cables. Because nothing is ever prompted, I don't have any more ideas on how to troubleshoot this issue. Do you have any suggestions?
I went to check the default USB configuration in the developer options and confirmed it is set to File Transfer / Android Auto. Are there other settings there (or anywhere else) I should check?
Thanks!


text:
Files corrupted when moved from internal memory
I've been using an LG Q60 since May. Occasionally spot a few pics and videos that won't play. Assume corrupted.
Updated it to Android 10 last week and since then I can't transfer files from the phone's internal storage to the sd card. All files are corrupted during the move. Compressing files with winrar fails too.
Can anybody advise on a fix?

How to you perform the file operations (what program, command, or whatever)?

I use file manager

The built-in file manager or a third party app from Play Store?

Both the built in and third party apps

guess your MicroSD Card is corrupt. buy new one and try again


text:
How can I transfer tab data from the Chrome App to another phone - including back and forward data?
So my nexus 6p is getting on in years, and I'd like to back up my chrome tabs onto another phone. I'm aware there's a sync function, but that:

Does not cover the back and forward data from each tab, and
Does not seem to go past a few dozen tabs - I have around 1000+ tabs
open.

Is there anything I can do to move or transfer the data, or should I just get to searching through each tab and copy-pasting them? Also, the phone isn't currently rooted from what I recall - I'm willing to try it but I've been told that may be counterproductive and likely wipe the data. Any help would be greatly appreciated!

I would assume the the developers of web browser never imagined that people could use their app this way therefore all the available sync options don't match your requirements. Typically tabs are nothing persistent, they are of temporary nature. BTW: Is a web browser really useful with 1000 tabs open? How do you navigate between them?


text:
ADB - bypass lock screen
I am using Lineageos 17.1 on the FP3 (the phone is not rooted).
I do know my screen pattern code (it is a 6x6 pattern), but I am not able to enter it correctly, because I disabled that the pattern is shown and that the sequence is visible.
In the recovery mode I can enable adb and I tried to delete the file
adb shell rm /data/system/gesture.key

which worked in the past, but now this file does not exist anymore on Lineageos 17.1.
ADB unfortunately does not work when the screen is locked.
Is there another way to bypass the screen pattern? Doing a factory reset is the last option I want to do. Making the pattern visible should be enough in principle.

bad idea anyway because deleting locksettings will destroy encryption (on encrypted devices)

the bootloader is locked, so I guess I have no chance?

I managed to enter the pattern correctly after almost 70 attempts. There it is written enable adb (I think it is a custom recovery from Lineageos), but I do not think it gives me root access. Does that make sense?

I've had success removing a lock screen with the following sequence of commands:
adb shell settings put secure lockscreen.disabled 1
adb shell mv /data/system/locksettings.db /data/system/locksettings.db.old
adb reboot

Following the device restarting, the lock screen should be gone, with the device booting directly to the home screen.

Note settings put secure does not work in recovery mode

In the question it is mentioned that adb does not work and that the device is not rooted (which should be required for your second command).

@Alsch is it working on android 10?


text:
Worried about possible malware
I'm hoping someone can help me here. Yesterday I was doing some research for an essay when I clicked a website (very dumb of me, who never clicks suspicious websites or links) that redirected me. I immediately backed off, the page didn't load. If anything I spent about a second there. Being the paranoid person I am, I have malware bytes installed, scanned, clear. Avast, clear. Sophos warned me about a PUA, which was a .com.google.chrome(some letters) file. Immediately deleted it, but then again Sophos also warned me about another app being a PUA, when it's in fact, safe.
I cleared the google chrome cache. I'd like to note that I DID NOT download anything, I didn't click any links, I didn't click anything but the back button, I didn't give any permissions. I'm on android 10, Xiaomi redmi note 7 (encrypted), and updated to miui12 last night. My phone isn't acting odd or anything.
I'm just extremely worried about being infected. I checked that website on hybrid analysis which came back as malicious (attack method as hooking), virus total said the same, but google safe browsing didn't detect anything, this site was detected as malicious on 2-3 checkers. I was on google chrome at the time.
Should I be concerned?
I don't do banking on my phone as I have a separate apple device for that.
Is there anything else I can do, for peace of mind? Thanks in advance.

no worries android is not vulnerable from malware (except for user granted malicios apps - you would know it if you have installed something). therefore such apps like Avast are useless in my opinion (this is not a broad statement as root kit for mediatek chipset exist, but your device is qualcomm chipset). if you paranoid do a factory reset

in case your device has confirmed malware detection then it's most likely shipped with data mining spy app by manufacturer itself https://www.xda-developers.com/report-android-phones-transmit-data-to-adups-a-chinese-firm

@alecxs Please be careful with such general statements. If an Android device is vulnerable depends on the installed Android version and the patch level (if the device gets security updates and if those updates really patch all known security problems). Also the used app/browser has to be considered. See for example this: https://i.blackhat.com/USA-20/Thursday/us-20-Gong-TiYunZong-An-Exploit-Chain-To-Remotely-Root-Modern-Android-Devices.pdf

@Robert even in such corner cases (like xhelper) i hold on my opinion such antivir apps are completely useless

@alecxs I was talking about your statement no worries android is not vulnerable from malware. This is not true.

@alecxs I totally agree with the mining spy app. I've heard of it. I have a lot of stuff on my phone (pictures and videos, mostly) and it'd take a while to back up. Can you elaborate on why manufacturers do so? I'm trying to find a safe device to buy, but at this point all of them have spy stuff on it.

@robert I have android 10, I updated everything last night (update from the manufacturer). Like I said I didn't download anything, I accidentally clicked on the website and backed out. No downloads were made, I didn't install anything. Just want to make sure my phone is safe to use. It's currently sitting on my desk on airplane mode.

if you have reason to believe that Chrome might have opened up a malicious link and you are unsure whether the link would linger in an existing tab or not, than clearing cache would not work. You have to clear data. 2) unless it is very private, do you think you can tell us on which website's page did you encounter that suspicious link? Full link would be nice. Also, what locale is set on Android? I suppose English.

You have a Redmi phone from Xiaomi and the latter is notorious for installing bloat (really bad ones too) so antivirus apps would naturally find PUAs there. Your Sophos app might be having a history of cleaning. See if you can find it. Tell us the package names there if you see them. You might also want to use a firewall. Whether the device is infected or not, a malware is useless for its author if it cannot connect to internet for command and control (provided it is not meant to sabotage your device -- unlikely) .

Even if you do not click on anything within a website, and even if it does not fully load, you are still downloading content (and often scripts) from that site.  That said, the overwhelming majority of malware is not spread these days by simply visiting a website.  This is especially true if your web browser is up-to-date.  Disabling scripting in the browser can help reduce the attack surface too.  Is it possible to have a problem after just visiting a website?  Yes, but it depends on many variables.  If your browser is updated, is it likely these days?  No.

@Firelord I apologize for my late reply. I cleared data and cache. There is no package name.Yes, English! I ended up asking someone who understands website code. He told me there was nothing wrong with it, it redirected to google. www dot regionseffective dot com. I closed all tabs.

@Firelord can you check the website for me then, please? my browser is up to date and I have android 10. 2 people have told its a safe website. But I'm still anxious about it.

@Randomperson that website simply redirects me to Google search page. Tested on both Android and on a Desktop.

https://android.stackexchange.com/q/233322

@Firelord Am I safe then? My phone isn't acting odd or anything. Just the occasional freeze that has been happening forever. this is what Sophos detected: Sorry, just wanted to share this from sophos - scanner " File '/storage/841B-0819/Download1/.com.google.chrome.TUFofX with threat/App/Other Android generic PUA removed from security assessment. Does this mean anything? I deleted it. I think this was on my SD Card since the Download 1 folder is on it. So was that website safe?

@alecxs great read. I haven't had that problem actually.

My download 1 folder has been on my sd card for years - its not a new thing. I have 2 download folders on purpose. @Firelord


text:
Android runtime permission's internal working?
I was checking Android runtime permissions and was very curious about how Android runtime permissions work. Like if some application is asking for access to external storage, it will ask for permission, user will be presented with a dialog, and after pressing allow button, app will be granted read/write external storage. I just want to know what happens internally when user presses allow button on the dialog, what are the changes internally occur in Android.
I know permissions are stored in different files like /data/system/packages.list, /data/system/packages.xml and /data/system/users/0/runtime-permissions.xml but changing them manually does not effect app's permission preference. So what actually happens when user give permission to certain app, what corresponding file gets updated?

What happens internally when you grant or revoke a permission depends on which permission you are talking about. In case of Storage permission, the Android framework switches mount namespace of the app process. See details in my answer to What is /storage/emulated/0/?. Similarly for some other permissions Android relies on kernel by mapping manifest permissions with DAC UIDs/GIDs/groups. See How Android's permissions mapping with UIDs/GIDs works?.

For many other permissions Android just keeps a record of the permission state in the files you mentioned and later ActivityManagerService enforces them on apps. Manually editing these files doesn't work because these files are cached in Android framework. You can reboot the device immediately to make changes effective. See an example case here: How to grant an app a permission that isn't in its manifest?

Thank you @IrfanLatif for your comments, actually I have read all your answer you have posted here and on XDA. As you said reboot the device immediately to make changes effective, will it work for all permissions, or only permissions which are handled by DAC?

It's not guaranteed that manual changes will always work. If the changes aren't justified (e.g. not requested in manifest or the app not entitled to have that permission), Android may reset them on reboot or when app tries to use that permission. In other cases manual changes should work for all permissions irrespective of whether the permission is handled by Android framework in Java stack itself or by some underlying kernel framework.

I just tried on my phone, disabling storage and microphone permissions from app settings and then changing them manually, with immediate reboot, it worked.

one more question what does flags do in this line <item name="android.permission.RECORD_AUDIO" granted="true" flags="300" />

Android's PackageManager/PermissionManager may attach one or more flags with a permission state for its internal record when simply remembering granted or revoked state isn't enough. E.g. when user taps on "Deny and don't ask again", Android attaches USER_FIXED flag to that permissions so that when the app asks again for the same permission, Android won't show the user the request dialog. 300 is binary number 100101100. Every 1 bit denotes a set flag.

See details here: https://developer.android.com/reference/android/R.attr#protectionLevel and here: https://github.com/aosp-mirror/platform_frameworks_base/blob/android-11.0.0_r1/core/java/android/content/pm/PackageManager.java#L3307

Thank you IrfanLatif.


text:
Android Go - Widget Support
I currently have a Samsung M01 Core running on Android 10 Go Edition. The installed launcher is One UI Home.
This launcher have some predefined widgets but an important one is missing: a clock. Since it's a Go edition phone, Android Widgets downloaded from the Play Store won't work out of the box and you need a custom launcher to use those.
The issue is that custom launchers do not have access to the notification list (the option is missing from the Accessibility settings since it is not supported) therefore they can't display the notification count next to apps which is also critical for me.
Is it possible to somehow force a simple widget (a clock) to appear within the default list of widgets in One UI? If not, is there another solution (maybe enabling notification access) that I can look into?


text:
How to install my developed app into child account in Amazon Fire HD 8 Tablet?
I have developed an Android app in Android Studio (4.1.2) specifically for my two nieces. My brother in law has his account (admin account) and the account of the two girls (managed through parent control) in an Amazon Fire HD 8 Tablet.
I have managed to enable the development options in the account of my brother in law, I have successfully installed the app in the account of my brother in law but now I am stucked at the point on how to transfer the app to the accounts of both of my nieces. I am aware of this question, but in this particular case I am not able to see my developed app in the apps than could be transfered to the chosen child's account. How can I transfer my developed app to the children accounts in the Fire HD 8 Tablet? Is this even possible or does Amazon only allow for certain apps?
Any help is highly appreciated and probably valued with a lot a fun time by the girls :D

I don't know how profiles work in Fire HD, but have you tried this: adb shell pm install --user UID PKG where UID is the user id of the child profile.

Sorry, I have until today never used adb (I just started 3 weeks ago with app development in Android Studio). Is this a good place to start reading on that?

Yes, that's a good place. You can also read the wiki and highly voted and visited questions in our [tag:adb] tag. No need to be sorry. :-)


text:
WhatsApp chat export not working
Exporting WhatsApp chat doesn't work from Android (WhatsApp v2.21.1.16, Android 11).
When exporting a chat, it exports only partially (circa 20MB+/- 3MB). Exporting the same chat from an iPhone works fine.
Any ideas?
Can't wait to be rid of WhatsApp. Telegram all the way.

On Android, WhatsApp has a limitation on how many messages you can export.

When exporting with media, you can send up to 10,000 latest messages. Without media, you can send 40,000 messages. These constraints are due to maximum email sizes.  https://faq.whatsapp.com/android/chats/how-to-save-your-chat-history/?lang=en

You might be successful in transferring your chat to an iDevice or accessing the database of the backup on your computer.


text:
Background ble scan in one plus
We are trying to build an app which scan nearby Bluetooth devices and shows on the UI, we also have event listener which detects whenever location or bluetooth state is changed and accordingly we start the Bluetooth scan, we also make sure no more then 5 bleScan happens within 30 seconds.
Now heres the problem,
This app works fine for phones like Nokia, Asus etc, but for one plus what we have noticed is, whenever we are in background, and we disabled and enabled bluetooth, it dosent start the scan(in the code it reaching but no errors are been thrown) nor it throws error in onScanFailed callback, we didnt see this behavior in other phone
so it dosnet work if the setting is the following

but if we make the location "Allow all the time" , then it works perfectly

My question is who is doing it properly one plus or other phones? Am i missing some additional settings for one plus. please help

Hi while app development is off-topic since Android Enthusiasts focuses on end-users or power-users (but not necessarily developers) solving their issues, I'd assume this is asking for the behavior discrepancy between devices, which is still off-topic. That said, permissions that are related to user's privacy generally become stricter on the newer Android version. What are the Android versions of each device?

Apparently, I had a big typo yesterday... it was supposed to be "still on-topic" and that's why I didn't close the question. So, feel free to post the answer and possibly adding an explanation that is end-user-friendly :)

HI Andrew, Sorry wasnt aware of what we can post here, anyways i have found what the issue was basicaly the one plus which i was using had andriod version 11, and nokia and asus had andriod version 10. In Andriod 10,, and i completly misunderstood the differentce between  "Allow all the time" and "Allow only while using the app",
In Andriod 11, to give background permission , you need to go to App setttings and in permission select "Allow all the time" , because in Android 11, that "allow all the time" settings removed from the location popup

In "Allow only while using the app", calling startBleScan wont actually start the ble scan, n if u are unlucky the failure callback wont return an error also


text:
Google play store available apps whilst on VPN vs native Google Play Store country
I've read a few threads as well as the Google requirements for changing the country in the Google play store. My question doesn't pertain to actually changing countries, it's about how the play store distinguishes the available apps to download.
For example, when using a VPN to the USA(current play store is UK) I am able to download Venmo(which is not available in native UK play store). However I am not able to download HBO GO(which is available in the native USA play store). Why?
I imagine some apps are only available if the native app store is the specific country (where a payment card is required, etc). Are there further aspects aside then IP that PlayStore looks at? Does the app developer play into the requirements?

App developers can restrict not only to countries but also to to mile network provides, certain device(s) and other hardware features of a device. Therefore even if you are able to take the correct country one of the other restrictions may still prevent you from seeing the app.

@Robert gotcha, thanks a bunch

Don't ask for problem. Ask for solution. Try making two accounts add both to a family group and share both with each. That way you pay once and get both apps on both accounts. Thats what i would do. I recommend sharing with nearby share. (offline)


text:
Cannot use LDAC for my Sony headphones
I have a Sony WH-1000XM4 headphone.
On my Android phone I have installed the Sony Headphones application.
On the upper bar of the application I see the audio is sent over to my headphones using AAC.
How can I have it send LDAC?
I have a 2018 smartphone, a Huawei Mate 20 Lite, with Android 10.
Maybe my smartphone is too old for LDAC?

According to Wikipedia LDAC is part of Android since Android 8. But that does not imply that every device now comes with Leap support, this just an easy option for the manufacturer. I would recommend to enable Developer options in settings app, because in this menu there are some options about Bluetooth codecs. If LDAC is mentioned there you may be able to select it as default codec. At least on my Lenovo with Android 9 I can see LDAC there.

The Bluetooth codec option is greyed out in my menu


text:
Can't verify SHA256 fingerprint using apksigner
Just wondering if anyone can help me with the apksigner command line tool. I have just installed 'android-sdk-build-tools r30.0.3-4' on my linux machine and have subsequently tried to run the command 'apksigner verify <appname.apk>' as demonstrated on the following page, under the examples section, https://developer.android.com/studio/command-line/apksigner#usage-verify.
However, when doing so, I get the following output:
/usr/bin/apksigner: line 97: exec: java: not found
Am I missing a specific java package or something? I already have js78 and nodejs installed and updated.
Any help much appreciated :)

apksigner requires an installed Java runtime. What you have is JavaScript. Java is to JavaScript as ham is to hamster. Therefore you need to install a recent Java Runtime (e.g. openjdk-jre-8 or openjdk-jre-11)