Dual SIM switching using Tasker - Huawei Mate 9 Questions & Answers

Wouldn't it be cool to be able to automate the swicthing data between SIM 1 and SIM 2 using Tasker given the location of the device? Let's figure out how to do it together. Do we need root? ADB command comes to mind...

@MishaalRahman any ideas?

What do you mean by "switching data?" Sorry, I usually don't use two SIMs so I'm not sure what you mean.

MishaalRahman said:
What do you mean by "switching data?" Sorry, I usually don't use two SIMs so I'm not sure what you mean.
Click to expand...
Click to collapse
The dual sim version mha-l29 has an option to set the default 4g slot from within the settings menu
I have found already a system variable that can be changed using secure settings plugin for tasker, and running the adb command adb shell settings list system I can see that the variable switch_dual_card_slots does change from 0 to 1 when doing it from the ui, but when done from a put command nothing happens. Any ideas?

dmorales023 said:
The dual sim version mha-l29 has an option to set the default 4g slot from within the settings menu
I have found already a system variable that can be changed using secure settings plugin for tasker, and running the adb command adb shell settings list system I can see that the variable switch_dual_card_slots does change from 0 to 1 when doing it from the ui, but when done from a put command nothing happens. Any ideas?
Click to expand...
Click to collapse
The screenshot shows you doing the command from the Secure Settings plug-in, not from shell. Have you tried it from shell?

MishaalRahman said:
The screenshot shows you doing the command from the Secure Settings plug-in, not from shell. Have you tried it from shell?
Click to expand...
Click to collapse
Yes, same results executing directly from shell. Nothing happens. Is there a trigger like command to update ui from settings or something like that? Sort of:
1. adb shell command x
2. Commit?

dmorales023 said:
Yes, same results executing directly from shell. Nothing happens. Is there a trigger like command to update ui from settings or something like that? Sort of:
1. adb shell command x
2. Commit?
Click to expand...
Click to collapse
@MishaalRahman The shell command I am using is "adb shell settings put system switch_dual_card_slots 0/1"

dmorales023 said:
@MishaalRahman The shell command I am using is "adb shell settings put system switch_dual_card_slots 0/1"
Click to expand...
Click to collapse
Yeah, that seems like it would do it.

dmorales023 said:
@MishaalRahman The shell command I am using is "adb shell settings put system switch_dual_card_slots 0/1"
Click to expand...
Click to collapse
Is it working? I am trying to do same thing on my phone. No luck till now

midhunmanohar said:
Is it working? I am trying to do same thing on my phone. No luck till now
Click to expand...
Click to collapse
No luck on my side either. Did you find a solution? This seems so trivial...

dmorales023 said:
Yes, same results executing directly from shell. Nothing happens. Is there a trigger like command to update ui from settings or something like that? Sort of:
1. adb shell command x
2. Commit?
Click to expand...
Click to collapse
I am using the shell command successfully on my Honor 6X.
First I set switch_dual_card_slots to 0 or 1 , and to commit I simply kill the phone process, which will automatically restart instantly.
It is not the most elegant solution, but works flawlessly for me.
The two commands I run (with root priveleges)
1: settings put system switch_dual_card_slots 1
2: pkill phone

dual SIM data switch
RealParity said:
The two commands I run (with root priveleges)
1: settings put system switch_dual_card_slots 1
2: pkill phone
Click to expand...
Click to collapse
i tried the above.
1 executes something, no msg.
2 gives an error message: pkill: TERM->24469: Operation not permitted
the data SIM does not change. but i guess it can't, as the 2nd command fails. what other things i might try?
and yes, i'm a noob on terminal commands - please walk me through how to automate this.

Bump after disabling one sim on location has I get no signal at work

zdoe said:
i tried the above.
1 executes something, no msg.
2 gives an error message: pkill: TERM->24469: Operation not permitted
the data SIM does not change. but i guess it can't, as the 2nd command fails. what other things i might try?
and yes, i'm a noob on terminal commands - please walk me through how to automate this.
Click to expand...
Click to collapse
Not sure if you got this figured out but you need to be rooted. Then in adb shell/terminal you must type "su" first then do the pkill

Anybody tried with a Xiaomi phone?
There's an app 4 this (dual sim switch widget) but it doesn't work on Xiaomi phones

Hi, I have a xiaomi mi 9t, I wish I could change the default sim for data, how much I receive or send a call.
What command can I give tasker for modifying the data sim?

Related

How to access private mode without access to screen? Galaxy S5

