What is AAPT (Android Asset Packaging Tool) and how does it work?
Asked Answered
Q

4

76

What does AAPT (Android Asset Packaging Tool) mean? How does it work?

Can I ship the .so file of one application in the APK file of another application using AAPT?

Quincy answered 30/1, 2015 at 11:13 Comment(3)
Was your application built with NDK?Bally
aapt has no relationship with ndk, although it is written in cpp @BallyLisalisabet
@xetrasu Read the question, it mentions .so file.Bally
E
44

AAPT allows you to view, create, and update ZIP-compatible archives (ZIP, JAR, and APK). It can also compile resources into binary assets. It is the base builder for Android applications.

Of course you can ship .so files from an application, but if you want to use it, you will need reverse engineering plugins and these are not very recommended because of the complexity. I don't know anyone for Android, but there are a bunch of environments plugins.

Also you can research a bit before posting,

Erida answered 30/1, 2015 at 11:30 Comment(3)
Hi MarcS, How to execute the aapt command in windows : I am trying following but getting error D:\Android Software\Qt for android\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\build-tools\android-4.4W>aapt list D:\New folder\FirstActivity.apk I am missing something???Quincy
Don't know what can be, try #19434470Erida
gotcha thank you im learning android and this answers help me a lotKally
L
22

Android Asset Packaging Tool(AAPT)

aapt is about Android resources like .xml etc

AAPT stands for Android Asset Packaging Tool. The Android Asset Packaging Tool (aapt) takes your application resource files, such as the AndroidManifest.xml file and the XML files for your Activities, and compiles them.This is a great tool which help you to view, create, and update your APKs (as well as zip and jar files). It can also compile resources into binary assets. It is the base builder for Android aplications. This tool is a piece of the SDK (and assemble framework) and permits you to see, make, and redesign Zip-perfect chronicles (zip, jolt, apk)

You can find it

..\android-sdk\build-tools\<buildToolsVersion>
  1. aapt package, aapt add - Building Android Application Bundles (APKs)

  2. aapt dump - Dumping information from an APK file via:

  • read a VersionCode

    aapt dump badging <name>.apk
    
  • Check Your Permissions

    aapt dump permissions <name>.apk
    

Also aapt take care of resources in ProGuard process[About]

Read more here, here, here

Loewi answered 13/3, 2018 at 15:19 Comment(0)
V
19

It is the default tool of the Android SDK to pack all classes and resources in an APK file.

Vesting answered 30/1, 2015 at 11:28 Comment(2)
Where is aapt tool located? I cannot find it in my $ANDROID_HOME dir.Bally
it is located under every build tool like Androidsdk\build-tools\23.0.2Vesting
D
6

When your application is compiled, AAPT generates the R class, which contains resource IDs for all the resources in your res/ directory. For each type of resource, there is an R subclass (for example, R.drawable for all drawable resources), and for each resource of that type, there is a static integer (for example, R.drawable.icon). This integer is the resource ID that you can use to retrieve your resource.

SOURCE: https://developer.android.com/guide/topics/resources/accessing-resources.html (copy/pasted)

Depute answered 15/6, 2017 at 19:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.