Scott Lurndal writes:
Scott Lurndal <sc...@slp53.sl.home> asked
> I think only you realize how difficult this is, given the solution isn't
> already tailored for us, but when we publish the steps, they'll do it in
> minutes and think it was all so easy. :)
Nowhere on the Internet have I been able to find this tutorial.
It took many hours to write this up but now it works in five minutes!
I put it in cut-and-paste format. So it's easy to test.
Please test it out to see if it works for you & report back your results.
For the first time ever...
a. Tapping the homescreen icon now brings up the "Reset Ad Id" form.
b. It's not a shortcut but a widget (but I don't know if/how that matters).
c. We only need to figure out how to make it _press_ the "Reset" button!
Here are cut and paste instructions anyone can follow in 5 minutes!
1. Install F-droid <
https://f-droid.org/>
<
https://f-droid.org/F-Droid.apk>
2. Install F-Droid Termux <
https://f-droid.org/en/packages/com.termux/>
<
https://f-droid.org/repo/com.termux_117.apk>
3. Add F-Droid Termux Widget <
https://f-droid.org/en/packages/com.termux.widget/>
<
https://f-droid.org/repo/com.termux.widget_12.apk>
4. Run the F-Droid Termux & create an alias we'll name "rad" for reset ad id.
$ rad
(This should report: No command rad found)
$ alias rad 'am start -n com.google.android.gms/.ads.settings.AdsSettingsActivity'
$ rad
(this should pop up the "Reset Advertising ID" Activity on your phone
(manually close that Activity for now - we can programmatically close it later)
$ cat ~/.bashrc
cat /data/data/com.termux/files/home/.bashrc
No such file or directory
$ alias > ~/.bashrc
$ cat !$
alias rad='am start -n com.google.android.gms/.ads.settings.AdsSettingsActivity'
$ unalias rad
$ rad
(This should report: No command rad found)
$ source ~/.bashrc
$ rad
(this should pop up the "Reset Advertising ID" Activity on your phone
(manually close that Activity for now - we can programatically close it later)
5. Run the F-Droid Termux and create two directories for the shortcut widget
$ mkdir -p $HOME/.shortcuts (we will put our shell script here)
$ mkdir -p $HOME/.shortcuts/tasks (we didn't use this directory yet)
6. Create a shell script to open up the reset ad id Activity.
$ cd $HOME/.shortcuts
$ nano ./rad.sh
Edit the result to look like this:
#!/data/data/com.termux/files/usr/bin/bash
am start -n com.google.android.gms/.ads.settings.AdsSettingsActivity
$ chmod +x ./rad.sh
$ ./rad.sh
(nothing will happen)
7. Modify termux to be able to execute user shell scripts on Android.
$ pkg install termux-exec
8. Test your shell script.
$ ./rad.sh
(this should pop up the "Reset Advertising ID" Activity on your phone
(manually close that Activity for now - we can programmatically close it later)
9. Add the Termux Widget to your homescreen.
Long press your Android homescreen.
Select "Widgets" & then "Termux:Widget" & place it on your Android homescreen.
It will ask: Create widget and allow access? to which you press "Yes"
Then press the "rad.sh" entry showing up in that Termux Widget.
"Termux requires "Display over other apps" permission
to start terminal sessions from background on Android >=10."
"Grants it from Settings -> Apps -> Termux -> Advanced"
10. Grant Termux permission to display over other apps:
Android11:Settings > Apps > Your apps > Termux > Appear on top = (change off to on)
11. Now press the Termux Widget entry named "rad.sh"
(this should pop up the "Reset Advertising ID" Activity on your phone
(manually close that Activity for now - we can programmatically close it later)
12. Reboot the phone & ensure everything is persistent.
Tap the new homescreen icon after rebooting
& the "reset ad id" Activity should pop up.
What's left?
Figure out how to add a step to actually _press_ the "Reset" button!
--
Don't mix Google Play Termux add ons with F-Droid Termux add ons.
<
https://www.xda-developers.com/termux-terminal-linux-google-play-updates-stopped/>
Use only the F-Droid Termux and only the F-Droid Termux add ons.
<
https://wiki.termux.com/wiki/Termux:Widget>
If you installed the Google Play Termux, you need to migrate it to F-Droid.
<
https://docs.andronix.app/termux/migrating-to-f-droid/>