So, I'm an idiot and was working too close to my phone with some heavy tools. Long story short, I ended up dropping my Dewalt drill directly on the screen. It's completely ruined and no longer has any picture on the screen. The phone itself still turns on. I'm able to unlock with fingerprint, etc. The problem is...since I can't actually see anything on the screen, I'm not sure exactly where to press and swipe to access private mode. I had some files for work stored in private mode that I need to retrieve from the phone (customer contracts)...but since I can't see anything, I don't know exactly how to get them back. Any ideas? Thanks in advance!
Is adb debugging enabled on your device?
Fusseldieb said:
Is adb debugging enabled on your device?
Click to expand...
Click to collapse
I believe so, yes. I think I enabled it awhile ago.
mosesport said:
I believe so, yes. I think I enabled it awhile ago.
Click to expand...
Click to collapse
Perfect. Now you can make a .bat script that pushes a screenshot fron your device every second.
You do it in following way:
1. Create a normal text file and write in there:
Code:
:1
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.png
goto 1
2. Rename it to Screenshot.bat
3. Run it and you will see a command prompt in loop getting screenshots from your device. Then open the newly created "screen.png". If you're using Windows 7, the image will update automatically every second and you will see a 'live feed' of your device's screen.
If your touchscreen is damged too, you will need inputting keyevents, like touch x y. If that's your case, just say me and I'll explain you.
Sent from my SM-G925F using XDA-Developers mobile app
Fusseldieb said:
Perfect. Now you can make a .bat script that pushes a screenshot fron your device every second.
You do it in following way:
1. Create a normal text file and write in there:
Code:
:1
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.png
goto 1
2. Rename it to Screenshot.bat
3. Run it and you will see a command prompt in loop getting screenshots from your device. Then open the newly created "screen.png". If you're using Windows 7, the image will update automatically every second and you will see a 'live feed' of your device's screen.
If your touchscreen is damged too, you will need inputting keyevents, like touch x y. If that's your case, just say me and I'll explain you.
Sent from my SM-G925F using XDA-Developers mobile app
Click to expand...
Click to collapse
When I try to run the script, the command prompt gives an error stating "adb is not a recognized as an internal or extermal command."
mosesport said:
When I try to run the script, the command prompt gives an error stating "adb is not a recognized as an internal or extermal command."
Click to expand...
Click to collapse
Install adb on your machine, reboot and try again.
Search here on xda for "15 seconds adb and fastboot installer".
(While installing, press Y for Yes when prompting to install it system wide)
Do not forget to reboot!
Sent from my SM-G925F using XDA-Developers mobile app

Re-Run Setup*Wizard

