Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotspot in Android 11 #75

Closed
ahadobas opened this issue Aug 6, 2021 · 11 comments
Closed

Hotspot in Android 11 #75

ahadobas opened this issue Aug 6, 2021 · 11 comments
Assignees
Labels

Comments

@ahadobas
Copy link

ahadobas commented Aug 6, 2021

Hi,
My phone has freshd itself to Android 11.
I installed the latest version 5.1.
But at "Wi-Fi hotspot" setting got "Not supported for Android 11+" message.
It worked on Android 10 with Google Play version.
How can I get back the switching opportunity of hotspot on my phone?
Thanks.

@henrichg
Copy link
Owner

henrichg commented Aug 6, 2021

Yes this is probem. I do not found solution for Android 11+. Maybe solution is with PhoneProfilesPlusExtender. Or root. I will looking on it. And maybe will be resolved in next version.

@henrichg henrichg self-assigned this Aug 6, 2021
@henrichg henrichg added the bug label Aug 6, 2021
@ahadobas
Copy link
Author

ahadobas commented Aug 6, 2021

Maybe solution is with PhoneProfilesPlusExtender.

Nothing has changed after installing this one :(

Or root.

I don't want to root because of my mobilbank app :(

I will looking on it. And maybe will be resolved in next version.

I'm waiting for it :)

@henrichg
Copy link
Owner

henrichg commented Aug 6, 2021

"Maybe solution is with PhoneProfilesPlusExtender.

  • Nothing has changed after installing this one :("

Is not implemeted. I must implenet it ;-)

@henrichg
Copy link
Owner

Hm:

"If using Android Version >= 11
You can start a hotspot with TetheringManager#startTethering code here. Here is an example from the official docs on usage.
Similarly, there is a TetheringManager#stopTethering method with code here. This will stop a hotspot."
https://stackoverflow.com/questions/67318738/how-do-i-enable-disable-hotspot-or-tethering-mode-programmatically-on-android

But these methods are marked with: @SystempApi. Application must be installed as system application. :-(

Only solution is emulating user clicks to device Settings as for "Force stop application". But this si complicated, because of changes in Settings GUI in various devices. :-(

@Acers1
Copy link

Acers1 commented Aug 25, 2021

Other apps like
MacroDroid - Device Automation
https://play.google.com/store/apps/details?id=com.arlosoft.macrodroid&hl=en&gl=US
And
Automate
https://play.google.com/store/apps/details?id=com.llamalab.automate&hl=en&gl=US
support this

My device is rooted

@henrichg
Copy link
Owner

Hm hm. MacroDroid working. Tested in my non-rooted Galaxy S21. Only problem is with Wi-Fi off (not working), even when I install latest MacroDroid Helper apk.

My, in Android 10 working version not working in Android 11. Returned is:

java.lang.NoSuchMethodError: No interface method startTethering(ILandroid/os/ResultReceiver;ZLjava/lang/String;)V in class Landroid/net/IConnectivityManager; or its super classes (declaration of 'android.net.IConnectivityManager' appears in /system/framework/framework.jar!classes2.dex)

IConnectivityManager is changed in Android 11. :-(

I must search for solution.

@henrichg
Copy link
Owner

henrichg commented Aug 26, 2021

Yes, I was readed it.

Problem is with this: TetheringManager#startTethering() and TetheringManager#stopTethering().

  1. I must use java reflection for running it. Because for compile android sdk 29 (used in PPP) class TetheringManager not exists.
  2. Problem is with StartTetheringCallback callback parameter. This interface not exists in compile sdk 29.

In MacroDroid is not needed root to enable hotspot. And its compile sdk is 30+. :-(

PPP uses this, to call android hidden api: https://github.com/anggrayudi/android-hidden-api
But for compile sdk 30 is in android.jar bug. It generates error when I build PPP. By me, I must wait for fix.
anggrayudi/android-hidden-api#84

@henrichg
Copy link
Owner

News: I can build with compile SDK = 30.

This problem is resolved:
"PPP uses this, to call android hidden api: https://github.com/anggrayudi/android-hidden-api
But for compile sdk 30 is in android.jar bug. It generates error when I build PPP. By me, I must wait for fix.
anggrayudi/android-hidden-api#84"

;-)

@henrichg
Copy link
Owner

Done. Wifi hotspot for Android 11+ is impleneted.Tested in Samsung Galaxy S21, Android 11. Xiaomi Redmi Note 9, Android 11. Pixel 3a, Android 12 beta 5.

Please install a test it in your device:
https://drive.google.com/file/d/1KMasYeFp47knvOJkmQyvuXbcFPNwyF43/view?usp=drivesdk

Thank you.

@henrichg
Copy link
Owner

Tested with another users and working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants