text:
What sepolicy context will allow any other context to access it?
I am on a bootloader locked Sprint Samsung Galaxy S7, eng boot.img flashed to phone with SELinux permissive, which gives root adb shell from where I can change system partitions, debloat, install Xposed etc. But the kernel is very bad and has RAM leak, and eventually, the phone slows to a crawl. So I unrooted by installing the stock kernel and disabling DM verity to allow a modified system to boot up.
Now, SELinux is enforcing, but I want it to be permissive which will never happen with the stock kernel. I realize that secontext is defined at kernel build times and allows certain things to run.
Another option is to have a higher context to do things like supolicy --live to patch SELinux policy and get full root access with stock kernel. I'm trying to execute a script in the data directory created by my app, but unless seenforcing=false, it doesn't get executed.
I know by using root you can chcon a file/directory. So what is the (source) context that will allow to:

Set mode to permissive, or
Modify the SELinux policy, or
Execute a script on boot without avc denials

Or what is the (target) context that will allow any other (source) context to execute the script?

ROOT USER AND SELINUX:
User root (with UID 0) is the super user in Discretionary Access Control (DAC) implementation of *NIX operating systems. DAC is allowed by-default i.e. anyone can access anything unless UIDs, GIDs and permission mode restrict something. So root can do anything because it's the kernel's SUPER USER who isn't denied anything.
SELinux is Mandatory Access Control (MAC) which is denied by-default i.e. no one can access anything unless a policy rule is defined to allow the access. So there is no SUPER CONTEXT which is allowed to do anything, whatever the UID is. You have to define a rule to allow any operation you want to perform on your device.
Please note that Access Controls (DAC or MAC) are enforced by kernel at back end, who is the actual operating system.
HOW SELINUX IS ENFORCED ON ANDROID?
SELinux policy rules are defined when building ROM and saved as a binary file /sepolicy (or as split-policy). This policy is loaded by init (the very first process started in kernel's SELinux domain) before starting any services/daemons/processes on boot. Kernel starts with SELinux permissive if built with option SECURITY_SELINUX_DEVELOP=y (which is the default as discussed here and here). After loading policy, init - when still running with kernel's context - sets SELinux enforcing (depending on ROM build type and kernel parameter androidboot.selinux (0)) and then switches to init's own context. From here afterwards, even init isn't allowed by policy to revert back to permissive mode (1, 2). Neither the policy can be modified even by root user (3).
However there is one exception to above said rules. On userdebug or eng builds, u:r:su:s0 - which is the context adb shell gets when adbd is run as root (4) or when /system/xbin/su is executed (5) - is allowed to do anything, including setting SELinux permissive (6).
But on a final production (user) build of ROM, the only way to setenforce 0 or to modify policy is to take control of booting process before SELinux is set enforcing by init. That's what rooting solutions like Magisk do by replacing/patching /init and /sepolicy in RAM disk (boot.img). Magisk runs root processes with context u:r:magisk:s0 which is allowed by patched policy to do anything.
Once you have rights (granted by DAC and MAC) to play with SELinux policy, you can define new SELinux policy rules as explained here.
Coming to your question:

selinux is enforcing but I want it to be permissive which will never happen with stock kernel

No. SELinux is set enforcing by init, not by kernel, except if built with SECURITY_SELINUX_ENFORCING=y option (7).

a higher context to do things like supolicy --live to patch selinux policy

There is no higher context that is allowed to do anything. You can't set mode to permissive and can't patch policy on user builds.

what is the (target) context that will allow any other (source) context to execute the script?

As said, there is no higher source context that can do anything to others. Likewise there is no lower target context that lets others do anything.
Also when executing a script, there isn't necessarily a single target context. Every file that the script uses (binaries, configurations, logs etc.) may have its different context label. And typetransitions can change source contexts too.
If you want to modify policy, you can get all avc denials from kernel log and then define new SELinux rules accordingly:
~# dmesg -w | grep avc:

Solution:
Since you are already on eng build, only replace kernel binary (zImage) in your boot.img if you want to replace kernel. Otherwise you get stuck by using init and sepolicy from boot.img of a user build.
On eng build:

/init doesn't set SELinux enforcing on boot (8)
/sepolicy allows root adb shell to do anything including setenforce and load_policy as explained above

If your kernel is built with SECURITY_SELINUX_ALWAYS_ENFORCE, you can't  set SELinux permissive once set enforcing (9).
RELATED:

What special privileges “/system/xbin/su” does have w.r.t. root access?
How to fix SELinux “avc: denied” errors when launching DNSCrypt as init.d script?


text:
Stuck at boot animation logo after flashing GSI image system
I know it seems be a repeated question but i have tried every possible solution i found, i have xiaomi redmi s2 with unlocked bootloader and custom treble TWRP recovery and i have a generic system image of AOSIP (GSI) downloaded from here AOSiP-9.0-arm_aonly-GSI-20190217.img
and i have followed this tutorial to flash this image How to flash a Generic System Image (GSI) on Project Treble supported devices.
also tried this tutorial How to install AOSP Extended (Android Pie) on Xiaomi Redmi S2 / Y2 YSL
but my device stuck at boot animation and i have waited more than 20 min also i tried these solutions:

wipe data/cache/dalvik-cache.
flash no-verity-opt-encrypt.zip (dm-vertiy patch)
flash magsik.zip to patch the boot.img
reinstall stock boot.img only.
try other GSI like AOSP/PIXEL/ViperOS/HavocOS , also it stuck.
using fastboot instead of recovery.

I cannot figure out what the problem is. any help?

Maybe you forgot to flash miui rom then the gsi files/custom roms (xiaomi miui supported device only).
Method 1 :
Before flashing GSI files using fastboot first goto twrp and wipe data, cache , dalvik cache then flash the Miui rom for your phone after that flash GSI File using fastboot for your device.
Note: after flashing miui ROM don't boot to the os boot directly to the bootloader then flash the gsi file using.
fastboot flash system name-of-your-rom.img

Method 2 :
You can flash miui fastboot rom for your device using fastboot then flash gsi/custom rom
After flashing fastboot miui ROM for your device reboot to bootloader again using
fastboot reboot bootloader

Then flash gsi/custom ROM file using.
fastboot flash system your-system-image-name-here.img

Method 3 :
If you're flashing a custom rom compiled at .zip format you need to wipe system, data, cache partition then flash the miui rom after that flash the custom ROM you want. You don't need to restore your stock boot image when you've installed a custom ROM of course it won't boot and sometimes it does . In some device you need to patch the dm-verity on boot.img if you're installing twrp on a stock rom and flashing magisk doesn't fix your problem.

OP mentioned this link, so it is safe to conclude that he did use Twrp.

I think on xiaomi devices you need to flash miui ROM before the gsi files / custom ROMs.

I have already tried all these methods you are mentioned but  nothing changed

What miui ROM version you installed is it android 8.0+? Because gsi files only work on those android versions.

yes, it is oreo 8.1 with miui 10

All methods are tried and not working maybe booting is just long try waiting

Oh I forgot you need to install the required miui version the developer said before the custom rom installing, did you follow that?

I waited over 30min

What required miui version is ?

Here's an example try reading this https://www.google.com/amp/s/forum.xda-developers.com/redmi-s2/how-to/rom-lineage-os-15-1-project-treble-t3837281/amp/

Should i install the GSI image after flashing the required miui version or make a system wipe first?

After installing miui don't wipe system or it'll be all useless.. Note don't boot to system after flashing miui reboot to bootloader then flash gsi image.

I'm going to try your tutorial and i'll replying after finished.Thank you for help.

You did it, finally booted successfully.Thanks

Your welcome! Why not mark my answer green? It could help me a lot.

source: Stack Exchange

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

sort: votes


text:
Can I connect a Samsung Galaxy A9 by an ethernet cable (no wifi)?
Has any other member been able to do this? I believe that you go to Settings - Developer Options - USB/Internet/Ethernet. If this last option is not there then it will not connect. I must confirm this before I purchase the phone as I need to open the box to check. Thanks.

You can't connect your device to an Ethernet cable, but using the function "USB tethering" there is the possibility to get network access via USB and a connected PC: https://screentimelabs.com/help/connect-to-the-internet-through-usb/

No. you can't connect an ethernet cable to phone directly. It is possible if you connect with cable(USB type C to Ethernet receiver) OR USB Type C OTG(USB port to Ethernet receiver). Example shown in this video: https://www.youtube.com/watch?v=uisnj8Xufp0

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


text:
How to list all files that an Android app is currently reading or writing?
I want to list all the files that an Android app is currently reading or writing, something like what Windows' Disk Activity in Resource Monitor does:

How can I do that?

Do you have root access? toybox lsof command should help.

@Firelord Android L (5.1.1) or earlier: toolbox lsof (toybox was only introduced in 6, or Android M).


text:
Can a phone act as computer replacement?
Given the power of current day smartphones it seems like many could work as basic computer replacements.  In the past Microsoft tried to provide a display dock to turn a Microsoft Phone into a PC. Is there something similar for Android phones?
I guess some of them allow HDMI output, but is the software adapted to work with a keyboard+mouse? Would a phone be able to power/connect to an external hard drive?

You haven't heard of Samsung DeX?

There is also "Huawei Easy Projection". Together with a Bluetooth keyboard and mouse this also comes close to a desktop.

As long as an Android device has OTG support, it will support hardware mice and keyboards by default.

You can accomplish this with Samsung Dex.
What you'll need:

A Compatible Samsung smartphone.  As of the time of this post, this includes the S8, S9, S10, Note8, and Note9.
Either the Dex Pad or Dex Station to dock your phone and connect it to an external display, mouse, and keyboard.


text:
Oreo 8.1: Day of the week not displaying in notification drawer
I'm running Android Oreo 8.1. How do I have the day off the week show up next to the date in the notification drawer drop-down?
Thanks.

You can use Date in Status Bar. It will display the day of the week in short format above the date. However, the month and year are not shown (I have not seen them when testing). When you expand the status bar, the day of the week, date, month and year are all shown.
Here are how the date is displayed:
a. When the status bar is not expanded

b. When the status bar is expanded


text:
how to display text on TWRP recovery screen using a sh file?
I'm trying to display message on TWRP 3.2.3-0 recovery screen using a .sh file.
i was thinking using echo command to make that.
my update-script is like this
ifelse(is_mounted("/system"), unmount("/system"));
ifelse(is_mounted("/data"), unmount("/data"));
ui_print("-- Mount partitions...");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("test", "/tmp");
set_perm(0, 0, 0755, "/tmp/test.sh");
ui_print("run test.sh");
run_program("/tmp/test.sh");
ui_print("END OF PROCESS");
unmount("/data");
unmount("/system");

and my sh file is
#!/sbin/sh

if [ ! -e "/efs/imei/mps_code.dat" ]; then
    mount /efs
fi
csc_id=`cat /efs/imei/mps_code.dat`
echo "$csc_id" > /tmp/csc_id.prop
echo "Your active csc is $csc_id"

echo works because i see it in recovery log but displays nothing on recovery screen
Is there a way to activate echo or an other command to display message on recovery screen using sh file?

This piece of code is extracted from the ZIP package of SuperSU. It's working correctly on all devices I've ever had (displaying text to the TWRP terminal)
OUTFD=1
readlink /proc/$$/fd/$OUTFD 2>/dev/null | grep /tmp >/dev/null
if [ "$?" -eq "0" ]; then
  # rerouted to log file, we don't want our ui_print commands going there
  OUTFD=0

  # we are probably running in embedded mode, see if we can find the right fd
  # we know the fd is a pipe and that the parent updater may have been started as
  # 'update-binary 3 fd zipfile'
  for FD in `ls /proc/$$/fd`; do
    readlink /proc/$$/fd/$FD 2>/dev/null | grep pipe >/dev/null
    if [ "$?" -eq "0" ]; then
      ps | grep " 3 $FD " | grep -v grep >/dev/null
      if [ "$?" -eq "0" ]; then
        OUTFD=$FD
        break
      fi
    fi
  done
fi

ui_print_always() {
  echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
  echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}

To display message, use ui_print_always "some message" instead of echo.

thanks for your answer but it doesn't work for me. recovery log is /tmp/test.sh: line 32: can't create /proc/self/fd/: Is a directory. do you use this code in sh file and sheban is #!/sbin/sh ?

@kramer You need to set OUTFD=1 beforehand.


text:
Gboard's autocorrect is not available in German
I recently switched to Gboard because of its multilanguage support, etc.
Now I've run into the problem that for some reason, German autocorrection/prediction and the swipe-type feature are missing. Only when I swap to the English keyboard do I get predictions.
Maybe some kind of dictionary is missing?
I am using an updated Samsung Galaxy S7. Primary system language is set to English with German lower on the priority list.

When adding a new language to Gboard for the first time, it may show a notification "Updating your typing experience", possibly for downloading/updating the relevant dictionary.
If it didn't happen, try removing and re-adding the problematic language's keyboards.
In the worst case, you may need to reset Gboard's data by clearing their app's data (generally from the phone's Settings - Apps)


text:
Automating Wi-Fi Calling or Airplane mode toggle with Tasker
I am absolutely 100% new to Tasker. I have bought and installed this app to automate a few things which IFTTT simply can't.
Here is the situation:
My bedroom is in a basement apartment and so I do not get good cell service reception at all while I'm down there, and since it doubles as my office space (on days I work from home) and my gaming area, I tend to spend a decent amount of my time in my room. This being said, I have an LG V30 ThinQ with Android 8.x Oreo and my current service provider offers a Wi-Fi Calling service. Naturally, I turned it on, and bingo... calls are now crisp and text messages sent without a hitch. Well... that's at home at least.
However, at my work, the opposite is true: The Wi-Fi is bad, but the cell service reception is always super strong. Yes, my phone does have a setting to use Wi-Fi calling as a second priority to my cell service (meaning that it will use my cell service before using the Wi-Fi Calling) but instead of switching intelligently based on the strength of the cell service reception strength, it only switches to Wi-Fi Calling once I stop having cell service reception period. Which doesn't work well in the basement, since sometimes I get just enough signal to toggle it back to the bad cell service for calling.
So, I would like to create a task with Tasker that, once connected to/disconnected from my home network, would allow either the Wi-Fi Calling to be toggled; or for the airplane mode to be toggled. That way, as long as I'm connected to my home network, my phone will be using the Wi-Fi calling capabilities, without having to toggle them on and off again manually.
The problem is since I'm new to this, I don't know the first thing about programming a task in this version of Tasker. All tutorials I came across were very little help.
Could somebody work me through setting up something along those lines?

Create a profile "Home" with state "Wi-Fi Connected" and SSID set to your home Wi-Fi  network name.
On the profile create a task that

Turns on Airplane Mode
turns on Wi-Fi

This will be triggered when connected to your home network.
On the same profile create an exit task that

Turns off Airplane Mode

This will be triggered when disconnected to your home network.
Finally set your Wi-Fi Calling preference to "Cellular Network Preferred" (or whatever it is on your phone).

The task action that turns on Airplane mode, when run by itself, gives an error message and it is unclear how to give Tasker adequate permission to change Airplane mode.


text:
How to fix auto call rejection issue in Android 8.0.0
One of the important number is getting automatically rejected. How can i fix this?
Samsung J7 Duos
Android 8.0.0 version

Check your phone's Blacklist.
Check whether that important number has somehow got inside the blacklist or not. Any number in the blacklist will be automatically rejected without notifying you.


text:
Launchers and features analysis
I am using stock moto launcher on my device. And, the night drain is about 6%. So, I decided to use Nova launcher. Installed Nova launcher, and after that night drain is reduced to 3%. I need to know more about launchers.

Launcher's ram usage: Do both launcher's run same protocol/processes (eg: notification dots like processes).
Device running in Nova launcher, and started some apps. Then, I switched launcher to stock(uninstalled nova). Those, apps still remained in RAM. Why the apps not get reset while switching/ not removed from RAM.
Some widget features got reduced. For example, google widget. It always contain text "Say Ok Google" in stock launcher. But, it is not available in Nova or pixel launcher. Why?

About 2. Why do you assume the apps launched from launcher should get stopped when launchers are switched? A launcher doesn't manage memory or processes. It is just a user-friendly interface to have all the apps listed to user to be interacted with. Those apps would stop when a user herself or through an app explicitly stops them or system decides to do so when in shortage of memory or when restarted.

When an app is removed from recents or force close through settings app info, what will happen it will get removed from Ram. Launchers are also applications. I have uninstalled second launcher and then it switched to stock launcher.

Any responses for question 1 and 3?


text:
How to give an app permission to write to external SD on a rooted phone
I have a rooted Galaxy S7.  I'd like to give permission to an app that does not request it to write to the external SD card storage.  How can I do this?

did you try: pm grant command?

If you know the app package name, you can try the shell command pm grant.
Enable USB Debugging, probably already done for you, then type adb shell pm grant [replace_app.package.name] android.permission.WRITE_EXTERNAL_STORAGE hit enter. Your app should now have that permission.  Not sure if permanently though.

Googled and figured out how to turn on USB debugging. Type where????

You need a terminal to be able to run adb commands. google again to know how to get adb running on your computer


text:
Are the original cyanogen downloads for old devices still available?
I have 13 old galaxy tablets running android 3.0 that i would like to run cyanogen on.  All google links are dead.  they are SCH-i800 and i wouldn't bother but something has happened to play store so that it's not loading on all but one of the tablets.  It gives a weird redirect to a web browser page.  Also i was considering using them as wall remotes for home automation but the app i want to use requires at least android 4.2.

From the source listed below, there were backups made at archive.com of snapshots and nightly builds of CyanogenMod. There are many models, but I am not sure about yours.

Snapshots: https://archive.org/details/cmarchive_snapshots OR https://archive.org/download/cmarchive_nighlies
Nightlies: https://archive.org/details/cmarchive_nighlies OR https://archive.org/download/cmarchive_nighlies

Source: Complete CM Snapshots and Nightlies archive (xpost from /r/android)


text:
Has the setting to disable icon frames been removed on the Galaxy S10 lineup?
On previous versions of Samsung Galaxy phones I've owned, I had the option to enable/disable icon frames around the apps on my home screen. This setting could be found by navigating to Settings > Display > Home Screen > Icon Badges.
After digging around the settings of my Galaxy S10+, I have not been able to find such a feature.  Has this setting been removed with the launch of The S10 and One UI?
Below is a screenshot of the setting I'm referring to from my Galaxy Note 8:

This seems to be a setting that started in Oreo related to Adaptive Icons.  You now need specific themes to remove the border.
Per the following link:

If you don't want borders, go to settings>wallpaper and
  themes>icons>download and find an icon pack with no borders.

https://androidforums.com/threads/why-is-there-no-option-to-remove-icon-frame-borders-on-the-new-android-pie-update.1295501/

I read from many posts that the option shown above has been removed. Only solution I found is to download an icons set that was made without frames feature.  I am using one called Zero made by MINU after seeing its link in another post about the same issue on this website.


text:
Unusual Decrease in Charging Amps
I got to know about the Ampere app, which basically tells you how much amps does your phone draw while charging. I have noticed that my charger keeps on decreasing from 680 mA to 0 mA in 5 minutes and then my phone does not charge. I assumed that the problem is due to the charger and I replaced 2 chargers but couldn't catch what causes this problem. Can someone tell me is this a problem of my device or inputs in the charger or something else!!
P.S.- I am using properly matched chargers.

Did you try checking the USB connector? Try cleaning it and see what happens

The USB connector is fine. When I charge the device using the same USB cable through my laptop, I get a stable current.

Not sure what wrong with the wall charger may be the current is not strong enough to power your phone. Check your phone specs and the charger too. 680 mA is a bit low. You probably need from 1A > 2.1 A

I has this problem with my Nexus 6. In my case, it was a faulty USB port (not originally, but at one time it fell perpendicualr on the ground when connected with USB). You can consider having it fixed.

I identified the problem. All the chargers are good but the problem occurs in the data cable. Now I'm wondering why data cables face such problems. Although the cable is not charging but it is transferring the data.


text:
Rooting Sony Xperia xa2 ultra
I permanently deleted my "DCIM" folder from my internal storage while connected to my pc using a usb cable, before unlocking the bootloader and factory resetting my phone and rooting my phone and doing all that stuff, i was wondering if im able to recover all those files from my internal memory?

By default modern device like your XA2 Ultra use an hardware encrypted user storage. This means a factory reset should not only delete your data but also delete the encryption key.
Therefore after unlocking, factory reset and rooting the encryption key has changed and your data is not recoverable.


text:
Google Play Store crashes when loading an Instant App
I'm not too concerned about this issue because I've been downloading apps since I had an Android, but I was wondering what instant apps was like when I saw it.
I turn off a lot of permissions and disable lots of built-in apps out of blunt rage and have to factory reset my phone later when I can't fix the problem. I did that not too long ago and instant apps doesn't work (this was the first time I tried to use it). I don't feel like factory resetting. I use a Samsung Galaxy J7 Prime.
I don't know how to attach the video that shows it so I will leave an image:


text:
Google play services won't run unless you update Google play services
I am constantly getting a notification about every 1 or 5 minutes since I had updated the Google Play Services app. It's a very strange type of notification. It says "Google Play Services won't run unless you update Google Play Services". See the screenshot below :

What is the cause of this problem and how to fix it ?

I have solved the problem myself, like this :
Previously, I had updated Google Play Services from an APK file. So, this time, instead of updating Google Play Services from an APK file, I had updated it from the Play Store, and the notification went away.
So, for some reason, updating the app from an APK file was causing the problem.

That's very much usual. Some system apps if updated from external apks, then show problems.

OK, I have a different solution.  Find the the correct version for your phone, Google the APK, download it and install using APK handler.  Fixed the problem.


text:
Play store - share button missing
Am I blind or is there no share button so I cannot easily send somebody a link to some app from my phone? On a PC, I can copy a browser URL. I am pretty sure there was this share icon somewhere on the phone, but seems like it is no longer present.

In that menu I have a share button (PlayStore Version 13.8.16 235060107). May be you have set an app as default for share that is incompatible with PlayStore?

A bit weird but click on the developer name under the app name, it shows the list of apps by him/her, then and go back and click the dotted menu and Share item will be available.

@Alireza is correct and his comment is the correct answer. It's a bug. Google is not able to fix their store for 3 years now. Go figure.

This happens when you go to Play Store from within settings > app >app info (depending upon your OS).
If you go directly to Play Store (not from app info of installed app) and search for the app, you can find the "share" option.
I noticed this ever since I upgraded to Pie in January.
One on the left is from within settings and on the right is direct search on Play Store.

Anybody can test if this was fixed in Android Q?

@Vitas at the very least, I just checked this is working properly on Google Pixel 3a, Android 12.

Still missing here... Google Pixel 2 XL with Android 11.

Yes. Still missing

This is not correct.

@CaptainCrunch it was correct at the time of writing. Google changes tons of things unfortunately :(


text:
Japanese kana screen keyboard layout
I've found out how to switch between romaji with QWERTY and keitai-style flick keyboard, but I'd like to have ordinary kana layout similar to PC and Mac:

Is it possible with GBoard, or do I need a third-party keyboard app?

Cross-posted on Meta Japanese.SE: https://japanese.meta.stackexchange.com/questions/1954/kana-keyboard-layout-on-android-gboard

Unfortunately, as of the latest version (8.0.5), GBoard only supports 4 variants for Japanese keyboard: 12 keys, QWERTY, Handwriting, and GODAN. The QWERTY variant also only supports romaji input, not kana layout.
The current solution is to use 3rd-party keyboard apps, and while I have browsed some kana/JIS keyboard apps, the only keyboard app that I could recommend for now is:

Japanese Full Keyboard For Tablet by Repy (freemium)

The keyboard supports 3 keymaps: JP109, US, and JP KANA. After selecting JP KANA keymap, the kana mode can be toggled by pressing the 全 key on the top-left.
While the name mentioned "Tablet", it's also working on the phone. However, since the layout tries to follow the physical keyboard layout, the size and the position of some keys may not be optimum for a smaller screen.
Based on a quick test, the keyboard is quite comfortable on a 5" screen while on landscape mode, though on portrait mode the keys are a bit too squished. Fortunately, the settings allow changing the height of the key, so it's still bearable on portrait mode.


text:
Why files/directories under Android's root filesystem don't change across different version updates?
I compared 2 devices; one running Android v5.1.1 and other v9.0. So I noticed that files under /proc are same in both.
Can anyone explain why there is no difference even though OEM's are different and SDK versions are poles apart?

What kind of changes you expect with the difference of SDK versions?

Android OS has two parts: kernel and userspace binaries, libraries, configuration etc. Android's kernel is taken from Linux, slightly modified and rarely gets major updates in years (other than critical security patches), while the second part gets frequent changes and updates, particularly with version releases.
The procfs is Linux kernel's virtual filesystem which:

contains  (among other things) one sub-directory for each
  process running on the system, which is named after the process ID (PID)

So it's not directly affected by changes made to AOSP by OEMs or Google itself.
Since Android is based on Linux, its filesystem hierarchy also resembles Linux distributions. So there are least chances of it being changed with Android version updates. What Android (Google or OEM) changes resides mostly in /system and /vendor partitions. Libraries (native or java), executable and configuration files may possibly change but most of the changes related to Graphical User Interface or Android's internal API's are only within source code and don't reflect at filesystem level.
ANDROID'S ROOTFS:
Android's root filesystem is extracted from RAM disk which is a part of boot partition. boot.img that also contains kernel binary is built along with ROM (Android OS for a specific device). Starting with Android Pie for non-A/B devices, contents of RAM disk are moved to /system partition, making system.img essentially the root filesystem. See System-as-root.

One important file in root directory is /init executable binary which is the very first process started by kernel. It's the supervisor of all subsequently starting and stopping processes. /*.rc files are its configuration files.
Some other necessary binaries are included in /sbin.
/sepolicy is the SELinux policy file that's loaded before starting any services and processes on boot.
/cache, /data, /dsp, /firmware, /persist, /odm, /system and /vendor are mountpoints where different block devices are mounted. Last three contain most of the Android OS stuff while /data contains settings and user's media. /system has a partial rootfs hierarchy of a standard Linux distro. /cache holds temporary files. /dsp (directory or symlink to /vendor/dsp) and /firmware (directory or symlink to /vendor/firmware_mnt) hold some read-only firmware related to SoC (Qualcomm) and /persist (directory or symlink to /mnt/vendor/persist)  has configurations that are rarely changed.
/config, /mnt and /storage are also mountpoints of virtual filesystems to manage mounting of SD cards and external storage. Details here.
/proc is a pseudo filesystem as stated above. /sys is also a similar filesystem. /dev is also a virtul filesystem (tmpfs) which is populated from sysfs and contains interfaces to all available devices.
/acct is one of Android's control group implementation to control load-balancing of CPUs. Other cgroups are mounted on /dev/memcg, /dev/cpuctl and /dev/cpuset to control usage of hardware resources.
/root is the traditional home directory of Linux's root user, not used on Android.
/default.prop is a file or symlink to /etc/default.prop which contains some of default Android System Properties.
To retain compatibility, /sdcard is a symlink to /storage/emulated/0, /bin to /system/bin and d to /sys/kernel/debug. The traditional Linux's configuration directory /etc is a symlink to /system/etc.

Almost all of this filesystem hierarchy is the backbone of Android OS and there are very least chances of it being largely affected by Android's internal changes that occur to native services/daemons or Java-based framework.
For more details: ANDROID DEVICE PARTITIONS and FILESYSTEMS

Thanx a lot for youe response and detailed answer..  Please can you also guide for how to extract boot img and other images from boot partition...  I tried that (dd if and of) method but got a bit confused bw snapdragon and mediatek stuff my device is based on SD...  Thanx in advance ;)

It's off-topic here. A simple command would be dd if=/dev/block/bootdevice/by-name/boot of=/sdcard/boot.img. There are plenty of guides available. See this and this for instance.


text:
Note 9 Clock App - change timezone to no timezone
I have a note 9.  I used clock app for my alarms.  I can not change the timezone from central.  I live somewhere we do not have a timezone.  We do not change our clocks.  No matter what I do, the wrong time shows at the top of my screen.  My service provider displays the correct time below that, but this messes with my alarms and locks screens.  HOW do I fix this? I have tried several "fixes" for android clock app but it would seem my note 9 is different as I can't find instructions that will work with my phone.

Have you tried updating the timezone from your system settings? Settings > general > date and time

What do you mean by "we do not have a timezone"? Everybody has a timezone.


text:
Rotate status bar icons like in the navigation bar when in landscape mode
I want to do this to keep the status bar icons in the notch region when in landscape mode. I can see that showing time would be problematic but every other icon could just be rotated in place.
I wouldn't mind if the time was also rotated in place, e.g. For 10:23 you have
1
0
··
2
3

It would free up more vertical screen space which is already scarce in landscape mode. Moreover, if your device has a notch then it's a much better use of the screen space than just blacking it out.
I was wondering if it's possible to do it in the user land at all or if only the OS can take these decisions and we'd have to wait for long for such a feature to appear, if it does at all. If it's upto the OS then where are such feature requests entertained?
I am using android P.

Considering it was up to Google to fix Android with the notch then it should also be up to them to rotate the icons when in landscape. Also, manufacturer and custom rom could do this. I didn't check and don't know if but believe they wouldn't give OS control like this to app devs since it should be same always and not need others to change it. Probably, its one of those things they didn't do or want done and everyone must live with it. If landscape works like this with the notch idk, but at least on my device the noti bar rotates to the side and display normally and apps can hide it. Best way.


text:
Main app's icons overlays in Nova Prime's widgets
I've been using Nova Prime for about 5 years, which includes doing at least 10-20 settings backup-and-restore on various devices.
Today I made one another (on my Motorola Moto Z2 Play / Android 8.0 Oreo) and to my extreme surprise I have noticed that all my (restored) contacts widgets have a nasty "main" app (i.e. Contacts) icon overlay over each my contact's photo.
Picture worth thousand words -- before (left) sending Z2 to repair and after getting it back (right):

Analysis so far:

the problem is only with Contacts; other widgets (Wikipedia and Fancy Widgets in my case) have no "main" app icon overlay,
happens on both widgets restored from Nova Prime's backup and freshly added,
happens on Motorola Moto Z2 only (i.e. does not happen on Motorola One),
happens on Motorola Moto Z2 only this time (starting from this backup restore), since I hadn't this problem for past half year, prior to sending this phone for a repair.

Questions:

does anyone else experiences similar problem?
what is its source: is it caused by recent change to Contacts or Nova Prime?
is there any workaround or a way to get rid of this nasty little thing?

I am adding a contact-shortcut widget by:

opening Contacts app (default app under 8.0 Oreo?),
finding given contact and tapping it to get to details,
tapping three-dot and selecting Create shortcut from menu.

The only difference that I noticed is that prior to this backup restore (prior to sending my Moto Z2 for a repair and getting it back) and on every other device I am getting shortcut created right after above (right after tapping Create shortcut). While this time and on this Moto Z2 I see some new, additional Add to Home screen window, where I have to tap Add.
I assume (given above) that the problem's source is Nova Prime, not Contacts app.
I am using Motorola Moto Z2 Play (XT-1710-09) with Nova Prime 6.0 on board Android 8.0 Oreo.

https://www.google.com/amp/s/www.androidcentral.com/developers-must-read-get-your-apps-ready-android-os-new-shortcuts-and-widgets%3famp . It is known as app pinned short cut. If we create an app's shortcut, shortcut contain small app icon(here it will be contacts icon) on bottom right.

Thank you. Is there any explanation for the first point in my analysis list, i.e. why other app's widgets aren't affected by this problem? Or what is the difference between pinned app shortcut and regular widget, if both are added in Nova Prime the very same way, but only Contacts (and not Wikipedia / Fancy Widgets in my case) are affected?

On the left, the device may be running in android 7.0 and 7.1+ higher the above feature(pinned shortcut) is implemented first. And, currently your device is running in 8.0 Oreo. Its not related with Nova launcher, default android launcher(AOSP/Pixel) have such features, and Nova launcher's dev's apply such features to Nova launcher to make it nearly stock android like pixel.

No, I am using two different devices (Samsung Galaxy J9 and Motorola Moto Z2) and you are correct that Samsung has Android 7.1 while Motorola has Samsung 8.0, but -- as I wrote in my question -- these two screens comes from the same device (Motorola) before (left) and after (right) repair. Could it be possible that before sending phone to the repair it was running Android 7.1 and never actually updated itself OTA to Android 8.0, but while being in repair it was force-updated by repair shop stuff to Android 8.0? And that's the explanation while I have noticed these overlays only right now?

what is its source: is it caused by recent change to Contacts or Nova Prime?

Rahul in comments has pointed the reason (thanks Rahul). It is an OS feature introduced from Oreo (and the likely reason you didn't see it earlier- service folks must have upgraded it while under repair). For more see Android Developers : shortcuts overview

is there any workaround or a way to get rid of this nasty little thing?

Long press on shortcut → edit → long press on photo →select theme  → Gallery apps → select photos and choose the contact photo, go back  → Done
A disadvantage is that you have a rectangular icon that won't match with other icon appearance . But that may be good too to differentiate contact shortcuts!
I don't know how to fix that, unless you use a photo editor app that gives you round shapes (OP has suggested - you can use this Ukrainian on-line tool or this Russian on-line tool or search for some alternative).
And it is not for contacts only. I have a mail app which shows the same for "compose" shortcut. This app is targeted for min sdk 28 (Oreo). From August this year, all apps have to target Oreo and you will see this behavior uniformly
Tested on the latest version of Nova on Pie.

In my case it is only Contacts. Maybe because this is the only widget that I use in 1x1 size on my screen. For 5x1 Wikipedia widget and for 2x5 Fancy Widgets weather widget there is no overlay. Just a note.

But, either I am getting something wrong or this is some kind of "shifting" feature. My wife has Motorola One with Nova Prime 6.0 (newest) and Android 9.0 Pie (newest as well) and does not have this problem (no icon overlays on Contacts-shortcuts widgets).

I'm running Motorola Moto X4 Android 9.0, while creating shortcut of contacts app, it will display contact app-icon on bottom-right corner.

@RahulGopi : Thanks for the link (saved me trouble of searching). Credited in answer

@trejder: I have no idea why it is not happening on your wife's phone (third party contact app is one possibility). I know and have seen it on other devices running on Oreo. As to why it doesn't happen on her phone could be a separate question, with this one linked as background

FWIW, the app icon on the app shortcuts (not widgets, they're different and don't show app icon) also appears on my Nexus 5, Lineage OS 14.1 (Android 7.1 Nougat) on Pixel Launcher. Also, it's first introduced on Android 7.1 //cc @trejder

@AndrewT. Can we, from your comment and my info that I hadn't this problem before, actually assume that source of problem is Contacts app changing "shortcuts" to contacts from regular widgets (previously, no overlay) to app shortcuts (today, overlay)?

@trejder now that I think about it, there's a possibility of that case considering some apps (like Contacts) have both widgets (for backward compatibility) and shortcuts (for newer OS) that have the same function.


text:
Some apps automatically uninstalled after android phone restart
After restarting my phone I noticed that some apps are totally uninstalled, first I thought that they're still being loaded because they are installed on the external SD card but when I searched for them in the Settings\Manage Apps I couldn't find no trace of them. Uninstalled apps include ES File Explorer/Manager PRO and a few dictionary apps. One weird thing I found out is not only the ES File Explorer is uninstalled but all the files encrypted with it are moved to .android_secure folder on the SD card!
Also a few couple of megabytes has been freed on the SD card. I should note that after suspecting virus infections, I've already installed Bitdefender free antivirus and done a full scan which revealed two adwares and a riskware app that has been installed on this phone for a long time so I don't think that they are the culprit.
BTW, not all the apps on the SD card have been uninstalled.
I'm out of ideas. What could be the problem?
Android phone: Huawei G730-U10, Android version: 4.2.2

Hey there! As a heads up, Antivirus apps mostly do...er...nothing. Some, like avast, do actually work(sometimes), so resort to them if you must. as for you issue, is this applying to ANY app you install?


text:
Saving links with Pocket on Android browsers?
Should I have a bookmarklet of some sort that does that?  There doesn't appear to be a button to do that in Firefox mobile or for Google for Android which is strange since there's a Pocket App for Android, and that app doesn't appear to save bookmarks, so you're just kind of trapped with the links that you saved on your computer using pocket.
I also, don't see any browser extensions for it.

You use the "Share" functionality to share the web page to Pocket – which then will save it.

@Izzy Oh, so it adds it to your browser's share functionality?  You don't say...I never thought of that  thanks!

Though this is really @Izzy's answer here's what I found on my device on how to do this:

Click the Hamburger button.

Click the Share button.

Click the Pocket Button

Yes, that's how it works. Not only with Pocket, but also with several other similar services like Nextcloud Bookmarks or Wallabag. Thanks for self-answering (and credits :)!


text:
SimpleSSHD - create reusable user/password?
I have downloaded SimpleSSHD (aka Dropbear) to access my Android via SSH.
I am able to do so with the one-time password, but I'm trying to write a Python script that can access the phone.
Is there a way to add a "username/password" to SimpleSSHD so I can put that in to my Python program?
Edit: (I'm really new to this) - it looks like I need to create authorized_keys on my RPi somehow, but am not sure how.  Following this didn't seem to do it.

I am new myself, but this is how I managed to do it

Generate SSH keys on your client (RPi in this case) system
A. Use the command ssh-keygen -t rsa -b 4096 -C "optional_identifying_comment" to generate the key pair
B. When the shell prompts Enter file in which to save the key it is asking for a file name. Provide your own, or press Enter to accept the default 'id_rsa'
C. The shell will prompt for a password, provide one (it will have to be used each time you use the key) or press Enter to leave it empty.
D. Confirm your password
E. You should now have a pair of keys, a private key (ie. id_rsa) and a public key (ie. id_rsa.pub), usually stored in /home/user/.ssh. The private key is for the client computer (RPi in this case) and the public key is for the server (Android in this case)

Transfer the public key to your Android
A. Figure out the target address for your Android. You can do so by opening SimpleSSHD, clicking the three dots in the top-right corner and selecting Copy App-private path
B. Add the public key to the SimpleSSHD authorized_keys file. One option is to use cat:
cat ~/.ssh/id_rsa.pub | ssh username@hostname -p 2222 "cat >> /data/data/org.galexander.sshd/files/authorized_keys"

Adjust the above to your environment.


text:
WhatsApp profile pics of some contacted added but now have disappeared
Some of my contacts didn’t add a pic on their WhatsApp profile. As I had pics of them, I added their pics from my phone contact list, and they were automatically transferred to my WhatsApp.
But suddenly, some of these pics disappeared on WhatsApp. I still can see them in my phone contact list, but not on WhatsApp anymore. And I still can see their last seen, so I believe they didn’t block me...
What could be going on??

You are facing this for one (or a group of) user, or for all users you added pics? If it is for all, it might be related to some update on the app's behavior (It seems odd to me that someone else is able to choose a picture of me - even if it is for his own phone - for a social app). Also, another thing, if a user blocks you, his/her pic is removed. Wouldn't this be the problem?

For all the ones I’ve added pics in my phone contact list... But I think they didn’t block me, because although the pics I’ve added for them disappeared, I still can see the last time they were online.


text:
Do calls to Java native interface in android apps run within Dalvik VM?
I read that apps sometimes access the native libraries for optimization purposes via the Java native interface.
As far as I understand, JNI just provides java wrappers around c/c++ libraries/binaries which are written closer to hardware hence faster and more efficient.
But how does it provide a performance boost, aren't JNI APIs called through Dalvik VM, so they do not run natively, they are still running inside a VM so there shouldn't be any difference.

I would be careful when calling the native code called through JNI as faster. It depends. First, there is some overhead on calling, which might be a performance killer for short-running tasks. Second, it depends on optimizations. With enough effort, you can probably do it better than the JIT compiler of Dalvik. (Well, it's ART instead of Dalvik: https://en.m.wikipedia.org/wiki/Android_Runtime ) But remember, even ART compiles the bytecode to native code and tries various optimizations. Just simple rewrite od Java code to C might make it either faster or slower…

I think I see the source of your confusion. Dalvik VM isn't a virtual machine the same way as VMware or Virtualbox. In that kind of VM, VMware (or whatever) is pretending to be the whole computer. Every operation has to go through the VM, it has to be prevented from accessing the real hardware, and if it does access the real hardware, VMware has to do some work to pretend to be the real hardware, give the result to the OS, and have the OS give the result to the application. There's a whole copy of the OS running inside the VM, so it's an application, on an OS, on VMware, which is itself an application running on an OS, which is then on the real hardware.
Java and (by extension) Dalvik VM isn't like that. It's more like an abstraction of the real machine. The real hardware isn't being hidden from the application, and there isn't an extra copy of the OS there.
A Java application is just a process on the phone like a non-Java application. When a Java application makes a function call via JNI, Dalvik has to do a small amount of book-keeping to pass the objects used in the function call to the native code, and then the native code just runs in the process, with no VM involved at all. Then there's a little more book-keeping to get the result back to the Java code.
The code within the JNI call is as fast as any native code in a process where there's no Java at all. The only overhead is the book-keeping on entry to and exit from the call.


text:
How common is ARM NEON support among recent Android phones and tablets?
Some ARM processors support NEON extensions for acceleration of certain maths operations useful in multimedia, 3D graphics and the like.
How common is NEON support on Android phones and tablets made in the last three years (since 2016)?

To get Google Play Services, devices must follow Android Compatibility Definition Document and since Android 6.0 - Native API Compatibility has required Advanced SIMD (a.k.a. NEON):

MUST include support for the Advanced SIMD (a.k.a. NEON)

Android 6.0 was released in October 2015. So if the device originally sold with Google Play and included Android 6.0 and up, it should have NEON support.
Realize that older devices sold with older versions of Android didn't NEED to have that requirement but by that point most mid-tier and high end devices had NEON support.

I checked and every later version up to 9.0 retains that requirement too. Thanks.


text:
Does the Android OS supports playing two or more audios simultaneously?
Does the Android OS supports playing two or more audios simultaneously ?
I am asking this because I have seen some apps playing audio without stopping the audio that's already playing in the background.
I am confused whether it is the feature of the app or the Android OS. Please provide some information about its support.
Thanks in advance !

If the background music is played by App1 and the foreground music comes from App2 it is obviously a feature of the OS, because App1 can't access the audio of App2 and the other way round.


text:
How to Get Back the External SD Card Notification
I used to have a notification whenever the external SD card was in the tablet. Recently that notification has disappeared. How can I get this notification back.
I like this notification since I am able to eject the card from it without needing to go thru the settings menu to get to it.
What is interesting is that when I insert a different card the notification is back. I only am missing it for the original card. Last time I had this problem I factory reset my tablet. I would rather not have to do this again.
I searched for a solution but only found solutions to get rid of the notification, not the opposite. I tried to reboot my device but that didn't help.
Any suggestions will be greatly appreciated.

Another great solution, but your device must be rooted to be able to use this option (ASFAIK).
Use the sm tool
sm forget [UUID | all]
This makes the device forget the storage device with the given UUID or if you do all it forgets all the devices.
If your using Termux terminal emulator (as I am) you need to do tsu -p in order to be able to use the sm tool. If not you get an error. Basically what you need is for the LD_LIBRARY_PATH to point first to the android library path and -p prepends those paths BEFORE the termux library path.
I didn't try this in any other shell or terminal, but I'm assuming it should work there as well.

Change the volume serial number of the sd card.
There might be various ways to do it, this one worked for me when I had the same problem after touching "clear all" when displaying notifications.
Mount the SD card on a windows PC.
Note the drive letter of the sd card by opening a windows explorer window.
For example let's say it was mounted as E:
In a command prompt window type the following command to find out the current volume id of the sd card, assuming the SD card is E: drive.
vol E:

It should give you a number like 1234-5678
Download the Microsoft utility "volumeid" from this link at Microsoft:
Follow the instructions at the link for using the utility and give the SD card a new volume id.
Make sure you use the right drive letter, the drive letter of the SD card. You don't want to change your hard disk by mistake.
In a command prompt window, the syntax is:
volumeid E: 1234-5679

This will change the volume id of E: drive to 1234-5679
When you put the SD card back in you android device the device will think it's a different card and show the sd card mounted notification.

Great answer. Is there any way to do this in Linux? I don't always have access to a windows PC.

To add to @Morris's answer a way to do it in Linux (or on the Android device itself using Termux)
Run sudo blkid to find which device is the sd card. (On my device it was /dev/block/mmcblk1p1)
Now run sudo mlabel -i REPLACE-WITH-YOUR-SD-CARD-DEVICE -n (-n generates a random Serial Number you can use -N xxxxxxxx where you replace the x's with hex digits for the serial number you want see the man pages for mlabel).
The idea of using blkid and mlabel I took form Here! See JonathanS answer. and the exact way of writing the mlabel command to use the undocumented -i option I took from Here!
[I ran these commands on the tablet using termux and instead of sudo I ran it as superuser doing tsu -p and then eliminating the sudo part of the commands.  I also needed to downgrade my libandroid-support.so library for it to work. I found that just doing tsudo (termux's version of sudo) gave me a large number of devices when I ran blkid and it was hard to figure out which one was the sd card.]


text:
Cannot connect to HTTPS sites due to device clock being ahead
I cannot access 'My Search.com' I just set as my homepage (Brave browser) and Yandex for my search engine (new install). I got an error saying that my (device) time is ahead.

Your clock is ahead
A private connection to *example.com** can't be established because your device's date and time ([current date and time]) are incorrect.
NET::ERR_CERT_DATE_INVALID
To establish a secure connection, your clock needs to be set correctly. This is because the certificates that websites use to identify themselves are only valid for specific periods of time. Since your device's clock is incorrect, Chromium cannot verify these certificates.

I have checked that the time and timezone is correct. Also, daylight savings time occured since yesterday.
How to fix the issue?

I believe there might be some sort of auto-sync for date-time in your device. Did you check that?

What model phone and what carrier? Carriers often have a number you can dial that initiates phone reprogramming, which should do things such as fixing time zone issues.

Which country and time zone are you in? A daylight savings time starting on 10th March is very early, may be your phone does not correctly considers that and therefore you are 1 hour in the future.


text:
Front camera not working on OnePlus 5T
Since yesterday my phone's front camera hasn't been working.

Not working on most apps, including native camera. While touching "switch camera" button in camera application, nothing happens.
Instagram images from the front camera displays a distorted, stretched image of the rear camera.
In Dialer keycode(secret code) #808 for Oneplus devices, "front camera preview" displays rear camera's image. But "camera test" makes the app close(force close) without any error info.
If I'm not mistaken, during a video call on WhatsApp, the camera froze along with the app, which became unusable until I restarted phone. After that the camera hasn't worked ever since.

What I've tried so far:

factory reset
safe mode
several camera apps
going back to stable (I was using beta)

Nothing worked. Any suggestions?

If a factory reset doesn't fix it, it is best you   get it repaired.

Tried to fix a possible software problem in any way I could imagine. Nothing worked.
Sent it to OnePlus for repairing and now it is working like new. They had to replace a few components, so it was a hardware problem.


text:
Mute all notification sound except Call Message and WhatsApp to be on Vibration Mode
I have a brand new Galaxy S10. I would like to keep the phone in mute mode but want the phone to vibrate if there is any Call, SMS or any WhatsApp notification.
How to do this? I do not wish to root the phone as of now.

Related: https://android.stackexchange.com/questions/88633/lollipop-mute-notifications-but-not-calls

I believe the easiest way to accomplish this is through do not disturb mode with custom exceptions.
Allowing calls and text messages through do not disturb mode is easy. Simply set "Calls from" and "Messages from" to "All" on the "allow exceptions" menu under the do no disturb settings.
For other apps, such as Whatsapp, you can do the following:

Enable do not disturb mode.
Go to Settings > Notifications.
Select the app you would like to modify.
Select the type of notification you would like to exclude from do not disturb mode, such as message notifications.
Enable the "Ignore Do not disturb" switch.
Back out of this screen and repeat steps 3-5 until your notifications are configured as you desire.

Unfortunately, this don't work in miui. So you have to install an app like this to block all notifications manually. I don't know any way to block sound only though

go to settings
*and search for sounds in that ,there will be the  different options like different settings for sounds in that you can find your favour application and make it your wish *


text:
Why can't I see a folder in "/storage/emulated/0" on PC through MTP?
I use a banking app in my Android 8.1.0. All receipts are saved in /storage/emulated/0/APPNAME.
I can see the APPNAME folder and the receipts on Android if I use an explorer app like Google Files. But if I connect my Android on PC, the folder doesn't show up. I can see the other folders with no problem. Only that specific folder is missing.
What's going on?
(I suspect the devs marked the folder as not accessible through PC)

It seems to be a problem related to Media Providers. Due to some bugs in implementation of MTP, database of Media Storage app (/data/data/com.android.providers.media/databases/external.db) built from contents of /storage/emulated/0 isn't updated or is delayed or isn't properly communicated with the client as the files change, so MTP shows outdated / incomplete contents.
In order to force database updation, delete the file and run some media scanner app. Non-root users can delete this file by clearing data of Media Storage app.
But be aware, it'll also clear internal.db which will make ringtones unavailable and a new database will be built from /system/media on next reboot.
See this answer for more details.

Its like bug on computer when connecting to android (mtp)
To fix that make a folder then copy the contents of the APPNAME Folder to the folder that you made or just move the whole appname folder to the /internal storage directory.


text:
Mute Phone Audio when Headphones are Unplugged
I only ever unmute my phone when my headphones are plugged into it. I'm looking to automate this process. Here's what I want to happen:
if (headphones are unplugged) {

  mute all audio on the phone

} else {

  play audio through headphones

}

I've heard of automation apps like Tasker and Task, but I don't really know how to use them, or even if this is possible.

The system should automatically handle that for you. If you have your headphones unplugged and set the media volume to mute then plug them in, it should switch to (lets say) headphone mode. When you unplug them, it should switch back to mute for speakers.

Unfortunately this isn't the case with Do Not Disturb mode.

What phone and version of Android are you using?

I am using Macrodroid and Automate to demonstrate what you ask.
With Macrodroid
You will need to create 2 macros.
1st macro: Headset plugged

In the Trigger tab, select Headphones Insert/Remove, then choose Headphones Inserted followed by Any.
In the Actions tab, select Volume Change, then give the appropriate permissions. Set the level of each audio stream (see below picture on the left).
Give the macro a name, then save it. It will look like the picture on the right.

2nd macro: Headset unplugged

In the Trigger tab, select Headphones Insert/Remove, then choose Headphones Removed.
In the Actions tab, select Volume Change, then give the appropriate permissions. Set the level of each audio stream to 0 (see below picture on the left).
Give the macro a name, then save it. It will look like the picture below on the right.

With Automate

In the Interface section, select "Wire headset plugged?", then link its IN with the OK of the "Flow beginning" block.
In the Camera & Sound section, select "Audio stream mute state" twice.

Click on the first block, set the state to Unmute, select an audio stream, then click Done. Link the IN to the Yes of the "When wire headset plugged" block, then Link the OK to the IN of the "When wire headset plugged" block.
Click on the second block, set the state to Mute, then select an audio stream. Link the IN to the No of the "When wire headset plugged" block, then Link the OK to the IN of the "When wire headset plugged" block.

It will look like the image below. Give your flow a name then save it, then click on Start.

Note: I have selected Music stream for this example. Only the music will be muted/unmuted. Add more blocks for the other audio streams (voice call, alarm, system, etc).

This is an excellent guide! Thank you very much for your input! I followed the Macrodroid steps and it's exactly what I wanted to achieve.

What an amazing walk through! Thank you for taking the time to do that. I dont even have a device that i believe can utilize this utility, but you lead me right along, and it was enjoyable even. Does macrodroid require root or any special permissions?

@Evileclipse Some features requires root but most don't. The most important is to give the appropriate permissions when required for the macros to work correctly.

@Evileclipse I was able to follow this guide using Macrodroid without needing to use any root access.


text:
Android 9 (Pie) sd external card conventions
My Moto g6 asked to reformat my SD card after the official Pie update. No app was able to access the SD card and only the System and Total Commander even recognized it. After Android formated, I could read from and write to my SD card. The problem is the following.
I fast transfer my libraries from my computer. This is I put the card in my computers card reader and copy my files into the root of card's directory tree. (I don't see that it matters but I rsync from a Linux installation.) Now android wants to reformat again as if I hadn't formatted. To restate, no app is able to access the card and only the System and Total Commander recognize it.
Where should I move the files, and where can we check the conventions? What are the protocols and what is going on with Pie? Any references are welcome as well as a direct answer, thank you.
Possibly related question: SD card is unwillingly used for apps

Did you correctly unmount the sd-card in phone and PC before ejecting it? Which file-system is used on the sd-card?

Sorry, the card wasn't unmounted before removal. A quick test seems to show that unmounting a newly formatted card solves the issue, thank you @Robert. (The fs is exfat as formated by Android.)

The card was corrupted at removal time because it wasn't properly ejected (unmounted) beforehand. Remember to eject your removable devices even if you think it is safe to remove them.

All credit goes to @Robert


text:
Disable push notifications from a non-HTTPS website on Firefox Mobile
I visited a YouTube proxy website, NSFWYouTube, and since then I receive unwanted push notifications from that site like this:

[image above, not showing for me, is https://i.stack.imgur.com/xV11T.png]
There doesn't appear to be a way to disable it in Firefox Mobile 65.0.1 -- the Mozilla's Support site says to go to the site, click the "lock" icon and disable notifications there. But there is no notification option when I try; the site is not an HTTPS site (not sure if that's why).
I do not recall accepting notifications, is it possible the site click-jacked me into doing so? How can I disable these notifications?
Edit: Additional info, https://pastebin.com/L70PQHnE has copies of some of the JavaScript used on the nsfwyoutube site when spoofing a mobile device, it appears to used "siteswithcontent.com" (which this Ublock filter list associates with annoying push notifications) and ultimately firebase-messaging-sw.js to perform the push notifications ... which continue to come through.


text:
Does greyscale/grayscale mode save battery life?
Simple question but searching I can't find much evidence. I use an LED device (not OLED), would that also make a difference?

If the screen is LCD or LED then, there is no battery saving as answered on this question Will grayscale increase or decrease battery consumption? on AskDifferent.
However with an AMOLED screen, there is an advantage as the black pixels will be turned off.
According to the article Why You Should Use Always Use Dark Mode on Phones

That said, the differences in power Google discovered between using an app normally and using its "night mode" (or dark mode) were striking, particularly for OLED-based phones. For example, when testing an AMOLED-based Google Pixel, Google found that Google Maps uses 63 percent less power when it Night Mode compared to normal mode. By contrast, an LCD-based iPhone 7 saw no change in power consumption

Although Night mode is not grayscale, the advantage of switching off the dark pixel should help in saving the battery.

Everybody is confusing Greyscale with Dark Mode!
Dark mode changes the colors of the apps (including home screen and system apps like settings and such) and usually makes the backgrounds black since most of the screen is the background and by making it black it saves a lot of power. So Dark mode tries to have as much as dark/black colors showing on the screen. so basically it means dark/black background and white text/elements on screen.
On the other hand, Greyscale Mode is a completely different thing. Yes it will change what you see on the screen but not like 'dark mode'. Grayscale simply removes all the colors and makes them grey, just like the old TV's.
How does this save battery? (and yes it does)
The screen will still be on and the brightness will not change at all so theres no battery saving from the screen. But your smartphone has a GPU inside of it and that's what will save battery in Greyscale mode
The GPU is where what you see on your screen gets processed, and it usually works with million of colors that include all the shades and mixes of red, green and blue and there are almost 17 million color possibilities. But in greyscale there are only 256! That's crazy isn't it? And this is exactly what saves your battery power, it's because the GPU has to do WAY LESS calculations.
Extra info: colors on the screen are calculated from the values 0-255, 0 being the darkest and 255 the brightest. So a single pixel on a greyscale screen can be one of those 256 possibilities, but in a normal screen that displays all the colors we have a "minipixel" for red, another one for green and one for blue. They mix together in values from 0-255 to create other colors. That means now we have 255255255(combining red,green and blue values)=16777216 and thats the number of color possibilities in a RGB screen.

Do you happen to have an estimate on the percentage of power reduction by using grayscale mode?

Good job making clear that grayscale is not dark mode. But I think your assumptions are wrong. (1) Yes, the system could store and process less data for each pixel, but very likely won't do so because that could break software. Try it yourself: enable grayscale, take a screenshot, disable grayscale, look at the screenshot, if it has color the system still does store and processes all colors as usual (this is the case for me on Android 11).

(2) Either way, all apps/websites still use their regular colors which have to be converted to grayscale. This is additional work you wouldn't have to do if you just kept the colors. If the system (including software!) would only process the converted colors (which it doesn't, see previous comment) then maybe this additional work could pay off because you could save some work at other places. Such tradeoffs would always depend on your system. There is no general answer.

(3) Your mentioned numbers are highly misleading as they are stored and processed in a positional numeral system, so the difference is just 3 bytes vs. 1 byte. Example: When adding numbers by hand, adding 1+100 takes only 3 times as long as adding 1+1, not 100 times as long. Actually, the numeral system does not matter. Colors are stored in components (typically 3: RGB) that are processed individually; not as one big number.

No, because power is still being consumed to display the image. Had the device been OLED or AMOLED, then it would have saved a bit of power, since each pixel is an individual source being powered, and black pixels would not receive power.
The best bet on saving power with LED is if the GPU was processing images in 8-bit, but it does not. If you turned on grayscale and took a screenshot then turned it back off, the image is still in color.

Yes, power is still used to display an image, obviously , but this doesn't mean the same amount.

For an LCD device the major power factor is the consumption of the background lighting. If you show the screen in color or gray does not have an impact ob the background lighting, therefore it does not make a difference in power consumption.
In OLED displays each pixel is shining, or to be precise each sub-pixel (red-green-blue and sometimes an additional white) is shining requires power. The more pixel and the brighter the pixel shine the more power is required. I would assume that e.g. a blue a sub-pixel shining at 100% requires a bit more power than 3 RBG sub-pixel shining at a lower brightness in grayscale mode. However the effect should be not very high. Therefore I would assume that the saved power by an OLED display in grayscale mode is very small.


text:
Stop prompting to Block Number when deleting a text message
I have a Samsung Galaxy S9+ and every time I delete any text message, the phone prompts the option to "Block Number". How do I disable this so I can just select the message(s) I want to delete?  My work requires a lot of two factor authentication, so I get a lot of texts with temporary pins to enter in our software. I delete the texts each time as I don't want my messages view being congested, but this prompt drives me nuts as it is since I already have to do 2FA for everything at work.


text:
How do I move app icons between pages of the all-apps list?
My phone has four pages in its all-apps list (as opposed to its two pages of home screens). I know how to copy app icons from the all-apps list to any home screen. I also know how to move app icons within a single all-apps list page. (And while searching for answers to this question, I found how to remove blank home pages.)
What I haven't found is how to move icons from one page of the all-app list to another. To illustrate (simplified):
Home Page 1                      Home Page 2
 G         Say "OK Google"       T-Mobile             Visual
                                                     Voicemail
Phone  Messages  Play  Camera    Phone  Messages  Play  Camera

All Apps 1            All Apps 2            All Apps 3
A1  B1  C1  D1  E1    F1  G1  H1  I1  J1    K1  L1  M1  N1  O1
A2  B2  C2  D2  E2    E2  G2  H2  I2  J2    K2  L2  M2  N2  O2
A3  B3  C3  E3  E3    F3  G3  H3  I3  J3    K3  L3  M3  N3  O3
A4  B4  C4  D4  E4    F4  G4  H4  I4  J4    K4  L4  M4  N4  O4
A5  B5  C5  D5  E5    F5  G5  H5            K4  L5
A6  B6

If I want to copy app "H3" to the home screen, I just press and hold H3, and either wait until pop-up menu comes up with "Add to Home" as an option, or wait a moment longer so that the Home screen appears, and then movie it until I'm ready to drop it. That's easy.
If I want to move "N3" to the end of the All Apps 3 screen, I just long-push, drag the icon to the end of the screen, and release. It's there.
But, if I want to move "N3" to the end of All Apps 2, I don't know how to do it, and that's what I'm trying to find out.
--
I have a Samsung Galaxy Note 8 with Android 8.0.0, kernel 4.4.78-14375742, but I've seen the same issue on my previous phone, a Samsung Galaxy Note 3 with Android 5.0, so it seems to be a version-independent issue.

I just tried this on my Galaxy Note 8 and it's working. I can drag apps from one app screen to the next by dragging them close to the edge of the screen, just like I would on the home screen.  Just have to make sure the app screen sort setting is set to "custom", but you must have already done that if you can move them at all.

I tried again, and it looks like it's a picky maneuver; it only works if the first step of the drag is up or down. Maybe with more experiments I can find a more detailed explanation.


text:
Append a string before opening external URLs
I frequently read news articles shared on social media.
A lot of times, these articles are full of advertising and other irritating elements. I use a service that strips just the content and formats the article in a nice presentation.
I want to automate copying and pasting those links. Basically I want to be able to click on a link on apps and have an option that attaches service.com/ before that URL and then opens it.
What I currently do

Long click the link on the social (non-browser) app
Share using a clipboard copier
Open Chrome
Type service.com/ and paste the original URL.

What I want to achieve

Click on the link on a non-browser app
Open service.com/original-url.com/etc on a browser

Some ideas:

A really simple app that registers a web intent, simply appends http://service.com/ to the beginning of the URL, and opens it on the browser. Unfortunately, I know zero Android programming.
An app that allows you to register custom intents and add custom actions to it. Is there such a thing? I was able to find those which are close, but not the same thing.

Pity chrome for Android doesn't have extensions...


text:
Can I change which SIM a phone is using for its LTE interface using ADB?
I have a set of phones that have dual SIM cards. What I would like to do is have them connected to one network using SIM card 1, run some test, disconnect from the network, then have them connect to a second network using SIM card 2. Is there a way to do this through ADB? Preferably without root access, but if that's not possible, then with root access is okay.

This post didn't get much attention, so I don't know if it's worth posting the answer, but I did find a solution.
I didn't know when posting this that the solution is dependent on the version of Android. In my case, the phones have Android 9 (Pie).
The command that I found to turn on/off SIM cards is:
adb shell service call phone 180 i32 X i32 Y

where X is the SIM card number (1 and 2, in my case) and Y is 1 for enable and 0 for disable.
If anyone is interested, I found the solution by digging through source code on android.googlesource.com. Once I found the interface for ITelephony (it was a .aidl file), I had to count the functions, because the number 180 in the command meant the 180th function in that file. I also derived the arguments i32 X i32 Y from the arguments to that function. The answer here helped me a ton: https://stackoverflow.com/questions/20227326/where-to-find-info-on-androids-service-call-shell-command.


text:
Way to update and keep a browser in custom android device
We have custom android terminal and it comes without Google Apps and only few system apps are there and without a browser app. We need to install a browser in the device and keep it updated. Will it be possible?
Update: I can not flash this rom to add GApps.

Without Google play store you can't install apps and its further updates for your android device(standard and secured method). You can install apk of any app on your device. Install apk of any app provider resource and install browser from it. So you can get updates from app provider.

I can not flash this rom to add GApps

Download apk's of Google play store, play services framework, Google services framework and install to device. And then you can run play store and install any apps.

http://en.miui.com/thread-416299-1-1.html try to install using second method (follow steps under update heading)

Play Store alternative resources https://medium.com/pen-bold-kiln-press/best-google-play-store-alternatives-30c759de1c26


text:
Any reliable method for transferring files between Android-based device and Windows-based computer?
From at least Android 4.0 to at least Android 8.0 (most likely Pie as well) we are forced by Google-Microsoft trust into using MTP as the only (?) files transportation method between Android-based device and Windows-based computer (if not count as pity, sad and dully methods as attaching files to e-mail messages).
For at least five years billions of users around the world are forced into using solution that is:

extremely slow (transferring large files collections or huge files takes hours even on USB 3.1),
extremely unreliable (device can stop responding even after sending just a few files),
not working at all most of the time (device that stoped working may not "restart" and may not allow you to copy files even after dozens of unplug cable-plug it again  sequences).

(I can see above message after each and every file that I copy; I have to unplug and plug the USB cable again after copying each single file)
Questions:

Supporting, OT and philosophic one: What am I missing? Why we are forced into using this madness? Why nothing had been done for five years to resolve it?
Main and real one: Is there any other way? Any fast, reliable method of transferring files from Android-based device to Windows-based PC?

Described problem was tested on Windows 7 and Android 8.0, so not the newest ones, but still very widely used. And on the quite modern phone -- Motorola Moto Z2 Play -- but of course happnes on dozen other Android-based devices that I own and billions of Android-based devices other uses.
And, as stated in links given in first sentence, absolutely nothing had been done into resolving this problem for at least five past years. Is this some kind of sadistic way of understanding market and treating its customers, developed by Microsoft and Google or what?

Would transfers via [tag:adb] be an option? I use nothing else (MTP is a pain in the a**). There are also some GUIs available if you prefer.

@Izzy: I need to install ADB on any PC to which I want to transfer files from my Android-based devices. If there is no other alternative to sh*ful MTP then I have no other option like this. BTW: Is there any reasonable source to explain why we are still forced to that dumb MTP? Some weird business agreement between Google and Microsoft that pains users a*es?

@Firelord The linked question: (a) is 3+ years old, (b) targets Windows XP mainly (while I need solution for Windows 7/10) and (c) targets ICS as "the newest Android version" (while I need solution for 8/9 | Oreo/Pie). I would have serious problems calling such thing a duplicate. I would rather call that linked question a very, very out-dated solution that has nothing to do with current situation on the market. And my question directly linked to current situation on the market and asks for up-to-date options.

You can find some minimal installation stuff here (my site). And the dumb decision was because with UMS the card became unavailable to the Android system when mounted. Though I still don't get why the card must be available to the system. I'd prefer to have a choice at least. I don't install apps on the card, so that reason is gone for me. But as usual: don't overstrain a dumb user…


text:
using printenv in script sh in recovery TWRP return error execv failed : Exec format error
for example just try this script
#!/sbin/sh

printenv | grep sdcard >> /tmp/tong.txt

in recovery.log i've
run_program: execv failed: Exec format error
run_program: child exited with status 1

I think it's about printenv but i don't understand what is wrong.
Using printenv in a terminal emulator works but not in my script sh

printenv doesn't work but using env works well
so i changed my script like this
env > /tmp/tong.txt

it works as expected


text:
Is it possible to change file permissions on Android's internal storage?
How can I change file permission of a file on Android without rooting? I actually want to prevent some files from deletion.
Note: I am asking of changing the file permissions of user-created files in internal shared storage.

On all operating systems based on Linux kernel - like Android is - it's possible to set permissions on files (including directories) provided that filesystem supports UNIX permissions (uid, gid, mode). Common examples of such filesystems are ext4 and f2fs.
However Android's internal (confusingly called external) storage which is accessible by installed apps at /sdcard, is not an actual but virtual / emulated filesystem exposing /data/media (which is a real filesystem) through sdcardfs. sdcardfs and its predecessor FUSE expose the emulated filesystem with a fixed set of uid, gid and mask (mode). So the commands chmod and chown have no impact, whether executed through CLI (adb shell or terminal emulator) or GUI (file explorer).
It's possible to change permission bits of file on underlying actual filesystem, but accessing /data/media requires root access because only UID/GID 1023 (aid_media_rw) has read access to the directory. And still the permissions will remain same when viewed from emulated view /sdcard.
So you can't change permissions of user created files on Android, with or without root.
Further reading:

What is /storage/emulated/0/?

Related:

Why chmod gives “Operation not permitted” error?
How to remount sdcardfs to allow setting file permisions / ownerships?


text:
how to always show homescreen after unlocking?
On a Nexus 5 and I am looking for a way to configure it to always show the homescreen after unlocking it. is it possible? how?
Right now, after unlocking it shows the screen exactly as it was left it before being locked. I have not yet managed to get the habit of pressing the home button (i.e. go to homescreen) before I press the power button (i.e. lock my screen)...
p.s. this device is rooted.

Can you Include your Android version?

on that Nexus I have Android 6.0.1    On another device I have 7.1.2

It seems that the only way to get this without automation is having the habit of pressing "show desktop" before locking.
In case, you are not against automation, you can accomplish your request with MacroDroid, Tasker or other apps.
With MacroDroid

In the Triggers section, select Screen Unlocked.
In the Actions section, select Launch Home Screen.
Give the macro a name, then save it.

When you unlock the screen, the home screen will be shown (there was about 300 ms delay when testing) even if another app was in the foreground.

hhmm... yes, that it a way to get it. But I don't wish to have automation. I'd prefer to edit code somewhere with my fingertips (:


text:
How can I backup everything on an android?
I have a redmi note 5. It has been asking for updates for a while, which I have been postponing. The reason is that my previous phone, a huawei, got locked into bootloop when I did update it, so I have been weary.
But since I'm starting to cave, I was wondering if there was a way to backup absolutely, utterly everything on the phone, to the point of being able to flash it if I have to, load the data again, and end up holding the exact same phone I did before all that.

You might need to read all the answers on the duplicate first before attempting a backup.

Well, why do my search skills suck so bad these days? Sorry for the duplicate and thanks!


text:
How can I move installed apps from the old microSD card to a new one, as I swap the cards inside my phone?
In my Android phone, I have moved some installed apps from the internal storage to a MicroSD card. Now I swapped the microSD card with another microSD card inside the phone. How can I move the installed apps from the old to the new microSD card?
My phone is Kyocera Hydro Icon with Android 4.3. It seems to only have one microSD card slot and a SIM card slot inside. I can't find a second microSD card slot.
I can't move installed apps from old microSD card to my internal storage, because my phone doesn't have enough space.
Will it work if I copy the files from one sd card to the other, file by file, by connecting both microSD cards to a computer simultaneously:

inserting one microSD card to a computer, via microSD-to-SD adapter, and
inserting the other microSD card to the same computer, via keeping it inside the phone and connecting the phone to the same computer via USB cable?

Update: copy file by file from a sd card to another by connecting both to a computer doesn't make the phone work with the new sd card.

You said you swapped the microSD cards. Then later said you didn't find any microSD card slot on the phone. You are contradicting yourself. To move the apps: put the old card back on the phone. Move the apps from SD card to phone. Insert the new SD card, then move the apps from phone to SD card.

I can't move installed app from old microSD card to my phone, because my phone doesn't have enough space.

You could try Win32 Disk Imager to read an image from one MicroSD card and write it to another.
First, specify image name and press Read button:

Then change sd card and press Write button:

Moreover, if there is more storage space on the second SD card, try using free Paragon Partition Manager Community Edition to resize partition (note, FAT32 limited to 32GB):


text:
Root and unroot Cat S41
Does anyone knows how to root then unroot this device? I've just installed Termux emulator but I am not able to run some commands. The terminal's output comes with a "Permission denied" issue. I've talked with Caterpillar about rooting S41 so they told me that I may root this device but, in line with other manufacturers, CAT doesn't support this activity.

Based on Reddit and XDA Forum (1, 2), I don't think anyone has found a way to root it... for now. That said, perhaps you could clarify instead what are you trying to do when you get the "Permission denied"? Perhaps there's another way to solve your issue without rooting.

mkdir: cannot create directory ‘/dev/net’: Permission denied. Root localhost can't access network,so I think I need a root access...Have some commands too that I can't be able to run.


text:
Is it possible to access Face ID sensors raw data?
My Honor 10 has facial recognition capability in the dark, I suppose it works like Apple's Face ID which would rely on and IR camera and an Infrared pattern/dot projector.
So, since the Settings app and the Screen lock app can access those sensors, could it be possible to activate/ access those sensors data in another custom built app (on a Rooted smartphone) to use it for 3D scanning objects or simply recording the face of the user in order to 3D print a functional facial recognition "key"?

FaceId is based on infrared light sensors and depth sensing technology.
All the captured data is saved in the form of Encrypted hashes in the secure enclave.
First of all, the system doesn't allow you to read these files. But in any case
you are able to read the encrypted files, you can not decrypt them for your purpose.
All the encrypted data is saved locally.
If you are creating a new app, you can use these sensors for capturing data.


text:
How to add stickers to Samsung Keyboard?
I have made a sticker pack for Telegram.. Is there a way to integrate those stickers into Samsung Keyboard ? If so, how ?
(Stickers are private, so no publishing to Galaxy Store.I have no root on my S8)


text:
How to access other partitions from android-x86 on dual boot with ubuntu-16.04
I have android-x86 along side ubuntu-16.04 I have installed android in a 16GB partition in my harddrive. I was wondering if it is possible to access other partitions from android as it just shows nothing in the files app. It would be pointless because all my pictures videos or other files are in those others partitions. I am not an expert so please let me know if additional information is needed.

Yes, you can!
If you are new on Linux, it could be a little tricky.
Open terminal (if you don't have, install one), type:
su
mkdir /storage/windows
ntfs-3g /dev/block/sdaX /storage/windows

where X is the partition that you want to mount.

Why is it "windows"?

For the terminal, Termux is probably the best choice now for Android.


text:
lsusb returns "permission denied" in Termux
When I run lsusb in Termux, the output is permission denied. I don't have root access.
Perhaps the Android system allows me to get specific access in root?

@Irfan Latif is it possible to get a specific root access in an unrooted device? Temporary root access with a password ,for example,would be amazing for customers! Android might be more flexible ...

No (un)fortunately that's not possible. Android by-design doesn't allow that.

lsusb command lists entries in /sys/bus/usb/devices which is world-readable but SELinux would be denying access because u:r:untrusted_app:s0 context isn't allowed to access u:object_r:sysfs:s0.
However you can try adb shell lsusb because sepolicy allows u:r:shell:s0 to read the directory as defined here:
allow shell sysfs:dir r_dir_perms

And here:
define(`r_dir_perms', `{ open getattr read search ioctl lock }')

So,I tried 'adb shell lsusb' and this is the following output: $ adb shell lsusb No command 'adb' found, did you mean: Command 'ab' from package 'apache2' Command 'gdb' from package

adb is to be run from PC. Follow this simple guideline.

Using adb in an Android device, plugged in windows pc for example,have a way to run commands that wasn't allowed before in termux , whatever it will be,not only lsusb?(desmg,lsusb and some commands doesn't works too)

@J-Mello sorry can't understand what you mean.

I need to use a USB on a PC to make lsusb permissions be able.I've been wondering about,if I use termux(either on pc or in an Android device) in this scenario I would be able to use termux like my android device were rooted.


text:
Android Emulator on MacOS 10.14 has internet only after restarting machine
I've search the internet far and wide for this issue but didn't seem to have success so far. What I am experiencing:
I've set up the following environment:

Android Studio
Android Emulator using API 28
My OS is MacOS 10.14.3
Using it to build a React Native app

At the beginning I didn't have any internet, so I've added DNS of 8.8.8.8 and 8.8.4.4 to my System Preferences / Network / DNS. Also I start my avd and tell it to use those dns settings.
After I start my OS fresh and load up the avd I do have internet, loading pages via the Chrome browser. After a little while, though, maybe a minute or two the internet is dropping. Device shows I'm connected to Wi-Fi but no internet. Also Chrome stops loading pages.
Did someone experience the same problem? I've looked through logs and ran avd with -verbose option but nothing legitimate shows up.
What I'm suspecting:

Either the number of internet connections is maxed out (read of such a bug somewhere)
or file descriptors of the MacOS are maxed out

Nevertheless I don't know how to find out which is it, or how to fix it.
I'd be very happy if someone might be able to help.
Thanks in advance.

It's most likely a bug with IPv6 name resolution, removing any IPv6 nameserver in /etc/resolv.confg fixes the issue, see https://issuetracker.google.com/issues/155686508#comment3


text:
How to reset the app icons? - They get substituted by a default icon
Sometimes, the app icons just "switch" to an android icon:

For example in this screenshot, the Dropbox (center row in the left) icon is an android icon. This happens to me from time to time with many different applications.
The bad icon works properly: It still opens the application normally.
If I grab the dropbox from the all-apps folder and drag-and-drop a new shortcut, it displays correctly:

If I remove the bad icon, and leave only the correct icon it seems all normal:

Questions

Why this happens and how can I prevent it happening in the future?
Is there any way to "reset" all the bad icons in one shot?

Please provide more information about your phone, android version etc

It might be the problem of your launcher application.
Try clearing your launcher app's cache.

How can I know what application in the list of applications is my launcher? I've not installed any launcher different from what the default was and I don't know it's name...

Go to your device's system settings->Apps. Click on the small gear icon on the title bar->Default home app. There you can find the name and icon of your launcher application.

Under "Applications", I don't have that gear-menu and I don't have any "Default home app" option. I just see the list of the installed applications but I don't have any "Default home app" option there.

You can search about your phone's model in Google search engine and you can find where to get the 'Default Home App'.


text:
Allow android chrome to load unsafe scripts
When any site has mixed content (HTTPS + HTTP), and when you try to open HTTP content, on Desktop chrome, it shows a "shield" icon like screen below,

This allow user to load unsafe script.
However, the above option is not coming or not available when i open the same page in Android phone's chrome browser. My chrome app version is 71.0.3578.99
Any idea how to get above pop-up in android chrome to allow user to load unsafe scripts?

Can you provide a URL as an example?

the 1 i had an issue with i cannot share as i am not the owner of it. But basically this is easy to reproduce on any site whose page-1 is served over https and then page-2 is http. I will see if i can share such an example...

Starting with Chrome v79 the desktop version of Chrome will no longer load mixed content: https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html

I just now encountered this problem. On my PC there was a warning "sheild" at the right side of the address bar, and I was able to click it and choose the option of load unsafe scripts.  On my Android tablet no such shield was present.  Just trying things, I clicked the address line, and it showed the URL along with a short menu of three choices, among them a pencil icon for editing. I chose that, then removed the "s" from the "https" in the URL, and that worked.

So, essentially, modify the address to http:// to eliminate the certification checks and the safe route? Spent alot of words there to say that without explaining the danger.

thanks, it works for me. I know there are security issues but i am only working on testing.


text:
When Google removes malicious apps from their Play Store, are users notified?
This Check Point Research article describes over 200 malicious apps on the Google Play Store that were downloaded over 100 million times.  Google has now removed the apps from their Play Store.
But what happens to the millions of people who have this software on their Android devices?  Are they somehow notified by Google?  Does Google automatically offer to uninstall the software for them?
Or are millions of users left with malicious apps on their Android devices?

By default, no. This would require Google to sniff the apps in your phone, in which they should ask your permission to do so.
However, there is this:
Google Play Protect

How Google Play Protect works
Google Play Protect checks apps when you install them. It also
  periodically scans your device. If it finds a potentially harmful app,
  it might:
Warn you. If an app is detected that may be harmful to your device,
  you’ll get a notification. To remove the app, tap Uninstall on the
  notification. Google Play Protect might also disable the app to keep
  it from running until you uninstall it.
Remove the app automatically.
  In some cases, if a harmful app has been detected, you may get a
  notification saying the app was removed.