# Question
Title: Enabling Wireguard tunnel through ADB shell
I'm trying to enable and disable Wireguard tunnels through the ADB shell.

I can see the followings actions and receivers are available :

```
adb:# dumpsys package com.wireguard.android
...
Receiver Resolver Table:
  Non-Data Actions:
      com.wireguard.android.action.SET_TUNNEL_UP:
        4166aa1 com.wireguard.android/.model.TunnelManager$IntentReceiver filter 631a6bf
          Action: "com.wireguard.android.action.REFRESH_TUNNEL_STATES"
          Action: "com.wireguard.android.action.SET_TUNNEL_UP"
          Action: "com.wireguard.android.action.SET_TUNNEL_DOWN"
      com.wireguard.android.action.REFRESH_TUNNEL_STATES:
        4166aa1 com.wireguard.android/.model.TunnelManager$IntentReceiver filter 631a6bf
          Action: "com.wireguard.android.action.REFRESH_TUNNEL_STATES"
          Action: "com.wireguard.android.action.SET_TUNNEL_UP"
          Action: "com.wireguard.android.action.SET_TUNNEL_DOWN"
      com.wireguard.android.action.SET_TUNNEL_DOWN:
        4166aa1 com.wireguard.android/.model.TunnelManager$IntentReceiver filter 631a6bf
          Action: "com.wireguard.android.action.REFRESH_TUNNEL_STATES"
          Action: "com.wireguard.android.action.SET_TUNNEL_UP"
          Action: "com.wireguard.android.action.SET_TUNNEL_DOWN"
      android.intent.action.BOOT_COMPLETED:
        4f4cb74 com.wireguard.android/.BootShutdownReceiver filter 426c4de
          Action: "android.intent.action.ACTION_SHUTDOWN"
          Action: "android.intent.action.BOOT_COMPLETED"
      android.intent.action.ACTION_SHUTDOWN:
        4f4cb74 com.wireguard.android/.BootShutdownReceiver filter 426c4de
          Action: "android.intent.action.ACTION_SHUTDOWN"
          Action: "android.intent.action.BOOT_COMPLETED"
...

```

Looking at the package's sourcecode, I see that `com.wireguard.android/.model.TunnelManager$IntentReceiver` asks for the name of the tunnel to enable/disable to be passed as an extra string :

```
 val tunnelName = intent.getStringExtra("tunnel") ?: return@launch
 val tunnels = manager.getTunnels()
 val tunnel = tunnels[tunnelName] ?: return@launch

```

So I tried two different versions of the same command to enable a tunnel named `my-tunnel` :

```

adb:# am broadcast -a com.wireguard.android.action.SET_TUNNEL_UP -e tunnel my-tunnel
Broadcasting: Intent { act=com.wireguard.android.action.SET_TUNNEL_UP flg=0x400000 (has extras) }
Broadcast completed: result=0
# am broadcast -a com.wireguard.android.action.SET_TUNNEL_UP -e tunnel my-tunnel -n com.wireguard.android/.model.TunnelManager$IntentReceiver
Broadcasting: Intent { act=com.wireguard.android.action.SET_TUNNEL_UP flg=0x400000 cmp=com.wireguard.android/.model.TunnelManager (has extras) }
Broadcast completed: result=0

```

But after checking on my phone `my-tunnel` is still disabled.

What am I missing ? Note that I'm pretty new to using ADB commands so it might be something obvious.

# Answer
> 2 votes
This is the most reliable way that I have found:

```
am broadcast -a com.wireguard.android.action.SET_TUNNEL_UP -n 'com.wireguard.android/.model.TunnelManager$IntentReceiver' -e tunnel <tunnel_name>
am broadcast -a com.wireguard.android.action.SET_TUNNEL_DOWN -n 'com.wireguard.android/.model.TunnelManager$IntentReceiver' -e tunnel <tunnel_name>

```

Notes:

* This only works if adb has root rights.
* You need to enable "Allow remote control apps" under "Advanced" in the settings of the WireGuard app.
* If you also want this to work when the WireGuard app is not running, you need to disable background battery optimizations for the app.

---
Tags: adb, vpn
---


# Question
Title: ADB sideload regularly loads LineageOS ROM, but gets stuck at 0% with stock firmware, why?
I'm trying to restore the stock firmware for a Samsung S10e.

It's currently setup with the LineageOS recovery image, and the LineageOS firmware.

I've rebooted in the (LineageOS) recovery, factory reset everything, and now I'm trying to sideloading the factory image (`G970foo_bar_baz.zip`), however, it's stuck at 0%.

If I try to sideload LineageOS again, it sideloads without any problem.

Should I keep waiting?

Since the factory ROM is very large (5.9GiB vs 800 MiB), it's possible that it's normal that it takes a long time before the sideload starts, however, I don't know how long should I wait.

# Answer
Not every ZIP file can be side-loaded.

I am not sure what properties need to be fulfilled by an ZIP file that can be side-loaded.

One indicator is the existence of the directory `META-INF/com/google/android/` inside the ZIP file. And inside there should be an file named `updater-script` which is required for installing the ZIP file via side-loading.

If that file is not present then most likely your ZIP file is not side-lodeable.
> 1 votes

---
Tags: adb, factory-reset, stock-rom, side-loading, factory-image
---


# Question
Title: Google On-device encryption Google Passwords
I recently decided to enhance my online security by changing all my passwords and activating Two-Factor authentication for most of the services I use. I updated my passwords in Google Password Manager and enabled on-device encryption.

After updating my Google Account password, I was automatically logged out of all my devices. However, when I tried to access my passwords in Google Password Manager, I received a message saying that I couldn't access my encrypted data on the device I was using. The message suggested that I should try using a device that I recently used to sign in to my Google account:

> for security, you can no longer access your encrypted data on this device. try again using a device that you’ve recently used to sign in to your google account.

What I have tried:

1. Checked the Web & App Activities settings on your Google Account and turned it Off and then On again.
2. Checked the cookies settings on your browser.
3. Confirmed that Sync is not paused in Google Chrome.
4. Cleared data in Google Chrome and turned Sync off, signed back in, and turned Sync on again.
5. Checked the Device Activity page on your Google Account and confirmed that Sync is On and not paused on the devices you recently signed out of.
6. Restarted my device and waited for bookmarks and passwords to load.

Despite trying these steps,I still cannot access my encrypted data on the device I am using, and I am looking for further help.

# Answer
So I found my answer, there is a message saying that you need to complete Chrome's safety check:

> You’re using on-device encryption. To check your passwords, go to Password Manager on Android or use Chrome’s safety check.

After this you should be able to access your passwords again.
> 0 votes

---
Tags: security, google-account, google
---


# Question
Title: How do l solve issues on "Download Boot Loader 0%" on SP Flash Tool?
I bought a UMIDIGI A3 running Android 8.1. The phone got bricked after an upgrade was done via OTA.

I tried to restore the phone through the use of the SP Flash Tool. My problem is each time the process began, it got terminated on “Download Boot Loader 0 %”. Although this is weird because I haven’t had such experience with SP Flash Tool before.

How do I solve this issue and get back my phone?

# Answer
Uncheck *preloader* entry in that screen you shared in the screenshot and then click the Download process. I tested this and it works.
> -1 votes

---
Tags: rom-flashing, sp-flash-tool
---


title: Fastboot freezes on Mac OS Sierra

text:
# Question
Title: Fastboot freezes on Mac OS Sierra
I just got a new MacBook 2016 with Mac OS Sierra installed, after setting up my complete development environment and all required tools via Android Studio, I tried to flash a new Android Wear release on my watch.

ADB is working without issues, but as soon as I try to run any `fastboot` command (other than `fastboot help`) it will completely freeze and never finish.

It is just stuck with no output at all.

I already tried to run it with `sudo` or reinstall it via the SDK Manager, I also tried different standalone `fastboot` binaries provided on XDA developers.

There is nothing which seems to make it finish. Even "ctrl + c" won't exit the running command. Only killing it via the process list will work.

# Answer
> 3 votes
So this was an official Android fastboot bug. They are currently testing a fix in their QA department.

With the new platform tools release it will be fixed: https://code.google.com/p/android/issues/detail?id=231129

# Answer
> 2 votes
Not really a solution but a workaround: I've been having the same issue without finding anything online. Am using a 2016 Macbook Pro, Nexus 4 and a USB A to micro USB cable with an A-to-C adaptor.

I used Parallels to run a virtual Ubuntu machine and installed `fastboot` there (as per here to minimize storage usage). When I plug my phone in I tell Parallels to connect it to the virtual machine. Not ideal, but at least I can use `fastboot`!

# Answer
> 2 votes
Google has released an update to **Android Platform Tools** that fixes this. You can use Homebrew to install the latest version:

```
brew update
brew install android-platform-tools

```

---

Once you update to revision `25.0.4` or above, `fastboot` will no longer hang on Macbook Pro 2016 / MacOS Sierra. From its changelog:

> ## 25.0.4 (March 16, 2017)
>
> * Added experimental `libusb` support to Linux and Mac `adb`
>
> To use the `libusb` backend, set the environment variable `ADB_LIBUSB=true` before launching a new `adb server`. The new `adb host-features` command will tell you whether or not you're using `libusb`.
>
> To restart adb with libusb and check that it worked, use
>
> ```
> adb kill-server; ADB_LIBUSB=1 adb start-server; adb host-features`
>
> ```
>
> The output should include "libusb".
>
> In this release, the old non-libusb implementation remains the default.
>
> * `fastboot` doesn't hang 2016 MacBook Pros anymore (bug 231129)
> * Fixed Systrace command line capture on Mac

# Answer
> 0 votes
Similar symptoms, different versions. On a Macbook Air M1, with a phone connected over USB-C, `adb` worked fine for me but `fastboot` (34.0.0 from Homebrew) just hung there (though in my case `Ctrl+C` worked).

The solution for me was to plug the device in a different port. Only the port closest to the back worked for fastboot.

---
Tags: fastboot, terminal, command-line, macos
---


# Question
Title: Change Facebook (and others) photo saving folder
I'd like to ask a question about the facebook app (but it is not only one that does this). Currently, when I save any photo from facebook, it saves into /DCIM/Facebook.

Now I would not normally care where the photos are stored as long as Gallery app sorts them right, but the fact it goes into DCIM folder makes it behave wrongly with the Google Photos app.

Google Photos treat all those Facebook saved posts as "Camera photos" and tries to synchronize them to server, which I obviously do not want (I store photo albums on GPh, I do not need meme pics among them) and I cannot refine the synchronize options any more (only "Camera" is chosen to sync).

Is there a way to exclude those downloaded pictures from sync? Or make Facebook save its downloads to, say, /Pictures/Facebook ?

Same as above also happens in DCIM/Screenshots while clipping parts of screen.

Phone is Samsung Galaxy Note 4, Android 6.0.1

Thanks in advance

# Answer
I had EXACTLY the same problem. I couldn't find a solution else where. The only solution was to use a .nomedia file in the `/sdcard/DCIM/Facebook` directory and moving the \*.jpgs to another folder. I had made a Tasker task referring to a reddit post in /r/tasker. Here is the description and the XML for importing it. You have to create the `%destpart` and add a `.nomedia` in `%sourcepath` for it to work. You can run this task in a profile as an exit task for Facebook and as an entry task for other messenger apps like Telegram/Whatsapp, etc. so you get your memes right!

```
The Meme Mover (3)
A1: Variable Set [ Name:%sourcepath To:/sdcard/DCIM/Facebook/ Recurse Variables:Off Do Maths:Off Append:Off ]
A2: Variable Set [ Name:%destpath To:/sdcard/Pictures/Facebook/ Recurse Variables:Off Do Maths:Off Append:Off ]
A3: Variable Set [ Name:%suffix To:(1) Recurse Variables:Off Do Maths:Off Append:Off ]
A4: Variable Set [ Name:%counter To:0 Recurse Variables:Off Do Maths:On Append:Off ]
A5: List Files [ Dir:%sourcepath Match:*.jpg/*.png/*.jpeg/*.gif/*.3gp Include Hidden Files:Off Use Root:Off Sort Select:Alphabetic Variable:%filestomove ]
A6: For [ Variable:%thispathfile Items:%filestomove() ]
A7: Variable Split [ Name:%thispathfile Splitter:/ Delete Base:Off ]
A8: Variable Set [ Name:%len To:%thispathfile(#) Recurse Variables:Off Do Maths:Off Append:Off ]
A9: Variable Set [ Name:%filename To:%thispathfile(%len) Recurse Variables:Off Do Maths:Off Append:Off ]
A10: Variable Clear [ Name:%exists Pattern Matching:Off ]
A11: Test File [ Type:Type Data:%destpath%filename Store Result In:%exists Use Root:Off Continue Task After Error:On ]
A12: If [ %exists !Set ]
A13: Move [ From:%thispathfile To:%destpath%filename Use Root:Off ]
A14: Scan Card [ File:%destpath%filename ]
A15: Else
A16: Variable Split [ Name:%filename Splitter:. Delete Base:Off ]
A17: Variable Set [ Name:%filename1 To:%filename1%suffix Recurse Variables:Off Do Maths:Off Append:Off ]
A18: Variable Join [ Name:%filename Joiner:. Delete Parts:Off ]
A19: Move [ From:%thispathfile To:%destpath%filename Use Root:Off ]
A20: Scan Card [ File:%destpath%filename ]
A21: End If
A22: Variable Add [ Name:%counter Value:1 Wrap Around:0 ]
A23: End For
A24: If [ %counter eq 0 ]
A25: [X] Flash [ Text:No memes? Sad. Long:On ]
A26: Else If [ %counter eq 1 ]
A27: Flash [ Text:%counter meme moved! Long:On ]
A28: Else
A29: Flash [ Text:%counter memes moved! Long:On ]

```

**Remember to have .nomedia in %sourcepath**

Here's the XML for direct import:

```
<TaskerData sr="" dvi="1" tv="4.9u4">
<Task sr="task3">
    <cdate>1489093858387</cdate>
    <edate>1489219027762</edate>
    <id>3</id>
    <nme>The Meme Mover</nme>
    <pri>100</pri>
    <Kid sr="Kid">
        <launchID>3</launchID>
        <pkg>me.regalstreak.movefb</pkg>
        <vnme>1.0</vnme>
    </Kid>
    <Action sr="act0" ve="7">
        <code>547</code>
        <Str sr="arg0" ve="3">%sourcepath</Str>
        <Str sr="arg1" ve="3">/sdcard/DCIM/Facebook/</Str>
        <Int sr="arg2" val="0"/>
        <Int sr="arg3" val="0"/>
        <Int sr="arg4" val="0"/>
    </Action>
    <Action sr="act1" ve="7">
        <code>547</code>
        <Str sr="arg0" ve="3">%destpath</Str>
        <Str sr="arg1" ve="3">/sdcard/Pictures/Facebook/</Str>
        <Int sr="arg2" val="0"/>
        <Int sr="arg3" val="0"/>
        <Int sr="arg4" val="0"/>
    </Action>
    <Action sr="act10" ve="7">
        <code>342</code>
        <se>false</se>
        <Int sr="arg0" val="4"/>
        <Str sr="arg1" ve="3">%destpath%filename</Str>
        <Str sr="arg2" ve="3">%exists</Str>
        <Int sr="arg3" val="0"/>
    </Action>
    <Action sr="act11" ve="7">
        <code>37</code>
        <ConditionList sr="if">
            <Condition sr="c0" ve="3">
                <lhs>%exists</lhs>
                <op>13</op>
                <rhs></rhs>
            </Condition>
        </ConditionList>
    </Action>
    <Action sr="act12" ve="7">
        <code>400</code>
        <Str sr="arg0" ve="3">%thispathfile</Str>
        <Str sr="arg1" ve="3">%destpath%filename</Str>
        <Int sr="arg2" val="0"/>
    </Action>
    <Action sr="act13" ve="7">
        <code>459</code>
        <Str sr="arg0" ve="3">%destpath%filename</Str>
    </Action>
    <Action sr="act14" ve="7">
        <code>43</code>
    </Action>
    <Action sr="act15" ve="7">
        <code>590</code>
        <Str sr="arg0" ve="3">%filename</Str>
        <Str sr="arg1" ve="3">.</Str>
        <Int sr="arg2" val="0"/>
    </Action>
    <Action sr="act16" ve="7">
        <code>547</code>
        <Str sr="arg0" ve="3">%filename1</Str>
        <Str sr="arg1" ve="3">%filename1%suffix</Str>
        <Int sr="arg2" val="0"/>
        <Int sr="arg3" val="0"/>
        <Int sr="arg4" val="0"/>
    </Action>
    <Action sr="act17" ve="7">
        <code>592</code>
        <Str sr="arg0" ve="3">%filename</Str>
        <Str sr="arg1" ve="3">.</Str>
        <Int sr="arg2" val="0"/>
    </Action>
    <Action sr="act18" ve="7">
        <code>400</code>
        <Str sr="arg0" ve="3">%thispathfile</Str>
        <Str sr="arg1" ve="3">%destpath%filename</Str>
        <Int sr="arg2" val="0"/>
    </Action>
    <Action sr="act19" ve="7">
        <code>459</code>
        <Str sr="arg0" ve="3">%destpath%filename</Str>
    </Action>
    <Action sr="act2" ve="7">
        <code>547</code>
        <Str sr="arg0" ve="3">%suffix</Str>
        <Str sr="arg1" ve="3">(1)</Str>
        <Int sr="arg2" val="0"/>
        <Int sr="arg3" val="0"/>
        <Int sr="arg4" val="0"/>
    </Action>
    <Action sr="act20" ve="7">
        <code>38</code>
    </Action>
    <Action sr="act21" ve="7">
        <code>888</code>
        <Str sr="arg0" ve="3">%counter</Str>
        <Int sr="arg1" val="1"/>
        <Int sr="arg2" val="0"/>
    </Action>
    <Action sr="act22" ve="7">
        <code>40</code>
    </Action>
    <Action sr="act23" ve="7">
        <code>37</code>
        <ConditionList sr="if">
            <Condition sr="c0" ve="3">
                <lhs>%counter</lhs>
                <op>0</op>
                <rhs>0</rhs>
            </Condition>
        </ConditionList>
    </Action>
    <Action sr="act24" ve="7">
        <code>548</code>
        <on>false</on>
        <Str sr="arg0" ve="3">No memes? Sad.</Str>
        <Int sr="arg1" val="1"/>
    </Action>
    <Action sr="act25" ve="7">
        <code>43</code>
        <ConditionList sr="if">
            <Condition sr="c0" ve="3">
                <lhs>%counter</lhs>
                <op>0</op>
                <rhs>1</rhs>
            </Condition>
        </ConditionList>
    </Action>
    <Action sr="act26" ve="7">
        <code>548</code>
        <Str sr="arg0" ve="3">%counter meme moved!</Str>
        <Int sr="arg1" val="1"/>
    </Action>
    <Action sr="act27" ve="7">
        <code>43</code>
    </Action>
    <Action sr="act28" ve="7">
        <code>548</code>
        <Str sr="arg0" ve="3">%counter memes moved!</Str>
        <Int sr="arg1" val="1"/>
    </Action>
    <Action sr="act3" ve="7">
        <code>547</code>
        <Str sr="arg0" ve="3">%counter</Str>
        <Str sr="arg1" ve="3">0</Str>
        <Int sr="arg2" val="0"/>
        <Int sr="arg3" val="1"/>
        <Int sr="arg4" val="0"/>
    </Action>
    <Action sr="act4" ve="7">
        <code>412</code>
        <Str sr="arg0" ve="3">%sourcepath</Str>
        <Str sr="arg1" ve="3">*.jpg/*.png/*.jpeg/*.gif/*.3gp</Str>
        <Int sr="arg2" val="0"/>
        <Int sr="arg3" val="0"/>
        <Int sr="arg4" val="0"/>
        <Str sr="arg5" ve="3">%filestomove</Str>
    </Action>
    <Action sr="act5" ve="7">
        <code>39</code>
        <Str sr="arg0" ve="3">%thispathfile</Str>
        <Str sr="arg1" ve="3">%filestomove()</Str>
    </Action>
    <Action sr="act6" ve="7">
        <code>590</code>
        <Str sr="arg0" ve="3">%thispathfile</Str>
        <Str sr="arg1" ve="3">/</Str>
        <Int sr="arg2" val="0"/>
    </Action>
    <Action sr="act7" ve="7">
        <code>547</code>
        <Str sr="arg0" ve="3">%len</Str>
        <Str sr="arg1" ve="3">%thispathfile(#)</Str>
        <Int sr="arg2" val="0"/>
        <Int sr="arg3" val="0"/>
        <Int sr="arg4" val="0"/>
    </Action>
    <Action sr="act8" ve="7">
        <code>547</code>
        <Str sr="arg0" ve="3">%filename</Str>
        <Str sr="arg1" ve="3">%thispathfile(%len)</Str>
        <Int sr="arg2" val="0"/>
        <Int sr="arg3" val="0"/>
        <Int sr="arg4" val="0"/>
    </Action>
    <Action sr="act9" ve="7">
        <code>549</code>
        <Str sr="arg0" ve="3">%exists</Str>
        <Int sr="arg1" val="0"/>
    </Action>
    <Img sr="icn" ve="2">
        <cls>com.facebook.katana.LoginActivity</cls>
        <pkg>com.facebook.katana</pkg>
    </Img>
</Task></TaskerData>

```

Copy the code above and save the file as `The Meme Mover.tsk.xml` in `/sdcard/Tasker/tasks`. Then go to Tasker, long press on Tasks, and import this.

Pro Tip: Enable A25 just for testing if you want to.

Edit: Code corrected and updated. (1 memes moved was triggering my OCD.)

Edit 2: Had some problems, corrected again.
> 9 votes

# Answer
Anyone else looking this in the future and don't know how to use Tasker or find it difficult to understand.

1. Download this app.
2. Go to organizer section.
3. Make a service job to move files as soon they are found in the Facebook folder to some other folder.

Hope you don't have Meme UI or Samsung which kills everything in the background. If that's the case, check this.
> 3 votes

# Answer
I stumbled across the Tasker answer above while searching for a way to deal with Facebook's image downloads, and while it mostly works fine for Facebook, there are some issues with it, especially when you try to extend its functionality to other scenarios.

I'm completely new to Tasker, so it took me a while to figure it out, but after a day of tinkering, I've made some big improvements to the task. The main issues with the original version that I've solved are:

1. While the original version could detect if the file being moved already existed in the destination directory, it could only handle one iteration of the conflict. For example, if example.jpg were being moved, but it already existed, it would rename the file being moved to example(1).jpg. However, if example.jpg were being moved and both example.jpg and example(1).jpg already existed, it would simply overwrite example(1).jpg.
    * My version will run an iterative check on names which increments the suffix variable until a non-existing name is found. For example, if example.jpg is taken, it will check example(2).jpg. If that is taken, it will check example(3).jpg, and so on until an available name is found. It also correctly appends the first duplicate with (2) rather than (1).
2. The original version assumed the first "." in a file name was also the last "." before the extension. While this is fine for images from Facebook, it's not an ideal assumption, and breaks down when adopting the task for other uses, such as moving APKs. With the original, if com.example.app.apk already existed in the destination directory, trying to move a second copy of it would result in com(1).example.app.apk.
    * In addition to fixing the suffix and making it iterative, I've also changed the logic for its placement, such that it will always go before the last ".". In the above example, the apk would now be renamed to com.example.app(2).apk. This doesn't always work perfectly (consider .tar.gz and other similar cases for instance), but it does a good enough job without having to hard-code in every possible extension.
3. This appears to vary from device to device, but on my devices, the original version would leave behind broken references to images in gallery apps and other programs that utilize the media provider (most messaging apps that have an image selection UI) due to not correctly refreshing this data. This was not an issue for moving images out of a directory containing a .nomedia file, but caused issues if you wanted to use it in a directory where you didn't want or couldn't have a .nomedia file (such as automatically moving downloaded images out of /sdcard/Download/).
    * Tasker's Scan Media action seems to act in wildly different ways depending on not only the Android version, but also the vendor variant you're using. I've fixed the issue on my devices (and hopefully many of yours) by running a Scan Media action on not only the file in it's destination directory, but also on the original file path (referencing the file that's no longer there).

I also updated variable names for clarity, and rather than using events that trigger when entering or exiting apps, I've set it to run on a File Modified event monitoring the source folder, with the event set to Closed Write. This works for most purposes, but breaks in some cases. You can fix most issues by either using a different event parameter (such as Create, Modify, or Move To) or by using stricter regex in Action 3 of the task.

> I've heard that devices with slower storage (or slow external SD cards) can have issues with this if files take too long to write. In that case, you may have to experiment with adding delays or using different methods to trigger the task.

I'm attaching not just the task here, but the entire project I've created, containing multiple copies of the task for various use cases, and their respective profiles to trigger them, so that beginners who are new to Tasker can easily get started using this task and have some examples to reference when adopting the task to their own needs.

The examples included in this project are:

* When Facebook downloads an image to /sdcard/DCIM/Facebook, move it to /sdcard/Pictures/Facebook.
* When Samsung Notes saves an image to /sdcard/DCIM/Samsung Notes/, move it to /sdcard/Pictures/Samsung Notes/. (This works, but Samsung Notes will claim it failed to save the image, due to it checking for the image after it has already been moved by Tasker.)
* When you create a GIF using Smart Select, move it from /sdcard/DCIM/GIF/ to /sdcard/Pictures/Smart Select GIFs/.
* When you export an APK from ReVanced Manager to /sdcard/Download/APKs/Original/, move it to /sdcard/Download/APKs/Modded/.
* When a new file is detected in /sdcard/Download/ . . .
    + if it's a download from Craiyon, move it to /sdcard/Pictures/Craiyon/
    + if it's an APK, APKM, APKS, or XAPK file, move it to /sdcard/Download/APKs/Original, *unless* it is base.apk (I leave that file in Download since I use it for other things.)

Remember to first create the source and destination directories before testing the examples. I also encourage you to check Action 3 in each example task (some of them use simple matching and others use regex) for a better understanding of how they work.

Now that that's out of the way, here's the project. You can import it directly to Tasker from there, or download it as an XML. If you choose to download it, save it in /sdcard/Tasker/projects/. You can then long press on the home icon on the bottom left corner of Tasker to import the project.

Unfortunately the entire XML is too long to post here directly, but for the sake of keeping this answer as complete as possible, I'm including the XML for *just* the Facebook task below. I strongly recommend that beginners import the entire project using the link above however, so you can get an idea of how to customize the task for your own needs.

The Facebook task:

```
<TaskerData sr="" dvi="1" tv="6.0.10">
    <Task sr="task3">
        <cdate>1489093858387</cdate>
        <edate>1677367714628</edate>
        <id>3</id>
        <nme>Move Facebook Images</nme>
        <pri>6</pri>
        <Kid sr="Kid">
            <launchID>3</launchID>
            <pkg>me.regalstreak.movefb</pkg>
            <vTarg>21</vTarg>
            <vnme>1.0</vnme>
        </Kid>
        <Action sr="act0" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%sourcedir</Str>
            <Str sr="arg1" ve="3">/sdcard/DCIM/Facebook/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act1" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%destdir</Str>
            <Str sr="arg1" ve="3">/sdcard/Pictures/Facebook/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act10" ve="7">
            <code>37</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%fileexists</lhs>
                    <op>12</op>
                    <rhs></rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act11" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">%currentfilepath(%pathlen)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act12" ve="7">
            <code>888</code>
            <Str sr="arg0" ve="3">%suffix</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act13" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">.</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act14" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%namelen</Str>
            <Str sr="arg1" ve="3">%currentfilename(#)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act15" ve="7">
            <code>890</code>
            <Str sr="arg0" ve="3">%namelen</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act16" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename(%namelen)</Str>
            <Str sr="arg1" ve="3">%currentfilename(%namelen)%null()(%suffix)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act17" ve="7">
            <code>592</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">.</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act18" ve="7">
            <code>135</code>
            <Int sr="arg0" val="0"/>
            <Int sr="arg1" val="10"/>
            <Str sr="arg2" ve="3"/>
        </Action>
        <Action sr="act19" ve="7">
            <code>38</code>
        </Action>
        <Action sr="act2" ve="7">
            <code>412</code>
            <Str sr="arg0" ve="3">%sourcedir</Str>
            <Str sr="arg1" ve="3">*.jpg/*.png/*.jpeg/*.gif/*.3gp</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Str sr="arg5" ve="3">%filelist</Str>
            <Int sr="arg6" val="1"/>
        </Action>
        <Action sr="act20" ve="7">
            <code>400</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">%destdir%currentfilename</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="1"/>
        </Action>
        <Action sr="act21" ve="7">
            <code>459</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
        </Action>
        <Action sr="act22" ve="7">
            <code>459</code>
            <Str sr="arg0" ve="3">%destdir%currentfilename</Str>
        </Action>
        <Action sr="act23" ve="7">
            <code>888</code>
            <Str sr="arg0" ve="3">%counter</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act24" ve="7">
            <code>40</code>
        </Action>
        <Action sr="act25" ve="7">
            <code>37</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%counter</lhs>
                    <op>0</op>
                    <rhs>0</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act26" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">No memes? Sad.</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act27" ve="7">
            <code>43</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%counter</lhs>
                    <op>0</op>
                    <rhs>1</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act28" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">%counter meme moved!</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act29" ve="7">
            <code>43</code>
        </Action>
        <Action sr="act3" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%suffix</Str>
            <Str sr="arg1" ve="3">1</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act30" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">%counter memes moved!</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act4" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%counter</Str>
            <Str sr="arg1" ve="3">0</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="1"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act5" ve="7">
            <code>39</code>
            <coll>false</coll>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">%filelist()</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act6" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act7" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%pathlen</Str>
            <Str sr="arg1" ve="3">%currentfilepath(#)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act8" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">%currentfilepath(%pathlen)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act9" ve="7">
            <code>342</code>
            <se>false</se>
            <Int sr="arg0" val="4"/>
            <Str sr="arg1" ve="3">%destdir%currentfilename</Str>
            <Str sr="arg2" ve="3">%fileexists</Str>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="1"/>
        </Action>
        <Img sr="icn" ve="2">
            <cls>com.facebook.katana.LoginActivity</cls>
            <pkg>com.facebook.katana</pkg>
        </Img>
    </Task>
</TaskerData>

```
> 0 votes

---
Tags: photos, facebook, google-photos
---


# Question
Title: How can I fix this issue associated with the Facebook app's folder location and Google Photos backups?
I have an issue with a combination of the Facebook and Google Photos apps on my Pixel 4 XL.

The folder Facebook stores the images you save from it is in the DCIM folder. Photos you take with your phone camera are also in the DCIM folder, in a Camera subfolder. Google lops all content within the DCIM folder into a virtual folder called Camera, completely ignoring the subfolder structure within DCIM. So whenever you have to navigate folder structures to select an image, both the images saved on Facebook and the ones taken with the camera are shown in the same location of the virtual Camera folder - the actual subfolders are hidden by the virtual folder.

This is problematic because Google photos can't distinguish these subfolders either. The option to back up files with Google One can only be set on the virtual folder level. So, I can either back up my camera photos AND any Facebook images I've saved, or nothing. I save a lot of memes and they're cluttering up my Google photos. I want to stop backing up the Facebook images.

As far as I can see it, any of the following would solve my problem

* Facebook saves to a different folder not within existing DCIM folder
* Facebook allows you to select which folder to save files in
* Android doesn't allow virtual folders to totally obscure physical folders, to where we could still specify not to back up the Facebook directory in Google Photos
* Google Photos offers some ability to control when backups occur (eg only when charging so I could move the files before they're backed up)
* Google Photos has the concept of a bidirectional sync to where local deletion/movement removes the backed up copies

None of these appear to be offered. The one path I did go down myself was installing the app FolderSync which is supposed to be able to instantly move files from one folder (DCIM/Facebook) to another (just Facebook, with Photos backup disabled on that folder). It seems to move the files right as they're saved, but it does not seem to preempt Google Photos from indexing and backing up the files first so this doesn't work. It also breaks the media index and I have to restart my phone or use an app that manually triggers a media rescan (or else all the original files in the DCIM subfolder appear as error thumbnails during media selection, and the destination ones don't appear).

There are a bunch of posts on reddit and Google support forums about this with no fix indicated. This has been bugging me for many reasons - wastes Google One storage, clutters it up so it's harder to find actual images I took (probably have 10x as many images saved from Facebook vs photos I took), didn't exist in earlier Android versions and would've been able to avoid it with control options that have since been removed, etc.

# Answer
Use my beginner friendly Tasker project which I made based on this answer. I made some significant improvements that allow it to be used for many other scenarios beyond just moving Facebook's images, and included multiple examples within the project to learn from:

1. While the original version could detect if the file being moved already existed in the destination directory, it could only handle one iteration of the conflict. For example, if example.jpg were being moved, but it already existed, it would rename the file being moved to example(1).jpg. However, if example.jpg were being moved and both example.jpg and example(1).jpg already existed, it would simply overwrite example(1).jpg.
    * My version will run an iterative check on names which increments the suffix variable until a non-existing name is found. For example, if example.jpg is taken, it will check example(2).jpg. If that is taken, it will check example(3).jpg, and so on until an available name is found. It also correctly appends the first duplicate with (2) rather than (1).
2. The original version assumed the first "." in a file name was also the last "." before the extension. While this is fine for images from Facebook, it's not an ideal assumption, and breaks down when adopting the task for other uses, such as moving APKs. With the original, if com.example.app.apk already existed in the destination directory, trying to move a second copy of it would result in com(1).example.app.apk.
    * In addition to fixing the suffix and making it iterative, I've also changed the logic for its placement, such that it will always go before the last ".". In the above example, the apk would now be renamed to com.example.app(2).apk. This doesn't always work perfectly (consider .tar.gz and other similar cases for instance), but it does a good enough job without having to hard-code in every possible extension.
3. This appears to vary from device to device, but on my devices, the original version would leave behind broken references to images in gallery apps and other programs that utilize the media provider (most messaging apps that have an image selection UI) due to not correctly refreshing this data. This was not an issue for moving images out of a directory containing a .nomedia file, but caused issues if you wanted to use it in a directory where you didn't want or couldn't have a .nomedia file (such as automatically moving downloaded images out of /sdcard/Download/).
    * Tasker's Scan Media action seems to act in wildly different ways depending on not only the Android version, but also the vendor variant you're using. I've fixed the issue on my devices (and hopefully many of yours) by running a Scan Media action on not only the file in it's destination directory, but also on the original file path (referencing the file that's no longer there).

I also updated variable names for clarity, and rather than using events that trigger when entering or exiting apps, I've set it to run on a File Modified event monitoring the source folder, with the event set to Closed Write. This works for most purposes, but breaks in some cases. You can fix most issues by either using a different event parameter (such as Create, Modify, or Move To) or by using stricter regex in Action 3 of the task.

> I've heard that devices with slower storage (or slow external SD cards) can have issues with this if files take too long to write. In that case, you may have to experiment with adding delays or using different methods to trigger the task.

I'm attaching not just the task here, but the entire project I've created, containing multiple copies of the task for various use cases, and their respective profiles to trigger them, so that beginners who are new to Tasker can easily get started using this task and have some examples to reference when adopting the task to their own needs.

The examples included in this project are:

* When Facebook downloads an image to /sdcard/DCIM/Facebook, move it to /sdcard/Pictures/Facebook.
* When Samsung Notes saves an image to /sdcard/DCIM/Samsung Notes/, move it to /sdcard/Pictures/Samsung Notes/. (This works, but Samsung Notes will claim it failed to save the image, due to it checking for the image after it has already been moved by Tasker.)
* When you create a GIF using Smart Select, move it from /sdcard/DCIM/GIF/ to /sdcard/Pictures/Smart Select GIFs/.
* When you export an APK from ReVanced Manager to /sdcard/Download/APKs/Original/, move it to /sdcard/Download/APKs/Modded/.
* When a new file is detected in /sdcard/Download/ . . .
    + if it's a download from Craiyon, move it to /sdcard/Pictures/Craiyon/
    + if it's an APK, APKM, APKS, or XAPK file, move it to /sdcard/Download/APKs/Original, *unless* it is base.apk (I leave that file in Download since I use it for other things.)

Remember to first create the source and destination directories before testing the examples. I also encourage you to check Action 3 in each example task (some of them use simple matching and others use regex) for a better understanding of how they work.

Now that that's out of the way, here's the project. You can import it directly to Tasker from there, or download it as an XML. If you choose to download it, save it in /sdcard/Tasker/projects/. You can then long press on the home icon on the bottom left corner of Tasker to import the project.

Unfortunately the entire XML is too long to post here directly, but for the sake of keeping this answer as complete as possible, I'm including the XML for *just* the Facebook task below. I strongly recommend that beginners import the entire project using the link above however, so you can get an idea of how to customize the task for your own needs.

The Facebook task:

```
<TaskerData sr="" dvi="1" tv="6.0.10">
    <Task sr="task3">
        <cdate>1489093858387</cdate>
        <edate>1677367714628</edate>
        <id>3</id>
        <nme>Move Facebook Images</nme>
        <pri>6</pri>
        <Kid sr="Kid">
            <launchID>3</launchID>
            <pkg>me.regalstreak.movefb</pkg>
            <vTarg>21</vTarg>
            <vnme>1.0</vnme>
        </Kid>
        <Action sr="act0" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%sourcedir</Str>
            <Str sr="arg1" ve="3">/sdcard/DCIM/Facebook/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act1" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%destdir</Str>
            <Str sr="arg1" ve="3">/sdcard/Pictures/Facebook/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act10" ve="7">
            <code>37</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%fileexists</lhs>
                    <op>12</op>
                    <rhs></rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act11" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">%currentfilepath(%pathlen)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act12" ve="7">
            <code>888</code>
            <Str sr="arg0" ve="3">%suffix</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act13" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">.</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act14" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%namelen</Str>
            <Str sr="arg1" ve="3">%currentfilename(#)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act15" ve="7">
            <code>890</code>
            <Str sr="arg0" ve="3">%namelen</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act16" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename(%namelen)</Str>
            <Str sr="arg1" ve="3">%currentfilename(%namelen)%null()(%suffix)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act17" ve="7">
            <code>592</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">.</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act18" ve="7">
            <code>135</code>
            <Int sr="arg0" val="0"/>
            <Int sr="arg1" val="10"/>
            <Str sr="arg2" ve="3"/>
        </Action>
        <Action sr="act19" ve="7">
            <code>38</code>
        </Action>
        <Action sr="act2" ve="7">
            <code>412</code>
            <Str sr="arg0" ve="3">%sourcedir</Str>
            <Str sr="arg1" ve="3">*.jpg/*.png/*.jpeg/*.gif/*.3gp</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Str sr="arg5" ve="3">%filelist</Str>
            <Int sr="arg6" val="1"/>
        </Action>
        <Action sr="act20" ve="7">
            <code>400</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">%destdir%currentfilename</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="1"/>
        </Action>
        <Action sr="act21" ve="7">
            <code>459</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
        </Action>
        <Action sr="act22" ve="7">
            <code>459</code>
            <Str sr="arg0" ve="3">%destdir%currentfilename</Str>
        </Action>
        <Action sr="act23" ve="7">
            <code>888</code>
            <Str sr="arg0" ve="3">%counter</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act24" ve="7">
            <code>40</code>
        </Action>
        <Action sr="act25" ve="7">
            <code>37</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%counter</lhs>
                    <op>0</op>
                    <rhs>0</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act26" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">No memes? Sad.</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act27" ve="7">
            <code>43</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%counter</lhs>
                    <op>0</op>
                    <rhs>1</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act28" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">%counter meme moved!</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act29" ve="7">
            <code>43</code>
        </Action>
        <Action sr="act3" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%suffix</Str>
            <Str sr="arg1" ve="3">1</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act30" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">%counter memes moved!</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act4" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%counter</Str>
            <Str sr="arg1" ve="3">0</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="1"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act5" ve="7">
            <code>39</code>
            <coll>false</coll>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">%filelist()</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act6" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act7" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%pathlen</Str>
            <Str sr="arg1" ve="3">%currentfilepath(#)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act8" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">%currentfilepath(%pathlen)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act9" ve="7">
            <code>342</code>
            <se>false</se>
            <Int sr="arg0" val="4"/>
            <Str sr="arg1" ve="3">%destdir%currentfilename</Str>
            <Str sr="arg2" ve="3">%fileexists</Str>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="1"/>
        </Action>
        <Img sr="icn" ve="2">
            <cls>com.facebook.katana.LoginActivity</cls>
            <pkg>com.facebook.katana</pkg>
        </Img>
    </Task>
</TaskerData>

```
> 0 votes

---
Tags: facebook, google-photos
---


# Question
Title: How to prevent a folder being backed up in Photos but still seen in a gallery app?
I am on Pixel 3 XL. I found that Google Photos recognizes the Facebook photo folder (and some others, such as Screenshots) the same as the "Camera" folder because they are within the DCIM folder. Therefore, we cannot tell Google Photos not to backup these folder within Google Photos settings.

The only option I have come across is to put a .nomedia file in the Facebook folder. That does prevent Google Photos from backing it up, but it also prevent me from seeing that folder in any other app. As you know, the Pixel does not include a traditional photo gallery, as they want you to use the google photos app so I use a photo gallery app from the play store. Either way with the .nomedia file in that folder I cannot see the images in that folder anywhere.

Is there any other way to stop Google Photos from backing up this folder without making the images invisible on my device? Google photos should **not** be treating all folders within DCIM as "Camera" and instead it should be looking specifically for the camera roll folder.

Related post: Change Facebook (and others) photo saving folder

# Answer
> 3 votes
You're not restricted by Google to use only Photos app as a Gallery app, so why not try a third-party app? I remembered that I used to use Piktures and QuickPic app and both of them (paid feature in Piktures), as I tested now, provides an option to show hidden or .nomedia file containing folders inside their settings. I'm sure some other gallery apps might be having a similar feature.

# Answer
> 0 votes
Use my beginner friendly Tasker project which I made based on this answer. I made some significant improvements that allow it to be used for many other scenarios beyond just moving Facebook's images, and included multiple examples within the project to learn from:

1. While the original version could detect if the file being moved already existed in the destination directory, it could only handle one iteration of the conflict. For example, if example.jpg were being moved, but it already existed, it would rename the file being moved to example(1).jpg. However, if example.jpg were being moved and both example.jpg and example(1).jpg already existed, it would simply overwrite example(1).jpg.
    * My version will run an iterative check on names which increments the suffix variable until a non-existing name is found. For example, if example.jpg is taken, it will check example(2).jpg. If that is taken, it will check example(3).jpg, and so on until an available name is found. It also correctly appends the first duplicate with (2) rather than (1).
2. The original version assumed the first "." in a file name was also the last "." before the extension. While this is fine for images from Facebook, it's not an ideal assumption, and breaks down when adopting the task for other uses, such as moving APKs. With the original, if com.example.app.apk already existed in the destination directory, trying to move a second copy of it would result in com(1).example.app.apk.
    * In addition to fixing the suffix and making it iterative, I've also changed the logic for its placement, such that it will always go before the last ".". In the above example, the apk would now be renamed to com.example.app(2).apk. This doesn't always work perfectly (consider .tar.gz and other similar cases for instance), but it does a good enough job without having to hard-code in every possible extension.
3. This appears to vary from device to device, but on my devices, the original version would leave behind broken references to images in gallery apps and other programs that utilize the media provider (most messaging apps that have an image selection UI) due to not correctly refreshing this data. This was not an issue for moving images out of a directory containing a .nomedia file, but caused issues if you wanted to use it in a directory where you didn't want or couldn't have a .nomedia file (such as automatically moving downloaded images out of /sdcard/Download/).
    * Tasker's Scan Media action seems to act in wildly different ways depending on not only the Android version, but also the vendor variant you're using. I've fixed the issue on my devices (and hopefully many of yours) by running a Scan Media action on not only the file in it's destination directory, but also on the original file path (referencing the file that's no longer there).

I also updated variable names for clarity, and rather than using events that trigger when entering or exiting apps, I've set it to run on a File Modified event monitoring the source folder, with the event set to Closed Write. This works for most purposes, but breaks in some cases. You can fix most issues by either using a different event parameter (such as Create, Modify, or Move To) or by using stricter regex in Action 3 of the task.

> I've heard that devices with slower storage (or slow external SD cards) can have issues with this if files take too long to write. In that case, you may have to experiment with adding delays or using different methods to trigger the task.

I'm attaching not just the task here, but the entire project I've created, containing multiple copies of the task for various use cases, and their respective profiles to trigger them, so that beginners who are new to Tasker can easily get started using this task and have some examples to reference when adopting the task to their own needs.

The examples included in this project are:

* When Facebook downloads an image to /sdcard/DCIM/Facebook, move it to /sdcard/Pictures/Facebook.
* When Samsung Notes saves an image to /sdcard/DCIM/Samsung Notes/, move it to /sdcard/Pictures/Samsung Notes/. (This works, but Samsung Notes will claim it failed to save the image, due to it checking for the image after it has already been moved by Tasker.)
* When you create a GIF using Smart Select, move it from /sdcard/DCIM/GIF/ to /sdcard/Pictures/Smart Select GIFs/.
* When you export an APK from ReVanced Manager to /sdcard/Download/APKs/Original/, move it to /sdcard/Download/APKs/Modded/.
* When a new file is detected in /sdcard/Download/ . . .
    + if it's a download from Craiyon, move it to /sdcard/Pictures/Craiyon/
    + if it's an APK, APKM, APKS, or XAPK file, move it to /sdcard/Download/APKs/Original, *unless* it is base.apk (I leave that file in Download since I use it for other things.)

Remember to first create the source and destination directories before testing the examples. I also encourage you to check Action 3 in each example task (some of them use simple matching and others use regex) for a better understanding of how they work.

Now that that's out of the way, here's the project. You can import it directly to Tasker from there, or download it as an XML. If you choose to download it, save it in /sdcard/Tasker/projects/. You can then long press on the home icon on the bottom left corner of Tasker to import the project.

Unfortunately the entire XML is too long to post here directly, but for the sake of keeping this answer as complete as possible, I'm including the XML for *just* the Facebook task below. I strongly recommend that beginners import the entire project using the link above however, so you can get an idea of how to customize the task for your own needs.

The Facebook task:

```
<TaskerData sr="" dvi="1" tv="6.0.10">
    <Task sr="task3">
        <cdate>1489093858387</cdate>
        <edate>1677367714628</edate>
        <id>3</id>
        <nme>Move Facebook Images</nme>
        <pri>6</pri>
        <Kid sr="Kid">
            <launchID>3</launchID>
            <pkg>me.regalstreak.movefb</pkg>
            <vTarg>21</vTarg>
            <vnme>1.0</vnme>
        </Kid>
        <Action sr="act0" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%sourcedir</Str>
            <Str sr="arg1" ve="3">/sdcard/DCIM/Facebook/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act1" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%destdir</Str>
            <Str sr="arg1" ve="3">/sdcard/Pictures/Facebook/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act10" ve="7">
            <code>37</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%fileexists</lhs>
                    <op>12</op>
                    <rhs></rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act11" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">%currentfilepath(%pathlen)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act12" ve="7">
            <code>888</code>
            <Str sr="arg0" ve="3">%suffix</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act13" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">.</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act14" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%namelen</Str>
            <Str sr="arg1" ve="3">%currentfilename(#)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act15" ve="7">
            <code>890</code>
            <Str sr="arg0" ve="3">%namelen</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act16" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename(%namelen)</Str>
            <Str sr="arg1" ve="3">%currentfilename(%namelen)%null()(%suffix)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act17" ve="7">
            <code>592</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">.</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act18" ve="7">
            <code>135</code>
            <Int sr="arg0" val="0"/>
            <Int sr="arg1" val="10"/>
            <Str sr="arg2" ve="3"/>
        </Action>
        <Action sr="act19" ve="7">
            <code>38</code>
        </Action>
        <Action sr="act2" ve="7">
            <code>412</code>
            <Str sr="arg0" ve="3">%sourcedir</Str>
            <Str sr="arg1" ve="3">*.jpg/*.png/*.jpeg/*.gif/*.3gp</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Str sr="arg5" ve="3">%filelist</Str>
            <Int sr="arg6" val="1"/>
        </Action>
        <Action sr="act20" ve="7">
            <code>400</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">%destdir%currentfilename</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="1"/>
        </Action>
        <Action sr="act21" ve="7">
            <code>459</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
        </Action>
        <Action sr="act22" ve="7">
            <code>459</code>
            <Str sr="arg0" ve="3">%destdir%currentfilename</Str>
        </Action>
        <Action sr="act23" ve="7">
            <code>888</code>
            <Str sr="arg0" ve="3">%counter</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act24" ve="7">
            <code>40</code>
        </Action>
        <Action sr="act25" ve="7">
            <code>37</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%counter</lhs>
                    <op>0</op>
                    <rhs>0</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act26" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">No memes? Sad.</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act27" ve="7">
            <code>43</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%counter</lhs>
                    <op>0</op>
                    <rhs>1</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act28" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">%counter meme moved!</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act29" ve="7">
            <code>43</code>
        </Action>
        <Action sr="act3" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%suffix</Str>
            <Str sr="arg1" ve="3">1</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act30" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">%counter memes moved!</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act4" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%counter</Str>
            <Str sr="arg1" ve="3">0</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="1"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act5" ve="7">
            <code>39</code>
            <coll>false</coll>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">%filelist()</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act6" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act7" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%pathlen</Str>
            <Str sr="arg1" ve="3">%currentfilepath(#)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act8" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">%currentfilepath(%pathlen)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act9" ve="7">
            <code>342</code>
            <se>false</se>
            <Int sr="arg0" val="4"/>
            <Str sr="arg1" ve="3">%destdir%currentfilename</Str>
            <Str sr="arg2" ve="3">%fileexists</Str>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="1"/>
        </Action>
        <Img sr="icn" ve="2">
            <cls>com.facebook.katana.LoginActivity</cls>
            <pkg>com.facebook.katana</pkg>
        </Img>
    </Task>
</TaskerData>

```

---
Tags: backup, google-photos
---


# Question
Title: Where does the work profile app data stored? How to access them?
I am using Total Commander to view files in phone storage. I only see `/emulated/0`. I need to view and modify files in my work profile.

Any `adb command` or tool I can use?

# Answer
Run `adb shell pm list users` to get a list of users. I have a work profile set up through Island, so I get

```
    UserInfo{0:Owner:13} running
    UserInfo{10: Island :50100030} running

```

The first number on each line is the user ID. This means the system user stores its files at `/storage/emulated/0/`, while Island (work profile) uses `/storage/emulated/10/`, at least on my device.

To access this directory, refer to this answer.
> 2 votes

---
Tags: samsung, file-management, work-profiles
---


# Question
Title: Does Android support Wi-Fi Management Frame Protection?
I am trying to find out whether Android supports Wi-Fi Management Frame Protection. From my understanding, this is standardized in IEEE 802.11w, so if Android supports that, it also supports MFP.

However, I can't find any source on whether Android supports this or not. I found some articles about it but they only mentioned specific phones, and not the entire Android specification. The Android Source Docs don't say anything on this, and the Android Enterprise Security Whitepaper only states that Android supports WPA3, Wi-Fi Enhanced Open, and 802.11i.

Do you know whether Android supports MFP or not?

# Answer
Following @Robert s suggestion, I dug deeper to find out if Android uses a linux kernel with MFP enabled.

I found this commit to the Android source code, which enabled PMF (= Protected Management Frames = Management Frame Protection) in January 2014:

> Android: Enable 802.11w (PMF) support in wpa\_supplicant

I also found out on wikipedia that WPA3 (which Android supports) requires MFP:

> Protection of management frames as specified in the IEEE 802.11w amendment is also enforced by the WPA3 specifications.

So yes, Android supports Management Frame Protection.
> 2 votes

---
Tags: wi-fi
---


# Question
Title: Why is "wpa_supplicant.conf" file invisible?
My device **LG e510 : Android 2.3** had been rooted and then I changed the privileges to view and see some system files, especially for **wpa\_supplicant.conf**, with RootExplorer app.

But unlike most people, I can not see the file inside /data/misc/wifi/ directory, it's empty and /system/etc directory has **wpa\_supplicant.conf** header information file.

Lastly I used WifiPassRecovery app, and the app immediatelly retrieved all the saved wifi passwords.

Where did this app retrieve all those informations? and Why cannot I see the file?

Thanks.

# Answer
Found them in

```
/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml

```
> 3 votes

# Answer
On the Galaxy S, the credentials are stored in `/data/wifi/bcm_supp.conf` (where bcm is short for Broadcom). Other common locations include `/data/wifi/`, `/data/etc/wifi/` and `/data/misc/wifi/` — check them for relevant config files.
> 1 votes

---
Tags: wi-fi, internal-storage, root-access, privacy, password
---


# Question
Title: Stopping Verizon from installing apps on your phone without consent?
I recently switched cell phone providers from T-Mobile to Verizon. The next day, I noticed a ton of crappy apps, mostly dumb games, were installed on my phone, a Samsung Galaxy S22.

As I already have a lot of problems with bloatware, I uninstalled these apps, and want to ensure that Verizon doesn't install anything else without permission. The idea of a big creepy corporation installing unknown things on my cell phone is unnerving.

My phone's not jailbroken. However, a lot of guides suggest uninstalling the app called "Verizon App Manager", but I didn't even have an app called "Verizon App Manager", just "Verizon Services". Then I uninstalled all the app's updates, and viola, its name reverted to "Verizon App Manager". However, the app can't be uninstalled.

I removed all of its permissions, but as Verizon was able to install this app without permission, I doubt how long that will work.

# Answer
> 1 votes
This is just a broad answer. You can uninstall system apps from adb. search for "pm uninstall" you will find a lot of answers.

However, something to add from my side:

Prepare for data loss. you can easily soft-brick device by disabling the wrong package. There is no way to undo this other than factory reset then. So be careful with that, and always do a backup beforehand.

This free open source tool is a little assistant to perform the adb commands more comfortable
https://github.com/0x192/universal-android-debloater

---
Tags: applications, permissions
---


# Question
Title: Can an app access my browser history from other apps?
I've always thought that if an app has to get access to certain information on your phone, you have to give it permission in the "permissions" settings in phone settings.

However, on Google Play, it says under the "Data safety" tab,in "Data Collected", that TikTok (and other apps, such as the YouTube and Facebook app) can access "Web Browser History". What I find especially strange is that it says that TikTok's access to this is "optional". Where on earth can I, if that's the case, change the setting?

I am rather shocked, as this is a far reaching privacy intrusion, and there's no way to stop it. It isn't listed in app permissions in the phone settings. Access to web history isn't even a permission anymore. That made me believe that it's not possible for another app to get access to web history.

Have I misunerstood something here? How can it say in Google Play that an app can access your browser history, when it is not possible to grant that permission in the phone setting?

# Answer
As Robert has mentioned, the "Data safety" is a self-declaration by the developer, and the options are predefined by Play Store, meaning that they cannot modify the items inside each category but can only choose whether they use the data or not.

Also note that the wording is "Web brows*ing* history", not "brows*er*". The intention based on the official documentation is this:

| Category | Data type | Description |
| --- | --- | --- |
| ... | ... | ... |
| **Web browsing** | Web browsing history | Information about the websites you have visited. |
| ... | ... | ... |

It doesn't mean the web browser (app)'s history, but a history of web browsing from their own app. Since this is a self-declaration, developers might have a different interpretation, like even opening TikTok links from their own app counts for analytic purposes (in this case, they declared it for "advertising or marketing" optionally).

Since this is a self-declaration, there may be no relevant Android permissions that are automatically detected by Play Store and the Android system. The relevant settings might even be placed on the app or web instead, like an option to opt out from targeted advertising based on web browsing history (if there is one).

---

As for whether apps can access browser history, the browser history is commonly stored inside the internal app-specific storage which can only be accessed by the browser app itself. Thus, unless the browser provides a way to access it like using a content provider or exported APIs, there's no way for apps to access the web browser history.
> 1 votes

---
Tags: applications, google-play-store, permissions, privacy
---


# Question
Title: How do I delete an email in Gmail from the notification screen?
The latest Gmail app update (26 MAR 2013) introduced a feature for devices running Android 4.1 (Jellybean) and higher wherein a user could directly archive/reply to an email from within the notification pull-down.

The "What's New" section on the Play Store however also lists the ability to delete an email.

> Android 4.1 (Jelly Bean) and up:
> • Reply, archive or delete from notifications - no need to open the app

I'm running CyanogenMod 10.1 (Android 4.2.2) on my Samsung Galaxy S2 (i9100) and the options for Archive and Reply show up when I pull down the individual email notification but nothing for Delete shows up, even while in Landscape mode.

Any ideas on how this can be implemented or a setting that I've missed to enable this functionality?

# Answer
Yes - there is a setting you need to change.

The Notification bar's actions are based on what you have GMail set up to do when swiping away an email within the app.

To change it from `Archive`:

Open `Gmail` and go to `Settings` there change the `Swiping conversation list` from `Archive/unlabel/delete` to `Always delete`

This changed my Notification bar action from `Archive` to `Delete`
> 30 votes

# Answer
**Since v8.4.x, Gmail has been providing a separate setting to change the notification action** and reworded "Gmail notification action" to "Default notification action."

The setting can be accessed by:

1. Open the Gmail app
2. Tap the hamburger menu (3 horizontal lines icon) on the top-left corner
3. Select "Settings"
4. Select "General settings"
5. Select "Default email notification action"
6. Select between "Archive" or "Delete"
> 1 votes

---
Tags: notifications, gmail, notification-bar, delete
---


# Question
Title: Preventing a single app from updating from Play Store
I have a single app (ES File Explorer) that I want to prevent from updating and I don't quite understand what is happening.

1. Removed the app from My Apps in the Play Store
2. Turned off my network connection
3. Uninstalled the new version
4. Side loaded the old version
5. Immediately unchecked the auto update within the app (maybe about 30 sec later)
6. Turned my network back on

If I now check My Apps, there is an update for the app waiting and if I turn auto update back on, it will update to the new version.

If the app is not listed on My Apps - All (and I rechecked) and auto update is turned off within the app, what is causing this app to update and how do I prevent it?

# Answer
> 7 votes
Self sign the application that you don't want to be updated. If the signatures are different then for security reasons the app will never be updated.

Check this article to know how you can perform this within your smartphone.

# Answer
> 6 votes
If you search the app on Play Store and open the app detail page you'll see three dots on upper-left corner (overflow menu).

Click on it. Then uncheck 'Auto-update'

Click image for larger version

# Answer
> 2 votes
Unfortunately, APK-signer is no more usable (it sends you to create an account, verify it with VISA, and watch ads to add points to unlock the "free" feature)

BTW, I found APK Explorer & Editor on F-Droid:

1. Install & run it
2. Select installed APK you want to remove from PlayStore.
3. Hammer icon -\> Prepare a signed APK
4. Create & note the path where it's created
5. Uninstall your app
6. Reinstall from modified APK The app is no more present on the Play Store.

# Answer
> 0 votes
For those still looking for this:
**Update Locker**

Needs Xposed

Direct link to the module
But don't skip the instructions from the link above

# Answer
> -1 votes
Initially, I unchecked auto update both within the app and in the Play Store. I still got the update.

I then removed the app from My Apps, uninstalled, reinstalled the APK, quickly unchecked the auto-update box. I can no longer uncheck it in the Play Store as I have removed the app from the list.

I do not get an auto-update, but there is an update waiting for me to click on the update button. Since I removed it from the Play Store and uninstalled the app from my device and reinstalled the old APK from a flash drive, how does Google know to send me an update?

I am afraid that at some point I will forget and click on the update all button.

# Answer
> -2 votes
Well, turning auto update off shall prevent the update. Though there is another way of doing it:

1. Uninstall the app.
2. Download and install the apk from any website other than playstore.
3. Now you are good to go!

Playstore now shouldn't list your app under the installed app section. So, no more updates!

Hope it helps.

---
Tags: applications, google-play-store, updates
---


# Question
Title: Fastboot failing with error: FAILED (remote: unknown command)
I am trying to run the following command against a **Samsung Galaxy Tab A7 SM-T505 (2020)**:

```
> fastboot flash vbmeta vbmeta.img
target reported max download size of 797411328 bytes
sending 'vbmeta' (9 KB)...
FAILED (remote: unknown command)
finished. total time: 0.016s

```

But as you can see, it fails with `remote: unknown command`.

When I check the fastboot options, I get (partial):

```
> fastboot --help
usage: fastboot [ <option> ] <command>

commands:
  update <filename>                        Reflash device from update.zip.
                                           Sets the flashed slot as active.
  flashall                                 Flash boot, system, vendor, and --
                                           if found -- recovery. If the device
                                           supports slots, the slot that has
                                           been flashed to is set as active.
                                           Secondary images may be flashed to
                                           an inactive slot.
  flash <partition> [ <filename> ]         Write a file to a flash partition.
  flashing lock                            Locks the device. Prevents flashing.
  flashing unlock                          Unlocks the device. Allows flashing
                                           any partition except
                                           bootloader-related partitions.
  flashing lock_critical                   Prevents flashing bootloader-related
                                           partitions.
  flashing unlock_critical                 Enables flashing bootloader-related
                                           partitions.
  flashing get_unlock_ability              Queries bootloader to see if the
                                           device is unlocked.
  flashing get_unlock_bootloader_nonce     Queries the bootloader to get the
                                           unlock nonce.

```

confirming the particular command I am using is supported:

```
flash <partition> [ <filename> ]         Write a file to a flash partition.

```

I believe the arguments are set correctly and the `vbmeta.img` file exists in the directory I am executing the command from, but have also ran the command fully qualified path. Always the same error.

And

```
> fastboot devices
R9TR11AW1N     fastboot

```

So the device is running fastboot.

I have found other posts on `FAILED (remote: unknown command)`, but so far, they have all been about `oem` option for fastboot, which is not in fastboot help, nor am I using this particular option.

> So, what am I missing here? Why is fastboot complaining about `flash` option?

**Background**

I am trying to root a Samsung Galaxy Tab A7 SM-T505 (2020) following this guide. I get through all the steps 1-6 without issue, but am stuck on step 7 and unable to get into recovery menu to factory reset. It appears that Knox fuse is triggering and preventing recovery menu. These are my steps.

**Step 1**) Enable OEM Unlock

```
Settings > Developer Options > OEM unlocking enabled
power off tablet

```

**Step 2**) Unlock bootloader

```
Press volume button (up+down together) then plug in usb -> tablet will boot into Odin mode.

in Odin mode > volume up to unlock bootloader

```

```
Tablet reboots

```

```
verify OEM unlocking is greyed out

```

**Step3**) Download firmware package from Samsung official update server

```
> samloader -m SM-T505 -r BTU checkupdate

T505XXU4CWA1/T505OXM4CWA1/T505XXU4CWA1/T505XXU4CWA1

> samloader -m SM-T505 -r BTU download -v T505XXU4CWA1/T505OXM4CWA1/T505XXU4CWA1/T505XXU4CWA1 -O .

```

**Step 4**) Decrypt and Extract

```
> samloader -m SM-T505 -r BTU decrypt -v T505XXU4CWA1/T505OXM4CWA1/T505XXU4CWA1/T505XXU4CWA1 -V 4 -i SM-T505_3_20230113142541_erh3m0ivc4_fac.zip.enc4 -o SM-T505_3_20230113142541_erh3m0ivc4_fac.zip

```

**Step 5**) Use Magisk to patch the firmware image

```
> adb push AP_T505XXU4CWA1_T505XXU4CWA1_MQB61232139_REV00_user_low_ship_MULTI_CERT_meta_RKEY_OS12.tar.md5 /storage/emulated/0

> adb install /path/to/magisk/Magisk-v25.2.apk

run magisk, select md5 image pushed earlier, and patch it.

> adb pull /storage/emulated/0/Download/magisk_patched-7tzTQ.tar  \path\to\firmware\imagefiles\

```

**Step 6**) Flash patched AP firmware using Odin - deselected auto-reboot

```
rename magisk_patched-25200-7tzTQ.tar to magisk_patched.tar

```

Odin crashes at PRISM segment if not renamed:

```
Faulting application name: Odin3 v3.14.1.exe, version: 2019.5.1.0, time stamp: 0x5cef2bf9
Faulting module name: Odin3 v3.14.1.exe, version: 2019.5.1.0, time stamp: 0x5cef2bf9
Exception code: 0xc0000409
Fault offset: 0x001cb10a
Faulting process id: 0x2f58
Faulting application start time: 0x01d9424e6340c61a
Faulting application path: C:\Users\Me\Documents\Android_OS_Imaging\Odin\Odin3 v3.14.1\Odin3 v3.14.1.exe
Faulting module path: C:\Users\Me\Documents\Android_OS_Imaging\Odin\Odin3 v3.14.1\Odin3 v3.14.1.exe
Report Id: 5faed018-fdf7-422d-b1ba-31f45a6b53dc
Faulting package full name:
Faulting package-relative application ID:

```

Unplugged USB, restarted tablet (Power + Volume Down), hold Volume whilst plugging USB back into tablet (Odin mode). Start Odin again.

Select respective files and click Start

```
<ID:0/007> Added!!
<OSM> Enter CS for MD5..
<OSM> Check MD5.. Do not unplug the cable..
<OSM> Please wait..
<OSM> Checking MD5 finished Sucessfully..
<OSM> Leave CS..
<OSM> Enter CS for MD5..
<OSM> Check MD5.. Do not unplug the cable..
<OSM> Please wait..
<OSM> Checking MD5 finished Sucessfully..
<OSM> Leave CS..
<ID:0/007> Odin engine v(ID:3.1401)..
<ID:0/007> File analysis..
<ID:0/007> Total Binary size: 6852 M
<ID:0/007> SetupConnection..
<ID:0/007> Initialzation..
<ID:0/007> Set PIT file..
<ID:0/007> DO NOT TURN OFF TARGET!!
<ID:0/007> Get PIT for mapping..
<ID:0/007> Firmware update start..
<ID:0/007> NAND Write Start!!
<ID:0/007> SingleDownload.
<ID:0/007> abl.elf
<ID:0/007> xbl.elf
<ID:0/007> xbl_config.elf
<ID:0/007> tz.mbn
<ID:0/007> hyp.mbn
<ID:0/007> rpm.mbn
<ID:0/007> devcfg.mbn
<ID:0/007> cmnlib.mbn
<ID:0/007> cmnlib64.mbn
<ID:0/007> km4.mbn
<ID:0/007> storsec.mbn
<ID:0/007> NON-HLOS.bin
<ID:0/007> dspso.bin
<ID:0/007> qupv3fw.elf
<ID:0/007> apdp.mbn
<ID:0/007> uefi_sec.mbn
<ID:0/007> msadp.mbn
<ID:0/007> sec.elf
<ID:0/007> bksecapp.mbn
<ID:0/007> icccgrd.mbn
<ID:0/007> vbmeta.img
<ID:0/007> blgrd.mbn
<ID:0/007> grd_fw.img
<ID:0/007> vaultkeeper.mbn
<ID:0/007> recovery.img
<ID:0/007> dtbo.img
<ID:0/007> super.img
<ID:0/007> userdata.img
<ID:0/007> metadata.img
<ID:0/007> vbmeta.img
<ID:0/007> vbmeta_samsung.img
<ID:0/007> boot.img
<ID:0/007> cache.img
<ID:0/007> omr.img
<ID:0/007> prism.img
<ID:0/007> optics.img
<ID:0/007> RQT_CLOSE !!
<ID:0/007> RES OK !!
<ID:0/007> Remain Port .... 0
<OSM> All threads completed. (succeed 1 / failed 0)

```

**Step 7**) **Fails** \- Holding Power + Volume Down for ~7 seconds then when tablet screen turns off Power + Volume Up.

I have not found a way around Knox yet. Any guidance on how to get around or another rooting method altogether would be appreciated.

I am able to get all the way through using original AP file: `AP_T505XXU4CWA1_T505XXU4CWA1_MQB61232139_REV00_user_low_ship_MULTI_CERT_meta_RKEY_OS12.tar.md5`

instead of `magisk_patched.tar` \- all the way to factory reset, reboot, settings developer options enabled.

# Answer
> 2 votes
After some effort and community assisstance, I finally got root access, which is/was the ultimate goal of the question.

Following this guide, and a little patience, I was able to get through. This guide is very good, but does not mention a rather significant point in my process, or does not give enough detail, which is the display after reboot of the `Samsung warning screen`, **which displays for ~3-5 minutes**. It pauses longer after the first reboot than subsequent boots. While it's mentioned that the first boot is long, it does not mention the warning screen. If you wait out this screen and not attempt to access recovery menu (which the guide states as a step), then you should get through.

---
Tags: samsung, fastboot
---


title: Gboard Personal Dictionary not working

text:
# Question
Title: Gboard Personal Dictionary not working
I have added a few words to the personal dictionary in Gboard settings and they aren't working. Trying to create shortcuts for things like my email address, but when I type the shortcut into Gboard, nothing happens.

I've scoured the web for answers to this and have yet to find a solution. I've tried uninstalling and reinstalling Gboard. I emptied the Gboard cache. I'm currently using a Samsung Galaxy S5 and it's on Android 6.0.1, all software is up-to-date. Nothing helps.

How to fix this?

# Answer
> 2 votes
As noted, special characters may be a problem, but if others have this issue with all shortcuts, clearing Gboard's data (in system settings -\> applications -\> Gboard) fixed the issue for me.

# Answer
> 1 votes
It would seem that Gboard has a hard time with shortcuts containing punctuation. Ampersands and colons did not work for me, but shortcuts without these characters work fine.

A little digging on the web would imply that punctuation in shortcuts used to work in previous versions. I'm not sure if this applies to your situation or not, though.

Gboard 6.2.34
Version = 20170404

# Answer
> 0 votes
The solution to the problem is as follows.

1. Visit APK Mirror - Android Keyboard (AOSP) 8.1.0.
2. Download the AOSP keyboard and install it on your phone.
3. Enable the AOSP keyboard from the virtual keyboard section in the languages and input section.
4. Do not set the AOSP keyboard by default. We will use Gboard.
5. Now go to your personal dictionary in the Languages section. You will see two of your own language.

For example: For all languages, Turkish, and Turkish (Turkey). Select Turkish and enter your words here and shortcuts are now running, not Turkish (Turkey).

An error occurs when you enter your words and shortcuts in the dictionary where the language and region are together.

# Answer
> 0 votes
My Gboard shortcuts weren't expanding because I had unknowingly been adding a space at the end. I thought I'd added "foo", but I'd added "foo ": that space was the problem. Any time I'd enter "foo " in an app—notice the space—the question to ask yourself is, "which of the following took precedence:"

1. the confirmation of the end of a word1
2. or the OS's having confirmed the recognition of my desired shortcut?

(1) had been winning out, trumping (2) and—correctly, unfortunately—winning out over (2) and never allowing (2)'s replacement to happen. As soon as I got rid of the trailing space in my personal dictionary's shortcut replacement string, it worked. It makes sense.

Incidentally, in one of my user-defined dictionary shortcuts, I have the octothorpe, or hashtag, "#" working, too, so it appears that some special characters are also working and now *not* causing problems. So if this is not new news, please don't shoot the messenger!

1 An additional wrinkle I can't unravel is "is it the app or the OS doing the detection and identification in (1)?" I can't tell—I think I'd have to be able to trace a single step through the kernel to be able to answer that one. (-;

Gboard 12.6.02.491625702-release-arm64-v8a102451622

---
Tags: gboard, dictionary
---


# Question
Title: How do I clear app cache/data on Android without accessing settings?
I actually can't open the settings and desperately want to clear the cache of an app which is not working properly. When I open the settings app, it is forcefully closed down again and again.

How do I clear app cache/data on Android without accessing settings?

# Answer
> 0 votes
There are some apps that can do that. CCleaner is less intrusive but does not work well with some devices. You might want to try each.

Just in case you want a quick method to clear your app data, and do not want to install anything, you could try opening your "Recent apps" (you can access it by tapping one of the buttons on the bottom of your phone, and it shows a list of all the apps that are open). Then long-press the app which needs to have its data cleared, and select "App Info". This will take you directly to the settings page in which you can clear the app's data.

# Answer
> 0 votes
Use this command with adb:

> adb shell pm trim-caches 128G

You don't need root to do this.

---
Tags: cache, delete
---