티스토리 뷰

Manifest 에서 Intent Filter 를 사용하는 요소들은 

android:exported 를 명시적으로 선언하도록 targetSdk=31 부터 변경됨.

 

이 설정을 명시하지 않을 경우, Android 12 부터는 앱 설치가 안됨.

 

<activity
    android:name="kr.my.MainActivity"
    android:screenOrientation="portrait"
    android:exported="true"
    android:windowSoftInputMode="adjustNothing">
    <intent-filter>
			// intent filters......
    </intent-filter>
</activity>

 

 

위는 커스텀 스킴, Launcher 등의 intent filter 가 걸려 있는 Main Activity 이다.

위 예 처럼. 이제 intent-filter 를 사용하는 애들은 exported 를 true, false 로 명시해줘야함.

 

android:exported 에 대한 설명은 아래에 있음.

https://developer.android.com/guide/topics/manifest/activity-element?hl=ko#exported 

 

<액티비티>  |  Android 개발자  |  Android Developers

Declares an activity (an Activity subclass) that implements part of the application's visual user interface. All activities must be represented by {@code } elements in the manifest file. Any that are not declared there will not be seen by the system…

developer.android.com

 

 

기존에는 따로 선언하지 않아도, android:exported=true 로 자동 설정 됨.

아마 무분별한 앱 접근을 막기 위해 

개발자가 내부적으로 사용하는 intent-filter 의 경우 false 로 줘서 

외부 접근을 막고, 앱 보안에 더 신경써라 라는 의미인 것 같음.

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함