Android S 默认WIFi 热点名称

时间:2025-01-27 18:52:40

Android 12 带GMS的项目wifi热点名称被mainline掉了

如果要修改热点名称可以参考如下3种方法

1. 使用RRO Overlay 

google介绍文档Wi-Fi  |  Android 开源项目  |  Android Open Source Project

修改方法就是创建个RRO覆盖,但是这种改法显示的热点后面会默认带数字,例如Android_1234

vendor/mediatek/proprietary/packages / overlay/vendor/WifiResOverlay/

diff --git a/WifiResOverlay/ b/WifiResOverlay/
index 5c611ad..4532038 100644
--- a/WifiResOverlay/
+++ b/WifiResOverlay/
@@ -17,13 +17,13 @@
 <!-- Simple app to demonstrate how OEM's can customize the various overlays exposed by
      the wifi stack -->
 <manifest xmlns:andro
-    package=""
+    package=""
     android:versionCode="1"
     android:versionName="1.0">
     <application android:hasCode="false" />
     <overlay
-      android:targetPackage=""
+      android:targetPackage=""
       android:targetName="WifiCustomization"
       android:isStatic="true"
-      android:priority="0"/>
+      android:priority="10"/>
 </manifest>
diff --git a/WifiResOverlay/res/values/ b/WifiResOverlay/res/values/
index 32355fa..f5dd0f4 100644
--- a/WifiResOverlay/res/values/
+++ b/WifiResOverlay/res/values/
@@ -19,6 +19,8 @@
 <!-- Overrides the default value of the specified config values when this sample app is installed -->
 <resources>
 
+    <string name="wifi_tether_configure_ssid_default" translatable="false">ywysh</string>

第二种方法

在MtkSettings里添加个Receiver接收开机广播

首次开机的时候直接重新设置热点名称

    WifiManager mWifiManager = (WifiManager) (Context.WIFI_SERVICE);
    final SoftApConfiguration config = ();
    String mSSID = ("");
    (
        new (config).setSsid(mSSID).build());    

第三种方法

去掉wifi mainline模块,不会影响CTS

device / mediatek/system/common/

MAINLINE_INCLUDE_WIFI_MODULE := false

            # FBE is mandatory for Q new launching device
            # Mainline partner build config - updatable APEX
            # MAINLINE_INCLUDE_WIFI_MODULE = true
            # add by songhui for disable wifi mainline
            PRODUCT_SYSTEM_PROPERTIES += =true
            MAINLINE_INCLUDE_WIFI_MODULE := false
            MAINLINE_COMPRESS_APEX_ART := true
            MAINLINE_COMPRESS_APEX_MEDIAPROVIDER := true

packages / modules/Wifi/service/java/com/android/server/wifi/

    private SoftApConfiguration getDefaultApConfiguration() {
         configBuilder = new ();
        (generateDefaultBand(mContext));
        //(().getString(
        //        .wifi_tether_configure_ssid_default) + "_" + getRandomIntForDefaultSsid());
        //wifi热点名称
        + ((""));
        if (ApConfigUtil.isWpa3SaeSupported(mContext)) {
            (generatePassword(),

packages / modules/Wifi/service/java/com/android/server/wifi/p2p/

        private String getPersistedDeviceName() {
            String deviceName = (WIFI_P2P_DEVICE_NAME);
            if (null != deviceName) return deviceName;
            logd("the default device name: " + prefix + postfix);
           - //return prefix + postfix; //wifi直连名字
           + return ("");
        }