LAN의 기기는 INTERNET 권한이 있는 모든 앱에서 액세스할 수 있습니다.
이렇게 하면 앱이 로컬 기기에 쉽게 연결할 수 있지만 사용자의 지문 생성, 위치의 프록시 역할 등 개인 정보 보호 관련 문제가 발생할 수 있습니다.
로컬 네트워크 보호 프로젝트는 새로운 런타임 권한 뒤에 로컬 네트워크에 대한 액세스를 제한하여 사용자의 개인 정보를 보호하는 것을 목표로 합니다.
영향
Android 16에서는 이 권한이 선택 기능이므로 선택한 앱에만 영향을 미칩니다. 선택의 목표는 앱 개발자가 향후 Android 출시에서 권한 보호를 준비할 수 있도록 앱의 어떤 부분이 암시적 로컬 네트워크 액세스에 종속되는지 이해하는 것입니다.
다음을 사용하여 사용자의 로컬 네트워크에 액세스하는 앱은 영향을 받습니다.
로컬 네트워크 주소에서 원시 소켓의 직접 또는 라이브러리 사용 (예: mDNS 또는 SSDP 서비스 검색 프로토콜)
로컬 네트워크에 액세스하는 프레임워크 수준 클래스 (예: NsdManager) 사용
영향 세부정보
로컬 네트워크 주소와의 트래픽에는 로컬 네트워크 액세스 권한이 필요합니다. 다음 표에는 몇 가지 일반적인 케이스가 나와 있습니다.
앱 하위 수준 네트워크 작업
로컬 네트워크 권한 필요
아웃바운드 TCP 연결 만들기
예
수신 TCP 연결 수락
예
UDP 유니캐스트, 멀티캐스트, 브로드캐스트 전송
예
수신 UDP 유니캐스트, 멀티캐스트, 브로드캐스트
예
이러한 제한은 네트워킹 스택 깊숙한 곳에 구현되므로 모든 네트워킹 API에 적용됩니다. 여기에는 플랫폼 또는 관리 코드에서 생성된 소켓, Cronet 및 OkHttp와 같은 네트워킹 라이브러리, 그 위에 구현된 모든 API가 포함됩니다. 로컬 네트워크(예: .local 접미사가 있는 서비스)에서 서비스를 확인하려면 로컬 네트워크 권한이 필요합니다.
위 규칙의 예외:
기기의 DNS 서버가 로컬 네트워크에 있는 경우 포트 53에서 DNS 서버와의 트래픽에는 로컬 네트워크 액세스 권한이 필요하지 않습니다.
출력 전환 도구를 인앱 선택기로 사용하는 애플리케이션에는 로컬 네트워크 권한이 필요하지 않습니다 (추가 안내는 향후 출시에서 제공).
LAN 액세스 불일치 (특정 액세스를 '로컬 네트워크' 액세스로 간주해서는 안 된다고 생각함)
LAN 액세스가 차단되어야 하지만 차단되지 않는 버그
LAN 액세스가 차단되어서는 안 되지만 차단되는 버그
다음은 이번 변경사항의 영향을 받지 않습니다.
인터넷 액세스
모바일 네트워크
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-26(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-26(UTC)"],[],[],null,["# Local Network Permission\n\nDevices on a LAN can be accessed by any app that has the `INTERNET`\npermission.\nThis makes it easy for apps to connect to local devices, but also carries\nprivacy implications such as forming a fingerprint of the user and being a\nproxy for location.\n\nThe Local Network Protections project aims to protect the user's privacy by\ngating access to the local network behind a new runtime permission.\n\nImpact\n------\n\nDuring Android 16, this permission is an opt-in feature which means only the\napps that opt-in will be affected. The goal of the opt-in is for app developers\nto understand which parts of their app depend on implicit local network access\nsuch that they can prepare to permission guard them on a future Android release.\n\nApps will be affected if they access the user's local network using:\n\n- Direct or library use of raw sockets on local network addresses (e.g. mDNS or SSDP service discovery protocol)\n- Use of framework level classes that access the local network (e.g. NsdManager)\n\n### Details of Impact\n\nTraffic to and from a local network address requires local network access\npermission. The following table lists some common cases:\n\n| App Low Level Network Operation | Local Network Permission Required |\n|--------------------------------------------------------|-----------------------------------|\n| Making an outgoing TCP connection | yes |\n| Accepting an incoming TCP connection | yes |\n| Sending a UDP unicast, multicast, broadcast | yes |\n| Receiving a incoming UDP unicast, multicast, broadcast | yes |\n\nThese restrictions are implemented deep in the networking stack, and thus they\napply to **all networking APIs**. This includes sockets created in the platform\nor managed code, networking libraries like Cronet and OkHttp, and any APIs\nimplemented on top of those. Trying to resolve services on the local network\n(i.e. those with a .local suffix) will require local network permission.\n| **Note:** Traffic originating from Android Webviews that require local network access will inherit permission state from the host app\n\nExceptions to the preceding rules:\n\n- If a device's DNS server is on a local network, traffic to / from it (at port 53) doesn't require local network access permission.\n- Applications using Output Switcher as their in-app picker won't need local network permissions (more guidance to come at a later release).\n\n| **Note:** Many media casting scenarios depend on access to the local network and will be impacted by this change. However, not all apps which offer casting will need to request the new permission. Future APIs and guidance for dealing with casting scenarios will be provided at a later Android Release.\n\nGuidance\n--------\n\nTo opt into local network restrictions, do the following:\n\n1. Flash your device to a build with Android 16 Beta 3 or later\n2. Install the app to be tested\n3. Toggle the Appcompat config by using adb\n\n adb shell am compat enable RESTRICT_LOCAL_NETWORK \u003cpackage_name\u003e\n\n4. **Reboot the device**\n\nNow your app's access to the local network is restricted and any attempt to\naccess the local network will lead to socket errors.\nIf you are using APIs that perform local network operations outside of your app\nprocess (Ex: NsdManager), they won't be impacted during the opt-in.\n\nTo restore access, you must grant your app permission to `NEARBY_WIFI_DEVICES`.\n\n- Ensure the app declares the `NEARBY_WIFI_DEVICES` permission in its manifest.\n- Go to Settings \\\u003e Apps \\\u003e \\[Application Name\\] \\\u003e Permissions \\\u003e Nearby devices \\\u003e Allow\n\n| **Note:** in a future Android release, this feature will be guarded by a new permission in the [`NEARBY_DEVICES`](/reference/android/Manifest.permission_group#NEARBY_DEVICES) permission group.\n\nNow your app's access to the local network should be restored and all your\nscenarios should work as they did prior to opting the app in. Here is how the\napp network traffic will be impacted.\n\n| Permission | Outbound LAN Request | Outbound/Inbound Internet Request | Inbound LAN Request |\n|-------------|----------------------|-----------------------------------|---------------------|\n| Granted | Works | Works | Works |\n| Not Granted | Fails | Works | Fails |\n\nUse the following command to toggle-off the Appcompat config \n\n adb shell am compat disable RESTRICT_LOCAL_NETWORK \u003cpackage_name\u003e\n\n### Errors\n\nErrors arising from these restrictions will be returned to the calling socket\nwhenever it invokes `send` or a `send` variant to a local network address.\n\nExample errors: \n\n sendto failed: EPERM (Operation not permitted)\n\n sendto failed: ECONNABORTED (Operation not permitted)\n\n### Bugs\n\n[Submit bugs](/about/versions/16/feedback) and feedback for:\n\n- Discrepancies in LAN access (you don't think a certain access should be considered \"local network\" access)\n- Bugs where LAN access should be blocked but isn't\n- Bugs where LAN access shouldn't be blocked but is\n\nThe following should be unaffected by this change:\n\n- Access to the Internet\n- Mobile Network"]]