I've read a lot posts about it like How to turn on the wi-fi hotspot using ADB? but all of them based on "click emulations", but I have root and it doesn't solve my problem.
I've tried VPN Hotspot app and it work perfectly even without root permissions (using only "WRITE_SETTINGS" perm.)
I need to enable it using command line even when phone is locked, something like:
adb shell su -c service call connectivity 24 i32 0 i32 0 i32 0 s16 random
but for Wi-Fi tethering.
I've Android 11 rooted device.
Update
I found that it is possible to do this through a similar command:
service call tethering 4 null s16 random
void startTethering(in TetheringRequestParcel request, String callerPkg, String callingAttributionTag, IIntResultListener receiver);
But first argument null
is wrong because here must be this interface:
parcelable TetheringRequestParcel {
int tetheringType;
LinkAddress localIPv4Address;
LinkAddress staticClientAddress;
boolean exemptFromEntitlementCheck;
boolean showProvisioningUi;
int connectivityScope;
}
How to put it instead of null
?
service call
method where some argument is object like in my caseparcelable TetheringRequestParcel
. Is it possible to call some methods like it or only simple likewifi
? – mixalbl4 Oct 18 '22 at 07:37service -h
.Parcel
is a Java object, so you need to write Java code. – Irfan Latif Oct 18 '22 at 08:44