Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android 10如何在源代码中禁用随机Mac地址_Android_Android Wifi - Fatal编程技术网

android 10如何在源代码中禁用随机Mac地址

android 10如何在源代码中禁用随机Mac地址,android,android-wifi,Android,Android Wifi,目前,我正在源代码中连接特定的WiFi 但问题是,自从Android 10以来,默认设置是设置一个随机的Macarres。 是的,我强制将mac adrress设置为wifi信息,或者我想关闭随机mac adrress选项 这是我的密码 嗨@sangHoon,你得到解决方案了吗?我也面临同样的问题。@mdroid不幸的是,我无法解决这个问题。hi@sangHoon,你找到解决方案了吗?我也面临同样的问题。@mdroid很遗憾,我无法解决这个问题 if(BasicInfo.wifiEncrypti

目前,我正在源代码中连接特定的WiFi

但问题是,自从Android 10以来,默认设置是设置一个随机的Macarres。 是的,我强制将mac adrress设置为wifi信息,或者我想关闭随机mac adrress选项

这是我的密码


嗨@sangHoon,你得到解决方案了吗?我也面临同样的问题。@mdroid不幸的是,我无法解决这个问题。hi@sangHoon,你找到解决方案了吗?我也面临同样的问题。@mdroid很遗憾,我无法解决这个问题
if(BasicInfo.wifiEncryption == BasicInfo.WPA_PSK){
            BasicInfo.debug(TAG,"setWiFiConfigForJellyBean :BasicInfo.WPA_PSK");


            config.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
            config.allowedProtocols.set(WifiConfiguration.Protocol.WPA); 
            config.allowedProtocols.set(WifiConfiguration.Protocol.RSN); 
            config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
            config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
            config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
            config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
            config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
            config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);

            config.preSharedKey = "\"".concat(BasicInfo.WIFI_PASSWORD).concat("\"");


            BasicInfo.debug(TAG,"BasicInfo.WPA_PSK Password :" + BasicInfo.WIFI_PASSWORD);

        }