투케이2K

881. (Android/AAPT) 안드로이드 aapt 명령어 사용해 apk 파일 AndroidManifest.xml 정보 확인 본문

Android

881. (Android/AAPT) 안드로이드 aapt 명령어 사용해 apk 파일 AndroidManifest.xml 정보 확인

투케이2K 2024. 9. 19. 19:11

[개발 환경 설정]

개발 툴 : AndroidStudio

개발 언어 : Java / Kotlin

 

[소스 코드]

 

# ------------------------------------------------------------------------------------------------
# [사전) 명령어 수행 환경 설명]
# ------------------------------------------------------------------------------------------------

OS : Window

Terminal : CMD

사전 조건 : 

  - 안드로이드 스튜디오 설치가 된 PC 환경 필요

  - 안드로이드 스튜디오에서 상단 Tools 메뉴 >> SDK Manager 메뉴 >> Android SDK Location 위치 확인

     >> ex : C:\Users\twok\AppData\Local\Android\Sdk

# ------------------------------------------------------------------------------------------------





# ------------------------------------------------------------------------------------------------
# [방법 설명]
# ------------------------------------------------------------------------------------------------

1. CMD 실행 후 AAPT 가 포함되어 있는 위치까지 이동 수행

  >> 경로 : C:\Users\twok\AppData\Local\Android\Sdk\build-tools\<특정 빌드 버전>
  >> 예시 : C:\Users\twok\AppData\Local\Android\Sdk\build-tools\33.0.1


2. [특정 build 버전] 내에 포함 된 AAPT 사용해 AndroidManifest.xml 파일 정보 확인 실시

  >> 문법 : aapt dump xmltree <특정 APK 파일 경로> AndroidManifest.xml
  >> 예시 : C:\Users\twok\AppData\Local\Android\Sdk\build-tools\33.0.1> aapt dump xmltree C:\Users\twok\Desktop\app-release.apk AndroidManifest.xml


3. 터미널 창에 출력 된 결과 확인

N: android=http://schemas.android.com/apk/res/android
  E: manifest (line=2)
    A: android:versionCode(0x0101021b)=(type 0x10)0x2
    A: android:versionName(0x0101021c)="2.0.1" (Raw: "2.0.1")
    A: android:compileSdkVersion(0x01010572)=(type 0x10)0x21
    A: android:compileSdkVersionCodename(0x01010573)="13" (Raw: "13")
    A: package="com.example.javaproject" (Raw: "com.example.javaproject")
    A: platformBuildVersionCode=(type 0x10)0x21
    A: platformBuildVersionName=(type 0x10)0xd
    E: uses-sdk (line=7)
      A: android:minSdkVersion(0x0101020c)=(type 0x10)0x15
      A: android:targetSdkVersion(0x01010270)=(type 0x10)0x21
    E: uses-permission (line=14)
      A: android:name(0x01010003)="android.permission.READ_PHONE_STATE" (Raw: "android.permission.READ_PHONE_STATE")
    E: uses-permission (line=15)
      A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
    E: uses-permission (line=16)
      A: android:name(0x01010003)="android.permission.ACCESS_WIFI_STATE" (Raw: "android.permission.ACCESS_WIFI_STATE")
    E: uses-permission (line=17)

    ..........

    E: queries (line=174)
      E: package (line=177)
        A: android:name(0x01010003)="com.android.chrome" (Raw: "com.android.chrome")
      E: package (line=184)
        A: android:name(0x01010003)="com.example.kotlinproject" (Raw: "com.example.kotlinproject")
      E: package (line=185)
        A: android:name(0x01010003)="com.example.javaproject" (Raw: "com.example.javaproject")

    E: application (line=220)
      A: android:theme(0x01010000)=@0x7f12000b
      A: android:label(0x01010001)=@0x7f11001c
      A: android:icon(0x01010002)=@0x7f0e0000
      A: android:name(0x01010003)="com.example.javaproject.A_Application" (Raw: "com.example.javaproject.A_Application")
      A: android:screenOrientation(0x0101001e)=(type 0x10)0x1
      A: android:configChanges(0x0101001f)=(type 0x11)0x4a0
      A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x20
      A: android:allowBackup(0x01010280)=(type 0x12)0x0
      A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
      A: android:largeHeap(0x0101035a)=(type 0x12)0xffffffff
      A: android:supportsRtl(0x010103af)=(type 0x12)0xffffffff
      A: android:extractNativeLibs(0x010104ea)=(type 0x12)0xffffffff
      A: android:usesCleartextTraffic(0x010104ec)=(type 0x12)0xffffffff
      A: android:roundIcon(0x0101052c)=@0x7f0e0000
      A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
      A: android:requestLegacyExternalStorage(0x01010603)=(type 0x12)0xffffffff
      E: uses-library (line=262)
        A: android:name(0x01010003)="org.apache.http.legacy" (Raw: "org.apache.http.legacy")
        A: android:required(0x0101028e)=(type 0x12)0x0
      E: provider (line=269)
        A: android:name(0x01010003)="androidx.core.content.FileProvider" (Raw: "androidx.core.content.FileProvider")
        A: android:exported(0x01010010)=(type 0x12)0x0
        A: android:authorities(0x01010018)="com.example.javaproject.provider" (Raw: "com.example.javaproject.provider")
        A: android:grantUriPermissions(0x0101001b)=(type 0x12)0xffffffff
        E: meta-data (line=274)
          A: android:name(0x01010003)="android.support.FILE_PROVIDER_PATHS" (Raw: "android.support.FILE_PROVIDER_PATHS")
          A: android:resource(0x01010025)=@0x7f140001
      E: activity (line=282)
        A: android:name(0x01010003)="com.example.javaproject.A_Intro" (Raw: "com.example.javaproject.A_Intro")
        A: android:exported(0x01010010)=(type 0x12)0xffffffff
        A: android:configChanges(0x0101001f)=(type 0x11)0x4a0
        A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x20
        E: intent-filter (line=295)
          E: action (line=296)
            A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
          E: category (line=298)
            A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
        E: intent-filter (line=303)
          E: action (line=304)
            A: android:name(0x01010003)="android.intent.action.VIEW" (Raw: "android.intent.action.VIEW")
          E: category (line=306)
            A: android:name(0x01010003)="android.intent.category.DEFAULT" (Raw: "android.intent.category.DEFAULT")
          E: category (line=307)
            A: android:name(0x01010003)="android.intent.category.BROWSABLE" (Raw: "android.intent.category.BROWSABLE")
          E: data (line=310)
            A: android:scheme(0x01010027)="java" (Raw: "java")
            A: android:host(0x01010028)="login" (Raw: "login")
          E: data (line=315)
            A: android:scheme(0x01010027)="java" (Raw: "java")
            A: android:host(0x01010028)="call" (Raw: "call")

     ..........

# ------------------------------------------------------------------------------------------------






# ------------------------------------------------------------------------------------------------
# [참고 사이트]
# ------------------------------------------------------------------------------------------------

https://developer.android.com/tools/aapt2?hl=ko#dump

# ------------------------------------------------------------------------------------------------

 

반응형
Comments