Hi,
I am trying to re-run the setup wizard. I'm aware that I can do a factory reset and it will come up, but id like to not do that. I found an adb command that may launch it :
adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.SetupWizardTestActivity*
But that gives me a permission denied error. (Error is at the bottom of the post). Can anyone help me launch the setup wizard after it has*finished?
Alternatively, the only reason I'm trying to do this is to get back the ability to copy stuff over using the quickswitch adapter and cable. if anyone knows how to bring that up without the setup wizard, would be very helpful as well.
Thanks for all your help.
Error :
Starting: Intent { act=android.intent.action.MAIN cmp=com.google.android.setupwizard/.SetupWizardTestActivity } java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.google.android.setupwizard/.SetupWizardTestActivity } from null (pid=6398, uid=2000) not exported from uid 10037 at android.os.Parcel.readException(Parcel.java:1684) at android.os.Parcel.readException(Parcel.java:1637) at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:3137) at com.android.commands.am.Am.runStart(Am.java:635) at com.android.commands.am.Am.onRun(Am.java:388) at com.android.internal.os.BaseCommand.run(BaseCommand.java:51) at com.android.commands.am.Am.main(Am.java:121) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:262)
You need to do a factory reset to do that.
I did mention that I was aware that a factory reset would do that, but I would like to avoid that and do it in a different way. I know it can be invoked using adb, and I somehow was able to find the command as well, but didn't seem to work. Anyway, if anyone knows a way to do this without a factory reset, I would highly appreciate it.
It won't run unless you factory reset, that is what I was telling you, permissions will be denied otherwise.
The setup wizard only works if there are no accounts already setup on the device and the device is in an unsetup state. That only happens if you factory refresh.
Circling Back
So, just wanted to circle back... Contrary to the above, it is indeed possible*and I was able to do it and reproduce it reliably.*Long story short, it was the following two commands that did the trick :
1. adb shell
su
pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardActivity
2. adb shell settings put secure user_setup_complete 0
The first command is case sensitive (SetupWizardActivity)
Thanks to this source for the help and guidance : http://android.stackexchange.com/qu...-setup-wizard-at-next-boot-using-command-line
taimoorhusain said:
So, just wanted to circle back... Contrary to the above, it is indeed possible*and I was able to do it and reproduce it reliably.*Long story short, it was the following two commands that did the trick :
1. adb shell
su
pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardActivity
2. adb shell settings put secure user_setup_complete 0
The first command is case sensitive (SetupWizardActivity)
Thanks to this source for the help and guidance : http://android.stackexchange.com/qu...-setup-wizard-at-next-boot-using-command-line
Click to expand...
Click to collapse
Great job! I don't foresee I'd ever need to do something like this; however, I have great appreciation for all forms of ingenuity.
taimoorhusain said:
So, just wanted to circle back... Contrary to the above, it is indeed possible*and I was able to do it and reproduce it reliably
Click to expand...
Click to collapse
Congrats
I assume this requires root to enable? Any way around that? Thanks.
taimoorhusain said:
So, just wanted to circle back... Contrary to the above, it is indeed possible*and I was able to do it and reproduce it reliably.*Long story short, it was the following two commands that did the trick :
1. adb shell
su
pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardActivity
2. adb shell settings put secure user_setup_complete 0
The first command is case sensitive (SetupWizardActivity)
Thanks to this source for the help and guidance : http://android.stackexchange.com/qu...-setup-wizard-at-next-boot-using-command-line
Click to expand...
Click to collapse
Thank you, worked like a charm! :highfive:
@taimoorhusain A million thanks!!! You just saved my phone.
taimoorhusain said:
So, just wanted to circle back... Contrary to the above, it is indeed possible*and I was able to do it and reproduce it reliably.*Long story short, it was the following two commands that did the trick :
1. adb shell
su
pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardActivity
2. adb shell settings put secure user_setup_complete 0
The first command is case sensitive (SetupWizardActivity)
Thanks to this source for the help and guidance : http://android.stackexchange.com/qu...-setup-wizard-at-next-boot-using-command-line
Click to expand...
Click to collapse
THANKS A LOT IT WORKED!! You save my day because due to a pixel bug (this one) i was unable to do nothing unless i could open the SetupWizardActivity. Otherwise i would had to restore it.
taimoorhusain said:
So, just wanted to circle back... Contrary to the above, it is indeed possible*and I was able to do it and reproduce it reliably.*Long story short, it was the following two commands that did the trick :
1. adb shell
su
pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardActivity
2. adb shell settings put secure user_setup_complete 0
The first command is case sensitive (SetupWizardActivity)
Thanks to this source for the help and guidance : http://android.stackexchange.com/qu...-setup-wizard-at-next-boot-using-command-line
Click to expand...
Click to collapse
Do you need root for this?
Yes, you need root - doesnt appear to be possible to do it without.
I created an ' activities' shortcut using Nova launcher (it's added as a widget) by selecting pixel setup from the activities list. Super easy! And doesn't require root I think...
cant restore from cloud, thoguh
This works without root access
Code:
adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.deferred.DeferredSetupWizardActivity
Xdevillived666 said:
cant restore from cloud, thoguh
Click to expand...
Click to collapse
Yes it just cycles through the set up skipping the restore. How do we get the app restore part
Maybe just remove the google ac ? and then it will come to the restore part ?
If someone get the restore wizard running . Holler ....
taimoorhusain said:
So, just wanted to circle back... Contrary to the above, it is indeed possible*and I was able to do it and reproduce it reliably.*Long story short, it was the following two commands that did the trick :
1. adb shell
su
pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardActivity
2. adb shell settings put secure user_setup_complete 0
The first command is case sensitive (SetupWizardActivity)
Thanks to this source for the help and guidance : http://android.stackexchange.com/qu...-setup-wizard-at-next-boot-using-command-line
Click to expand...
Click to collapse
I just want to confirm that it worked on HavocOS on OnePlus 6T rooted.
I had an incident of total freezing, phone entering the Qualcomm CrashDump Mode, which I fixed by fastboot booting into twrp and reflashing (dirty flashing) the rom, twrp, gapps and magisk. Then it would notify me that I need to finish setting up the phone, but it didn’t worked (clicking the notification did nothing and I could not dismiss it). After running those two commands and rerunning the setup, it is effectively dismissed.
taimoorhusain said:
So, just wanted to circle back... Contrary to the above, it is indeed possible*and I was able to do it and reproduce it reliably.*Long story short, it was the following two commands that did the trick :
1. adb shell
su
pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardActivity
2. adb shell settings put secure user_setup_complete 0
The first command is case sensitive (SetupWizardActivity)
Thanks to this source for the help and guidance : http://android.stackexchange.com/qu...-setup-wizard-at-next-boot-using-command-line
Click to expand...
Click to collapse
Saved me TWICE within 1,5 month
taimoorhusain said:
Circling Back
So, just wanted to circle back... Contrary to the above, it is indeed possible*and I was able to do it and reproduce it reliably.*Long story short, it was the following two commands that did the trick :
1. adb shell
su
pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardActivity
2. adb shell settings put secure user_setup_complete 0
The first command is case sensitive (SetupWizardActivity)
Thanks to this source for the help and guidance : http://android.stackexchange.com/qu...-setup-wizard-at-next-boot-using-command-line
Click to expand...
Click to collapse
An old thread, but a life saver!!!
To get this to work for me on a Moto g power running AICP-15 (Android Q), I had to remove the "adb shell" part im line #2.

Remove all themes via ADB? Installed 8.1 Dev Preview without disabling themes first!

I installed the 8.1 Dev Preview on my Pixel XL and it can't boot due to SystemUI crashing. I think it's just because I still have overlays installed. Anyway to remove all the overlays via ADB? I'd appreciate any help! Thanks!
s1dest3pnate said:
I installed the 8.1 Dev Preview on my Pixel XL and it can't boot due to SystemUI crashing. I think it's just because I still have overlays installed. Anyway to remove all the overlays via ADB? I'd appreciate any help! Thanks!
Click to expand...
Click to collapse
Can you get into recovery? There's a script that's installed that you can run to remove themes in recovery.
Sent from my Pixel XL using Tapatalk
Acid0057 said:
Can you get into recovery? There's a script that's installed that you can run to remove themes in recovery.
Sent from my Pixel XL using Tapatalk
Click to expand...
Click to collapse
Yup, I remembered and found it. All fixed! Thank goodness for SubstratumRescue.zip! Thanks Substratum team!
s1dest3pnate said:
Yup, I remembered and found it. All fixed! Thank goodness for SubstratumRescue.zip! Thanks Substratum team!
Click to expand...
Click to collapse
Awesome!
Sent from my Pixel XL using Tapatalk
I am in the same boat. You are very ambiguous on how you actually fixed this. I am not rooted and have a Pixel 2 XL with access to adb through recovery
GBpfan95 said:
I am in the same boat. You are very ambiguous on how you actually fixed this. I am not rooted and have a Pixel 2 XL with access to adb through recovery
Click to expand...
Click to collapse
You're right, my apologies.
adb reboot bootloader (do this as soon as you hear USB connect at the Google logo)
fastboot boot twrp (I downloaded the 3.1.1.1 version from TWRP website)
Install SubstratumRescue.zip from the substratum folder on storage.
Did not install TWRP when prompted. I might have been asked one other question during the install or somewhere in TWRP but I don't recall.
s1dest3pnate said:
You're right, my apologies.
adb reboot bootloader (do this as soon as you hear USB connect at the Google logo)
fastboot boot twrp (I downloaded the 3.1.1.1 version from TWRP website)
Install SubstratumRescue.zip from the substratum folder on storage.
Did not install TWRP when prompted. I might have been asked one other question during the install or somewhere in TWRP but I don't recall.
Click to expand...
Click to collapse
Does that work even if I am locked and not rooted?
GBpfan95 said:
Does that work even if I am locked and not rooted?
Click to expand...
Click to collapse
Works without root, but not if you're locked I don't think. I'm not an expert and don't want to steer you in the wrong direction, but hopefully you can unlock bootloader via adb first, and then do the steps, but I'm not sure.
I just ended up factory resetting. Most of everything is backed up anyway. Definitely learned my lesson
Could you please post the SubstratumRescue.zip? I cannot get to the directory on my phone via ADB and want to try running the script commands manually.
EDIT: Nevermind, I tracked it down on the dev's AFH page.
I faced with same issue: Updated to 8.1 without disabling overlays first.
No root, locked bootloader.
In my case, system did load but was crashing every other minute.
I was able to launch subscratum+andromeda but they failed to disable overlays - it simply did not work.
So, I had do disable overlays manually via adb:
Code:
$ adb shell
$ cmd overlay list
$ cmd overlay disable OVERLAY_NAME_1
$ cmd overlay disable OVERLAY_NAME_2
,,,
AXP said:
I faced with same issue: Updated to 8.1 without disabling overlays first.
No root, locked bootloader.
In my case, system did load but was crashing every other minute.
I was able to launch subscratum+andromeda but they failed to disable overlays - it simply did not work.
So, I had do disable overlays manually via adb:
Code:
$ adb shell
$ cmd overlay list
$ cmd overlay disable OVERLAY_NAME_1
$ cmd overlay disable OVERLAY_NAME_2
,,,
Click to expand...
Click to collapse
Is it possible for you to guide me step by step on how to do this? My nexus 6p is locked and non-rooted. thanks
pR0wl3r said:
Is it possible for you to guide me step by step on how to do this? My nexus 6p is locked and non-rooted. thanks
Click to expand...
Click to collapse
Same with my 5X; once in ADB (using the Android SDK platform tools and Google USB drivers), when you run `adb shell` to open a shell connected to your phone, `cmd overlay list` will show all available overlays, and which are active or not. In my case (I was using BalticUI) I had...
Code:
C:\platform-tools>adb shell
bullhead:/ $ cmd overlay list
com.android.settings
[x] com.android.settings.BalticUI
com.android.systemui
[x] com.android.systemui.BalticUI
[x] com.android.systemui.navbars.BalticUI
[ ] com.android.systemui.theme.dark
So then you can enable or disable each overlay by name. E.g.:
Code:
bullhead:/ $ cmd overlay disable com.android.systemui.BalticUI
bullhead:/ $ cmd overlay list
com.android.settings
[x] com.android.settings.BalticUI
com.android.systemui
[ ] com.android.systemui.BalticUI
[x] com.android.systemui.navbars.BalticUI
[ ] com.android.systemui.theme.dark
That "....systemui.theme.dark" I presume is the new auto-theme component in 8.1 based on wallpaper color. I tried enabling it, but after trying to open a themed component, that overlay resets off. Luckily, BalticUI didn't cause any major problems like many other themes did; the main settings screen was the biggest difference, being just a text-only list of all the strings. Now to find a dark wallpaper...
jeremywh7 said:
Same with my 5X; once in ADB (using the Android SDK platform tools and Google USB drivers), when you run `adb shell` to open a shell connected to your phone, `cmd overlay list` will show all available overlays, and which are active or not. In my case (I was using BalticUI) I had...
Code:
C:\platform-tools>adb shell
bullhead:/ $ cmd overlay list
com.android.settings
[x] com.android.settings.BalticUI
com.android.systemui
[x] com.android.systemui.BalticUI
[x] com.android.systemui.navbars.BalticUI
[ ] com.android.systemui.theme.dark
So then you can enable or disable each overlay by name. E.g.:
Code:
bullhead:/ $ cmd overlay disable com.android.systemui.BalticUI
bullhead:/ $ cmd overlay list
com.android.settings
[x] com.android.settings.BalticUI
com.android.systemui
[ ] com.android.systemui.BalticUI
[x] com.android.systemui.navbars.BalticUI
[ ] com.android.systemui.theme.dark
That "....systemui.theme.dark" I presume is the new auto-theme component in 8.1 based on wallpaper color. I tried enabling it, but after trying to open a themed component, that overlay resets off. Luckily, BalticUI didn't cause any major problems like many other themes did; the main settings screen was the biggest difference, being just a text-only list of all the strings. Now to find a dark wallpaper...
Click to expand...
Click to collapse
Thanks but that did not work for me. Tried to disable but it's still there. Perhaps you need root?
bobby janow said:
Thanks but that did not work for me. Tried to disable but it's still there. Perhaps you need root?
Click to expand...
Click to collapse
You mean you tried to disable but it still shows an [X] showing enabled for that overlay? I am not rooted, nor with unlocked bootloader, and I could toggle them off (as shown above) and on. The overlays still show up for me, but are all disabled, and resolved the issues I was having as a result.
jeremywh7 said:
You mean you tried to disable but it still shows an [X] showing enabled for that overlay? I am not rooted, nor with unlocked bootloader, and I could toggle them off (as shown above) and on. The overlays still show up for me, but are all disabled, and resolved the issues I was having as a result.
Click to expand...
Click to collapse
Yeah still shows an x.
Sent from my Pixel using XDA-Developers Legacy app
Thanks!
AXP said:
I faced with same issue: Updated to 8.1 without disabling overlays first.
No root, locked bootloader.
In my case, system did load but was crashing every other minute.
I was able to launch subscratum+andromeda but they failed to disable overlays - it simply did not work.
So, I had do disable overlays manually via adb:
Code:
$ adb shell
$ cmd overlay list
$ cmd overlay disable OVERLAY_NAME_1
$ cmd overlay disable OVERLAY_NAME_2
,,,
Click to expand...
Click to collapse
Thanks so much mate this worked for me perfectly!
This can be done in a less manual fashion. It looks like many of you are on Windows, but I'm sure theres a way to accomplish something similar. I'm on Linux and this is how I did it.
Code:
➜ andromeda-substratum adb shell cmd overlay list | ag -Q [x] | awk '{ print $2 }' | xargs -n 1 echo cmd overlay disable
cmd overlay disable com.samsung.android.app.aodservice.StatusBarIconsforSamsungextras
cmd overlay disable com.samsung.android.smartmirroring.StatusBarIconsforSamsungextras
cmd overlay disable android.StatusBarIconsforSamsungextras
cmd overlay disable com.samsung.android.app.smartcapture.StatusBarIconsforSamsungextras
cmd overlay disable com.android.settings.StatusBarIconsforSamsungextras
cmd overlay disable com.samsung.android.lool.StatusBarIconsforSamsungextras
cmd overlay disable com.android.systemui.navbars.StatusBarIconsforSamsungextras
cmd overlay disable com.android.systemui.tiles.StatusBarIconsforSamsungextras
cmd overlay disable com.android.systemui.statusbars.StatusBarIconsforSamsungextras
➜ andromeda-substratum adb shell cmd overlay list | ag -Q [x] | awk '{ print $2 }' | xargs -n 1 adb shell cmd overlay disable
For reference, ag is very similar to grep. So the explanation is adb shell allows you to pass a command to it so it can run that command immediately. So adb shell cmd overlay list is the same as typing adb shell followed by cmd overlay list except it prints the output and immediately exits. So I take that output, grep (using ag in this case) for the enabled overlays and then programmatically disable them. xargs -n 1 says take at most one of the arguments passed to this command and append it to the rest of the line. So this calls adb shell cmd overlay disable __insert-overlay-here__ repeatedly.
I messed up good....
So, I tried flashing the 8.1 Final using Chainfire like a tutorial suggested. That was my second mistake.
My first one was apparently not removing my overlays. So anyway...
My device rebooted after Chainfire, and was on the G/progress bar for like 5 mins so I knew something was up.
I decided to flash the complete factory image, and I removed the '-w' from the flash-all script so it wouldn't wipe my data.
Now the device boots, and of course I have the System UI issue because I didn't clear the overlays. But wait... it gets better!
I found this thread, so I fastboot booted into TWRP to run the commands. It asks for my password- and when I enter it, it says it's invalid!! I tried numerous times, rebooted etc, and it still does not accept my passcode.
It appears I should be able to use ADB in TWRP without my passcode, so I give it a try. I am able to sideload no problem, however when I type 'adb shell' it tells me 'error:closed'. I've searched that error, which everyone says was fixed for them with either a reboot or updating their adb/fastboot. I did both of those things, and the error still persists.
I have also tried sideloading the substratumrescue.zip file I found in another thread, however it doesn't seem to be made for this systemless setup or something.
I have had to set this device up twice since I got it, and I am really not looking forward to doing it a third time, so if anyone has any suggestions that will keep my data, I would be happy to hear them out!!
What could be causing TWRP not to accept my passcode?
Why do I get the 'error:closed' when I try to adb shell?
Any help is greatly appreciated!
EDIT: Resolved. I was able to delete all overlaid apk's from /data/app.
Hi there,
Question, I got a non-rooted S8, Stock in like everything, and it runs everything fine, including Substratum!
I am wondering about one thing though after reading this thread, imagine something went wrong, what would be my options? I found the Rescue ZIP on my phone, can I apply this if needed with the original recovery from the S8? Or do I need TWRP for that?
---------- Post added at 08:44 PM ---------- Previous post was at 08:39 PM ----------
s1dest3pnate said:
Works without root, but not if you're locked I don't think. I'm not an expert and don't want to steer you in the wrong direction, but hopefully you can unlock bootloader via adb first, and then do the steps, but I'm not sure.
Click to expand...
Click to collapse
Hi mate, do I read correctly, that its possible to only boot TWRP temporaly without flashing it?
I have to put the folder/files in the same folder as platform tools?

GUIDE: How to avoid the Captive Portal Checkin to Google

Dear XDA community,
this my first own thread and guide so please be forbear with me
And i hope i choose the right section
As the topic in the thread says it handles about the Captive Portal Checkin done by Android.
So first some general info about this.
1. What is the Captive Portal Checkin?
Every time your android phone connects to the internet via mobile connection or wlan it sends a request to the following url:
http://connectivitycheck.gstatic.com (Google URL).
After that your gets device gets http 204 answer from the mentioned url and at that point the x-symbol at your network icon in the status bar disappears.
The reason for that behavior is that Android wants to be sure that your connection has internet access.
If you block that request via AfWall for example the dns fails in some cases and you can't go into the Internet.
Silly.
2. Why is this problematic?
That's a good question because this answer from Google doesn't much hold data. But every time when this connection is done Google get the following information:
- IP-adress
- Time of the internet access
- the Browser which you use
In my case i use custom roms and no Gapps to avoid Google as much as i can. So i don't want that "ping" to Google.
That's the reason why i searched for possibilitys to get rid of this ping. And thanks to a german security and privacy specalist i found a possibilty to avoid the ping to Google and have working Internet, too.
3. What did that guy do?
Very simple. He just started his own Captive Portal Checkin Service. So no need for Google anymore
WHAT YOU NEED:
- Computer with installed ADB
- Active USB Debugging at your phone
- At least Android 7
TESTED ON:
I tested his instructions on my old Xperia Z3 phone (CarbonROM 7.0 based on Android 9, Custom Rom).
IMPORTANT:
You need to execute the commands with a booted system (valid for both posts where i write the instructions). It DOESN'T work in the terminal of recoveries (e.g. twrp).
Thanks @jaysir for the information.
INSTRUCTIONS:
Android 7:
1. Connect the phone with your computer
2. Activate ADB and test the connection with the "adb devices" command. If your phone shows up go to step 3.
3. Execute these commands in your terminal:
=> adb shell 'settings put global captive_portal_http_url "http://captiveportal.kuketz.de" '
=> adb shell 'settings put global captive_portal_https_url "https://captiveportal.kuketz.de" '
Android 8 and 9:
1. Connect the phone with your computer
2. Activate ADB and test the connection with the "adb devices" command. If your phone shows up go to step 3.
3. Execute these commands in your terminal:
=> adb shell 'settings put global captive_portal_http_url "http://captiveportal.kuketz.de" '
=> adb shell 'settings put global captive_portal_https_url "https://captiveportal.kuketz.de" '
=> adb shell 'settings put global captive_portal_fallback_url "http://captiveportal.kuketz.de" '
=> adb shell 'settings put global captive_portal_other_fallback_urls "http://captiveportal.kuketz.de" '
Well that's it. When you want to revert back just execute the commands again with this url:
http command: http://connectivitycheck.gstatic.com/generate_204
https command:
https://connectivitycheck.gstatic.com/generate_204
Link to the source:
https://www.kuketz-blog.de/android-...204-http-antwort-von-captiveportal-kuketz-de/
If i make any typos tell me
Thanks again to the german security researcher and his community there is a way to deactivate the captive portal checkin completly.
It works on Android 7 and Android 8.1/9. But in comparision to the method in my first post this needs root access on your phone.
For all new users:
I recommend Magisk to gain root.
So now the instructions:
For Android 8/9:
1. Open a terminal on your phone (via terminal apps).
2. Type the following command:
- su
- su
- pm disable com.android.captiveportallogin
- settings put global captive_portal_detection_enabled 0
- settings put global captive_portal_server localhost
- settings put global captive_portal_mode 0
3. Then reboot your phone (via hardware buttons, system or terminal app).
For Android 7:
1. Open a terminal on your phone (via terminal apps).
2. Type the following commands:
- su
- settings put global captive_portal_detection_enabled 0
- settings put global captive_portal_server localhost
- settings put global captive_portal_mode 0
3. Then reboot your phone (via hardware buttons, system or terminal app).
Link to Source
https://www.kuketz-blog.de/empfehlungsecke/#captive-portal
Very nice and very important tutorial!
Just for completeness; and I don't claim and definitely don't have a copyright. I reported these procedures already here end of April in the thread "Enhanced Privacy, Security and Battery Duration! My Measures...". I mentioned it also once here in the AFWall+ thread.
I'm very glad that these procedures get repeated and repeated again. From my personal point of view it's so important to develop the stance to not allow Google to collect our data. I've subscribed to Mike Kuketz and am very grateful for his job and dedication.
Oswald Boelcke said:
Very nice and very important tutorial!
Just for completeness; and I don't claim and definitely don't have a copyright. I reported these procedures already here end of April in the thread "Enhanced Privacy, Security and Battery Duration! My Measures...". I mentioned it also once here in the AFWall+ thread.
I'm very glad that these procedures get repeated and repeated again. From my personal point of view it's so important to develop the stance to not allow Google to collect our data. I've subscribed to Mike Kuketz and am very grateful for his job and dedication.
Click to expand...
Click to collapse
I agree to you. It's a pity that so much people don't care about it.
I must admit i forgot to search in forum whether the instructions was already posted but as you said every mention helps.
Thanks, however, not working on pixel experience rom.
Update:
Seems no settings command under ADB shell, worked when turning on Usb debugging.
jaysir said:
Thanks, however, not working on pixel experience rom.
seems no settings command under ADB shell
Click to expand...
Click to collapse
Thx for your info. And i will try it on my old z3 with the custom rom which you mentioned.
I know there is a Android 9 based Pixel Experience for the z3.
Will report then.
dhacke said:
Thx for your info. And i will try it on my old z3 with the custom rom which you mentioned.
I know there is a Android 9 based Pixel Experience for the z3.
Will report then.
Click to expand...
Click to collapse
Sorry, I did not make myself clear.
It just not working under recovery mode.
After booting to the system and opening the USB debugging, it is working.
jaysir said:
Sorry, I did not make myself clear.
It just not working under recovery mode.
After booting to the system and opening the USB debugging, it is working.
Click to expand...
Click to collapse
Good to know (and i'm happy that now everything works)
I will edit the guide and add your information to it.
Thanks.
Thanks dhacke for all this information.
I got here from a link on an XDA forum for the Huawei Watch 2 LTE smartwatch. Do you know if this can be done to the watch as well?
ajlajluk said:
Thanks dhacke for all this information.
I got here from a link on an XDA forum for the Huawei Watch 2 LTE smartwatch. Do you know if this can be done to the watch as well?
Click to expand...
Click to collapse
As far as i see it the adb method (post 1) could working because according to the Internet the device runs Wear OS which is basically a android version for smartwatches.
So in theory you can activate USB debugging and redirect the captive portal to mike kuketz service as long as the commands are accepted.
Regarding method 2 i can't say anything because i don't own a smartwatch and have zero knowledge whether root is possible/how it is done on those smartwatches (which is needed for that method).
dhacke said:
As far as i see it the adb method (post 1) could working because according to the Internet the device runs Wear OS which is basically a android version for smartwatches.
So in theory you can activate USB debugging and redirect the captive portal to mike kuketz service as long as the commands are accepted.
Regarding method 2 i can't say anything because i don't own a smartwatch and have zero knowledge whether root is possible/how it is done on those smartwatches (which is needed for that method).
Click to expand...
Click to collapse
Just as you said, I enabled adb debugging, opened a terminal session from my mac to the watch and sent the commands from version 1 and they were both accepted. I should be able to check if it has worked tomorrow so will keep everyone updated when I've tested it.
OK. My watch appeared to connect to wifi but then said "No Internet".
I've now done the same mod to my phone, deleted the supermarket wifi I'm trying to connect my watch to from both the watch and the phone and will try again. I'm also wondering whether haveing BT on at the same time is causing a problem so I'll try with it on and then off and see if it makes any difference.
Thanks again for giving me hope I'll be able to connect WearOS 2 to a captive portal wifi network.
Further to above, unfortunately still no joy. Watch says "Connected" for the briefest moment then "No Internet" and won't go any further.
Never mind.
Thanks again for your work for the Android community.
Is it safe?
We are sending data to completely unknown server, that's why asking.
Datta258 said:
Is it safe?
We are sending data to completely unknown server, that's why asking.
Click to expand...
Click to collapse
In my opinion yes. The mentioned security expert has a good reputation afaik and he didn't make any things in the past which give me a reason to distrust him.
And in the near future he will work for german commissioner for data protection and freedom of Informationen. So i think he is a trustworthy person.
In the privacy policy on his site for the captive portal check service he writes that no information at all will be logged.
Of course you can ask him directly via e-mail if my words don't soothe you; i can only share my opinion about that guy
Thanks.
dhacke said:
For Android 8/9:
1. Open a terminal on your phone (via terminal apps).
2. Type the following command:
- su
- su
- pm disable com.android.captiveportallogin
- settings put global captive_portal_detection_enabled 0
- settings put global captive_portal_server localhost
- settings put global_portal_mode 0
3. Then reboot your phone (via hardware buttons, system or terminal app).
Click to expand...
Click to collapse
Does this still work on Pie?
On my rooted Galaxy Note 10 (Pie, 1st Sept. Patch) it does not.
Btw. there is a typo, should it be "settings put global captive_portal_mode 0"? This is what I tried. If I then check the values by "settings get..." I get
1: 0
2: localhost
3: 0
So the values were taken, but it still tries to connect to captiveportal.kuketz.de or google (whatever I have set). If I block it, I will get the exclamation next to the wifi symbol.
ZXR said:
Does this still work on Pie?
On my rooted Galaxy Note 10 (Pie, 1st Sept. Patch) it does not.
Btw. there is a typo, should it be "settings put global captive_portal_mode 0"? This is what I tried. If I then check the values by "settings get..." I get
1: 0
2: localhost
3: 0
So the values were taken, but it still tries to connect to captiveportal.kuketz.de or google (whatever I have set). If I block it, I will get the exclamation next to the wifi symbol.
Click to expand...
Click to collapse
Oh yes you are right. There was a typo. It must be 'settings put global captive_portal_mode 0'.
Now it's corrected. Thanks.
Did you make a reboot after execute the commands?
On my side it works on Pie too. I have a z3 with Lineage 16 and my device doesn't make the check.
When it' still not work after the reboot and the commands are typed in right (=> no issue notification in the terminal comes up) the Samsung stock rom could be the problem.
In that case i would recommend to use kuketz server.
dhacke said:
Did you make a reboot after execute the commands?
Click to expand...
Click to collapse
Yes and even after several reboots I get:
adb shell settings get global captive_portal_detection_enabled
0
adb shell settings get global captive_portal_server
localhost
adb shell settings get global captive_portal_mode
0
But, if not opened via script, I can see 185.163.119.132 (kuketz) being blocked by AFWall and the exclamation mark. So I open it with
$IPTABLES -A "afwall" -d 185.163.119.132 -m owner --uid-owner 1000 -p tcp -j ACCEPT
This works but I would prefer no C-P check.
One off-topic question:
Do you have an idea how to open the IP 0.1.0.1:0 in AFWall? It is used for VoLTE, but even I use th script line above (with 0.1.0.1) it still gets blocked. I have to open UID 1000 completely...
ZXR said:
Yes and even after several reboots I get:
adb shell settings get global captive_portal_detection_enabled
0
adb shell settings get global captive_portal_server
localhost
adb shell settings get global captive_portal_mode
0
But, if not opened via script, I can see 185.163.119.132 (kuketz) being blocked by AFWall and the exclamation mark. So I open it with
$IPTABLES -A "afwall" -d 185.163.119.132 -m owner --uid-owner 1000 -p tcp -j ACCEPT
This works but I would prefer no C-P check.
Click to expand...
Click to collapse
You wrote 'adb'. Does it mean that you tried the commands in the adb shell from your Computer with connected phone?
That could explain why it isn't working. The commands must be typed in directly on the phone for deactivation.
I use the App 'Terminal Emulator' from F-Droid for this.
Link: https://f-droid.org/app/jackpal.androidterm
You could try it with that app once more. Apart from that i'm running out of ideas atm.
ZXR said:
One off-topic question:
Do you have an idea how to open the IP 0.1.0.1:0 in AFWall? It is used for VoLTE, but even I use th script line above (with 0.1.0.1) it still gets blocked. I have to open UID 1000 completely...
Click to expand...
Click to collapse
Sorry, but no. I don't use VoLTE or Scripts in AfWall+.

Enable 'developer driver' in any application for your Graphics Driver Preference

On Android 10, by default, all apps are set to use the default system graphics driver. You were also able to select the type of driver (default, game or system) from a menu that an app would use when running. In android 11, that option is not available (as of June 16, 2021).
However, in android 11 you can change this manually and enable the 'developer driver' for your graphics preferences for any app using ADB.
Code:
adb shell settings put global game_driver_opt_in_apps com.package.name
To add more than one application to the settings value, you probably have to separate the package names by either a comma or semicolon. Once you're done with that step, run the next command.
Code:
adb shell settings put global game_driver_prerelease_opt_in_apps com.package.name
Then reboot the device. Enter settings, system, advanced, developer settings and choose 'Graphics Driver Preference' and make sure the application you chose in the first step has the 'developer driver' selected. Please note that the option will not be present in the drop-down menu when selecting the application in graphics driver preferences. All other applications should say 'default'.
Have you now adb command for system graphics driver ? I Huawei device and I can't change it at all only via adb debugging.
Does anyone know the command for system graphics driver?
Maybe in the Dev Options Menu?
Zaxx32 said:
Maybe in the Dev Options Menu?
Click to expand...
Click to collapse
I don't have any that menu in android 10 but when I change on dev or game driver there is performance differences so it work but I was try and I don't know how to set it up so my only hope is adb.
astronomy2021 said:
I don't have any that menu in android 10 but when I change on dev or game driver there is performance differences so it work but I was try and I don't know how to set it up so my only hope is adb.
Click to expand...
Click to collapse
I fund it on Poco X3 Pro with "adb shell settings list global" had few apps set as a system driver.
The Command for system graphics driver is
Code:
adb shell settings put global game_driver_opt_out_apps com.package.name
astronomy2021 said:
Does anyone know the command for system graphics driver?
Click to expand...
Click to collapse
+1
rodken said:
+1
Click to expand...
Click to collapse
I think its:
Code:
adb shell settings put global game_driver_opt_in_apps com.package.names
rodken said:
+1
Click to expand...
Click to collapse
Actually here is the answer you are looking for:
Code:
adb shell settings put global game_driver_all_apps
And for the values of that setting:
Code:
Game driver global preference for all apps:
0 = default
1 = All apps use game driver
2 = All apps use system graphics driver
Reference: http://www.java2s.com/example/java-src/pkg/android/provider/settings-84201.html
DragonFire1024 said:
Actually here is the answer you are looking for:
Code:
adb shell settings put global game_driver_all_apps
And for the values of that setting:
Code:
Game driver global preference for all apps:
0 = default
1 = All apps use game driver
2 = All apps use system graphics driver
Reference: http://www.java2s.com/example/java-src/pkg/android/provider/settings-84201.html
Click to expand...
Click to collapse
I am utlizing Tasker for my adb shell needs and after inputting 'settings put global game_driver_all_apps 2', I not able to produce the results that I am trying to effectuate.
rodken said:
I am utlizing Tasker for my adb shell needs and after inputting 'settings put global game_driver_all_apps 2', I not able to produce the results that I am trying to effectuate.
Click to expand...
Click to collapse
Disappointing actually. I thought perhaps there would be some kind of discernible difference whether it would have been good or bad. But I'm also not surprised as perhaps It is a bit early as I believe this would apply to the very most recent versions of Android probably going into 12. I guess we'll have to wait and see what it pertains to if anything.
It throws this to me. I use termux on phone without using adb shell
Exception occurred while executing 'put':
java.lang.SecurityException: Permission Denial: getCurrentUser() from pid=5222, uid=10268 requires android.permission.INTERACT_ACROSS_USERS
at com.android.server.am.UserController.getCurrentUser(UserController.java:2214)
at com.android.server.am.ActivityManagerService.getCurrentUser(ActivityManagerService.java:19388)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:259)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:49)
at android.os.Binder.shellCommand(Binder.java:932)
at android.os.Binder.onTransact(Binder.java:816)
at android.os.Binder.execTransactInternal(Binder.java:1162)
at android.os.Binder.execTransact(Binder.java:1126)
Click to expand...
Click to collapse
To make editing easier, using Setedit also works
astronomy2021 said:
I fund it on Poco X3 Pro with "adb shell settings list global" had few apps set as a system driver.
The Command for system graphics driver is
Code:
adb shell settings put global game_driver_opt_out_apps com.package.name
Click to expand...
Click to collapse
My pc says dont find package
astronomy2021 said:
I fund it on Poco X3 Pro with "adb shell settings list global" had few apps set as a system driver.
The Command for system graphics driver is
Code:
adb shell settings put global game_driver_opt_out_apps com.package.name
Click to expand...
Click to collapse
I'm new into this, but that "com.package.name" is a file or what? If it's like this, where I find it? Or that [/CODE] what I got to write in this?

Categories

Resources