For faster navigation, this Iframe is preloading the Wikiwand page for APK.

APK

APK
扩展名
.apk.xapk.apks.apkm
互联网媒体类型
application/vnd.android.package-archive
格式类型包管理器 存档文件
作为容器软件包
扩展自JARZIP
维基百科应用程式的APK安装界面
绝大多数Android装置,比如Nexus 4,允许用户安装APK格式的文件来使用应用程式。

Android包(英语:Android PackageAPK),是Android操作系统使用的一种应用程式包文件格式,用于分发和安装流动应用中间件。一个Android应用程式的代码想要在Android装置上运行,必须先进行编译,然后被打包成为一个被Android系统所能识别的文件才可以被运行,而这种能被Android系统识别并运行的文件格式便是“APK”。 一个APK文件内包含被编译的代码文件(.dex 文件),文件资源(resources), assets,证书(certificates),和清单文件(manifest file)。[1][2][3][4]

APK文件基于ZIP文件格式,它与JAR文件的构造方式相似。它的互联网媒体类型是:application/vnd.android.package-archive[5]

结构

一个APK文件通常包含以下文件:

  • META-INF 文件夹:
    • MANIFEST.MF: 清单文件(Manifest file)
    • CERT.RSA: 保存着该应用程式的证书和授权资讯。
    • CERT.SF: 保存着 SHA-1 资讯资源列表,比如:
      Signature-Version: 1.0
      Created-By: 1.0 (Android)
      SHA1-Digest-Manifest: wxqnEAI0UA5nO5QJ8CGMwjkGGWE=
      ...
      Name: res/layout/exchange_component_back_bottom.xml
      SHA1-Digest: eACjMjESj7Zkf0cBFTZ0nqWrt7w=
      ...
      Name: res/drawable-hdpi/icon.png
      SHA1-Digest: DGEqylP8W0n0iV/ZzBx3MW0WGCA=
      
  • res: APK所需要的资源文件夹。
  • AndroidManifest.xml: 一个传统的Android清单文件,用于描述该应用程式的名字、版本号、所需权限、注册的服务、链接的其他应用程式。该文件使用XML文件格式,可以编译为二进制的XML,使用的工具为 AXMLPrinter2页面存档备份,存于互联网档案馆) 或apktool页面存档备份,存于互联网档案馆).
  • classes.dex: classes文件通过DEX编译后的文件格式,用于在Dalvik虚拟机上运行的主要代码部分。
  • resources.arsc:程序的语言文件,可以透过这软件用(AndroidResEdit等工具)来进行翻译

也可以用ApkTool等工具来反编译后再开始进行软件修改,亦可编译回来。

分发

APK格式由谷歌公司Google)发布,但谷歌在其官方应用商店Google Play并不提供apk文件下载,用户只能通过安卓手机上的应用程式Play商店来在线安装其他应用。但有第三方的网站提供应用的APK下载,用户可以下载到手机,然后在本地安装,不过第三方网站提供的apk档有可能被窜改甚至加入恶意软件,用户需留意资讯安全风险。

扩展阅读

参考文献

  1. ^ Inside the Android Application Framework (video). Google Sites. Google. 2008 [2012-01-08]. (原始内容存档于2011-12-24). 
  2. ^ Hatem Ben Yacoub. Tips: How to install apk files on Android Emulator. Open Handset Magazine. 19 January 2008 [2012年1月8日]. (原始内容存档于2012年5月26日). 
  3. ^ The Structure of Android Package (APK) Files. OPhone SDN. OPhone Software Developer Network. 17 November 2010 [2012年1月8日]. (原始内容存档于2011年8月15日). 
  4. ^ chibucks. Learn to Fish: General Structure of an APK. SDX-Developers Forum. Simple Machines Forum. 28 May 2010 [2012年1月8日]. (原始内容存档于2012年7月17日). 
  5. ^ Developer description of MIME type for .apk. [2012-01-08]. (原始内容存档于2009-07-18). 

外部链接

{{bottomLinkPreText}} {{bottomLinkText}}
APK
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?