赞
踩
Android 11 固定wifi热点名和密码的路径和早期版本也有不同,Android 11 固定wifi热点名和密码的路径方法如下:
1.固定wifi热点名
a.去掉热点明后的SSID
--- a/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiApConfigStore.java +++ b/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiApConfigStore.java @@ -273,9 +273,11 @@ public class WifiApConfigStore { private SoftApConfiguration getDefaultApConfiguration() { SoftApConfiguration.Builder configBuilder = new SoftApConfiguration.Builder(); configBuilder.setBand(SoftApConfiguration.BAND_2GHZ); - configBuilder.setSsid(mContext.getResources().getString( - R.string.wifi_tether_configure_ssid_default) + "_" + getRandomIntForDefaultSsid()); - if (ApConfigUtil.isWpa3SaeSupported(mContext)) { +// configBuilder.setSsid(mContext.getResources().getString( +// R.string.wifi_tether_configure_ssid_default) + "_" + getRandomIntForDefaultSsid()); + configBuilder.setSsid(mContext.getResources().getString(R.string.wifi_tether_configure_ssid_default)); + + if (ApConfigUtil.isWpa3SaeSupported(mContext)) { configBuilder.setPassphrase(generatePassword(), SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION); } else {
b,在config文件中更改自己想要的热点名
--- a/frameworks/opt/net/wifi/service/res/values/config.xml
+++ b/frameworks/opt/net/wifi/service/res/values/config.xml
@@ -275,7 +275,7 @@
<string name="config_wifi_tcp_buffers" translatable="false">524288,1048576,2097152,262144,524288,1048576</string>
<!-- Do not translate. Default access point SSID used for tethering -->
- <string name="wifi_tether_configure_ssid_default" translatable="false">AndroidAP</string>
+ <string name="wifi_tether_configure_ssid_default" translatable="false">WiFIHotspot</string>
<!-- Do not translate. Default access point SSID used for local only hotspot -->
<string name="wifi_localhotspot_configure_ssid_default" translatable="false">AndroidShare</string>
2.固定wifi密码
--- a/frameworks/base/wifi/java/android/net/wifi/SoftApConfiguration.java
+++ b/frameworks/base/wifi/java/android/net/wifi/SoftApConfiguration.java
@@ -255,7 +255,7 @@ public final class SoftApConfiguration implements Parcelable {
@NonNull List<MacAddress> blockedList, @NonNull List<MacAddress> allowedList) {
mSsid = ssid;
mBssid = bssid;
- mPassphrase = passphrase;
+ mPassphrase = "12345678";//passphrase;
mHiddenSsid = hiddenSsid;
mBand = band;
mChannel = channel;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。