קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
החל מגרסה 8.0 של Android, מכשירי Android משתמשים בכתובות MAC אקראיות כשהם מחפשים רשתות חדשות בלי להיות משויכים לרשת. ב-Android 9, אפשר להפעיל אפשרות למפתחים (מושבתת כברירת מחדל) כדי לגרום למכשיר להשתמש בכתובת MAC אקראית כשמתחברים לרשת Wi-Fi.
ב-Android 10, רנדומיזציה של כתובות MAC מופעלת כברירת מחדל במצב לקוח, ב-SoftAp וב-Wi-Fi Direct.
רנדומיזציה של MAC מונעת ממאזינים להשתמש בכתובות MAC כדי ליצור היסטוריה של פעילות המכשיר, וכך לשפר את פרטיות המשתמשים.
בנוסף, כתובות ה-MAC נוצרות באופן אקראי כחלק מהפעולות של Wi-Fi Aware ושל Wi-Fi RTT.
הדגל הזה משמש לקביעת אם האפשרות של רנדומיזציה של כתובת MAC ב-Wi-Fi Direct מופעלת.
בודקים את ההטמעה באמצעות השיטות שמתוארות בקטע אימות.
ממשק המשתמש של המערכת חייב:
יש אפשרות להפעיל או להשבית את האפשרות לבחירה אקראית לכל SSID.
הפעלת רנדומיזציה של כתובות MAC כברירת מחדל לכל הרשתות החדשות שנוספו.
כדי להטמיע הנחיות חדשות, אפשר להשתמש בהטמעת העזרה של ממשק המשתמש של ההגדרות.
יכול להיות שבמכשירים עם Android מגרסה 9 ומטה אין תמיכה ברנדומיזציה של MAC ב-Wi-Fi. כשמשדרגים מכשירים כאלה ל-Android 10, אפשר להשבית את התכונה 'רנדומיזציה של כתובות MAC ב-Wi-Fi' על ידי הגדרת הדגל WIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION ל-true בקובץ ה-make של HAL של ספק ה-Wi-Fi.
אימות
כדי לוודא שהתכונה פועלת כמצופה, מריצים בדיקה ידנית:
כדי לוודא שהרנדומיזציה של MAC מופעלת במכשיר, בודקים ש-config_wifi_connected_mac_randomization_supported מוגדר ל-true בשכבת-העל של המכשיר.
מתחברים לרשת Wi-Fi.
מקישים על הערוץ כדי לעבור לדף הפרטים שלו. מוודאים שהרנדומיזציה של MAC מופעלת. מוודאים שכתובת ה-MAC שמוצגת היא כתובת MAC אקראית, שבה הבייט שנוצר באופן מקומי מוגדר כ-1 והבייט של ה-multicast מוגדר כ-0.
משביתים את האפשרות 'יצירת כתובת MAC אקראית'. מתחברים לאותה רשת ומוודאים שמשמשת כתובת ה-MAC המקורית.
כדי למחוק את הרשת, מקישים על מחיקה בדף הפרטים של הרשת.
מתחברים לאותה רשת ומוודאים שנעשה שימוש באותה כתובת MAC אקראית.
כדי לבדוק רנדומיזציה של כתובות MAC במכשיר עם גרסת Android ישנה יותר (שיכול לתמוך ברנדומיזציה של כתובות MAC) שמשודרג ל-Android מגרסה 10 ואילך:
יש לכם רשת אחת לפחות שמאוחסנת במכשיר עם Android 9 ואילך.
מבצעים אימג' פלאש של תמונת המערכת של Android 10.
בבורר הרשתות, מוודאים שהרנדומיזציה של כתובות ה-MAC מושבתת בכל הרשתות השמורות.
מפעילים את הרנדומיזציה של כתובות ה-MAC. מתחברים לאותה רשת ומוודאים שמשתמשים בכתובת ה-MAC האקראית.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# Implement MAC randomization\n\nStarting in Android 8.0, Android devices use randomized MAC addresses when\nprobing for new networks while not associated with a network. In\nAndroid 9, you can enable a developer option (it's\n**disabled** by default) to cause the device to use a randomized MAC address\nwhen connecting to a Wi-Fi network.\n\nIn Android 10, MAC randomization is enabled by default\nfor client mode, SoftAp, and Wi-Fi Direct.\n\nMAC randomization prevents listeners from using MAC addresses to build a history\nof device activity, thus increasing user privacy.\n\nAdditionally, MAC addresses are randomized as part of\n[Wi-Fi Aware](/docs/core/connect/wifi-aware) and\n[Wi-Fi RTT](/docs/core/connect/wifi-rtt) operations.\n\nFor more information, see\n[MAC Randomization Behavior](/docs/core/connect/wifi-mac-randomization-behavior).\n\nImplementation\n--------------\n\nTo implement MAC randomization on your device:\n\n1. Work with a Wi-Fi chip vendor to implement the following HAL methods:\n\n - `IWifiStaIface#setMacAddress`: Configures the MAC address of the interface. The default implementation brings the interface down, changes the MAC address, and brings the interface back up.\n - `IWifiStaIface#getFactoryMacAddress`: Gets the factory MAC of `wlan0` using an `ioctl` call.\n - `ISupplicantP2pIface#setMacRandomization`: Sets P2P MAC randomization on/off in the supplicant.\n2. Set\n [`config_wifi_connected_mac_randomization_supported`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/core/res/res/values/config.xml)\n to `true` in the Settings `config.xml` (this can be done in a device\n custom overlay).\n\n - This flag is used to control whether client-mode MAC randomization is enabled.\n3. Set\n [`config_wifi_p2p_mac_randomization_supported`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/core/res/res/values/config.xml)\n to `true` in the Settings `config.xml` (this can be done in a device\n custom overlay).\n\n - This flag is used to control whether Wi-Fi direct MAC randomization is enabled.\n4. Test your implementation using the methods described in\n [Validation](#validation).\n\nThe System UI must:\n\n- Have an option to enable or disable randomization for each SSID.\n- Have MAC randomization enabled by default for all newly added networks.\n\nUse the\n[reference implementation](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/apps/Settings/src/com/android/settings/wifi/details2/WifiPrivacyPreferenceController2.java)\nof Settings UI to implement new prompts.\n\nDevices running Android 9 or lower might not have\nsupport for Wi-Fi MAC randomization. When upgrading such devices to Android\n10, the Wi-Fi MAC randomization feature can be disabled\nby setting the `WIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION` flag to true in\nthe Wi-Fi vendor HAL make file.\n\nValidation\n----------\n\nTo validate that the feature is working as intended, run a manual test:\n\n1. Verify that MAC randomization is enabled on the device by checking that `config_wifi_connected_mac_randomization_supported` is set to `true` in the device overlay.\n2. Connect to a Wi-Fi network.\n3. Tap the network to go to the Network details page. Verify that MAC randomization is turned on. Verify that the MAC address displayed is a randomized MAC, which has the locally generated bit set to 1 and the multicast bit set to 0.\n4. Turn MAC randomization off. Connect to the same network and verify that the factory MAC is being used.\n5. Delete the network by tapping **Forget** on the Network details page.\n6. Connect to the same network and verify that the **same** randomized MAC\n address is being used.\n\n | **Note:** Randomized MAC addresses are generated per SSID and are persistent.\n\nTo test MAC randomization on a pre-Android 10 device\n(capable of supporting MAC randomization) upgrading to Android\n10 or higher:\n\n1. Have at least one saved network on a device running Android 9 or lower.\n2. Flash the Android 10 system image.\n3. In the Wi-Fi picker, verify that MAC randomization is turned off for all saved networks.\n4. Turn MAC randomization on. Connect to the same network and verify that the randomized MAC is being used.\n\n| **Note:** You may experience up to a three-second delay when connecting to a network due to the driver flushing saved scan results when the interface goes down. If this is the case, check with your silicon partners to resolve the issue."]]