CN103186380B - The development approach of APK and device - Google Patents
The development approach of APK and device Download PDFInfo
- Publication number
- CN103186380B CN103186380B CN201110461665.9A CN201110461665A CN103186380B CN 103186380 B CN103186380 B CN 103186380B CN 201110461665 A CN201110461665 A CN 201110461665A CN 103186380 B CN103186380 B CN 103186380B
- Authority
- CN
- China
- Prior art keywords
- apk
- androidmainfest
- bytecode
- root directory
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Stored Programmes (AREA)
Abstract
The invention provides development approach and the device of a kind of APK, method comprises: replace the general information recorded in the resource file in source engineering catalogue and the AndroidMainfest.xml file in the engineering catalogue of amendment source and Java source code; Be compiled into Class bytecode under resource file and AndroidMainfest.xml file are put into the root directory of APK and by the Java source code in the engineering catalogue of source, then Class bytecode be treated to Dex bytecode, and under being put into the root directory of APK; The packing of Dex bytecode in root directory, AndroidMainfest.xml file and resource file is obtained APK.The present invention can reuse source code to develop the APK of different editions.
Description
Technical field
The present invention relates to field of software development, in particular to development approach and the device of a kind of APK (AndroidPacKage, Android bag).
Background technology
The source code of APK can be divided into three parts: Java source code, AndroidMainfest.xml file, resource file.AndroidMainfest.xml file is the global configuration file of APK, under being positioned at the root directory of APK, describe the global data in APK, comprise the assembly (activities, services etc.) exposed in APK, and they separately realize class, the important informations such as the data that various energy is processed and enable position.
Fig. 1 shows the conventional compilation process of APK, comprises the following steps:
1, by Java compiler, Java source code is compiled into Class bytecode, and then by the DX instrument that Android carries, Class bytecode is treated to Dex bytecode.Finally, aapt instrument is used Dex bytecode to be put into the root directory of APK;
AndroidMainfest.xml file processes by the aapt instrument 2, using Android to carry, and is put into the root directory of APK;
Resource file processes by the aapt instrument 3, using Android to carry, and is put into the root directory of APK;
4, the file packing that above three steps are formed obtains a complete APK.
5, APK obtained in the previous step is signed.
Summary of the invention
The present invention aims to provide development approach and the device of a kind of APK, to reuse source code to develop the APK of different editions.
In an embodiment of the present invention, provide the development approach of a kind of APK, comprise: replace the general information recorded in the resource file in source engineering catalogue and the AndroidMainfest.xml file in the engineering catalogue of amendment source and Java source code, revise the general information recorded in AndroidMainfest.xml file in the engineering catalogue of described source and Java source code to comprise: according to the requirement of user, arrange the server address in described general information, APK title and packagename; Be compiled into Class bytecode under resource file and AndroidMainfest.xml file are put into the root directory of APK and by the Java source code in the engineering catalogue of source, then Class bytecode be treated to Dex bytecode, and under being put into the root directory of APK; The packing of Dex bytecode in root directory, AndroidMainfest.xml file and resource file is obtained APK.
In an embodiment of the present invention, provide the development device of a kind of APK, comprise: modified module, for replacing the general information recorded in AndroidMainfest.xml file in resource file in the engineering catalogue of source and amendment source engineering catalogue and Java source code, described modified module is used for the requirement according to user, arranges the server address in described general information, APK title and packagename; Collector, for being compiled into Class bytecode under resource file and AndroidMainfest.xml file are put into the root directory of APK and by the Java source code in the engineering catalogue of source, then Class bytecode is treated to Dex bytecode, and under being put into the root directory of APK; Packetization module, for obtaining APK by the packing of the Dex bytecode in root directory, AndroidMainfest.xml file and resource file.
The development approach of the APK of the above embodiment of the present invention and the reusable source code of device develop the APK of different editions.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, and form a application's part, schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 shows the conventional compilation process of APK;
Fig. 2 shows the process flow diagram of the development approach of the APK according to the embodiment of the present invention;
Fig. 3 shows the compilation process of the APK according to the embodiment of the present invention;
Fig. 4 shows the schematic diagram of the development device of the APK according to the embodiment of the present invention.
Embodiment
Below with reference to the accompanying drawings and in conjunction with the embodiments, describe the present invention in detail.
Fig. 2 shows the process flow diagram of the development approach of the APK according to the embodiment of the present invention, comprising:
Step S10, replaces the general information recorded in the resource file in source engineering catalogue and the AndroidMainfest.xml file in the engineering catalogue of amendment source and Java source code;
Step S20, Class bytecode is compiled under resource file and AndroidMainfest.xml file are put into the root directory of APK and by the Java source code in the engineering catalogue of source, then Class bytecode is treated to Dex bytecode, and under being put into the root directory of APK;
Step S30, obtains APK by the packing of the Dex bytecode in root directory, AndroidMainfest.xml file and resource file.
This method, by replacement resource file and amendment general information, avoids needs and again writes source code fully, thus achieve and reuse source code to develop the APK of different editions, to meet the user's request of various personalization.
In addition, this method can pass easily through computer programming to realize, thus automatically can realize the compiling of the APK of various version, repeats loaded down with trivial details work to reduce, and facilitates developer to inquire about compiling record and add up.
Preferably, resource file comprises picture resource as LOGO etc.Picture resource is more typical individual demand.
Preferably, step S20 comprises: according to the requirement of user, arranges the server address in general information, APK title and packagename.Amendment server address, APK title and packagename are more typical individual demands.
Preferably, this method also comprises: sign to APK.This can strengthen the security of APK.
Preferably, this method also comprises: to the APK checked for integrity of signature.This can strengthen the security of APK.
Fig. 3 shows the compilation process of the APK according to the embodiment of the present invention, compared to Figure 1 comparatively, this method adds the step of the step of replacing picture resource and configuration information and the APK title of replacing in Java source code and the APK title in AndroidMainfest.xml file.
Fig. 4 shows the schematic diagram of the development device of the APK according to the embodiment of the present invention, comprising:
Modified module 10, for replacing the general information recorded in AndroidMainfest.xml file in resource file in the engineering catalogue of source and amendment source engineering catalogue and Java source code;
Collector 20, for being compiled into Class bytecode under resource file and AndroidMainfest.xml file are put into the root directory of APK and by the Java source code in the engineering catalogue of source, then Class bytecode is treated to Dex bytecode, and under being put into the root directory of APK;
Packetization module 30, for obtaining APK by the packing of the Dex bytecode in root directory, AndroidMainfest.xml file and resource file.
The reusable source code of this device develops the APK of different editions.
Preferably, resource file comprises picture resource.Picture resource is more typical individual demand.
Preferably, modified module is used for the requirement according to user, arranges the server address in general information, APK title and Packagename.Amendment server address, APK title and packagename are more typical individual demands.
Preferably, this device also comprises: signature blocks, for signing to APK.This can strengthen the security of APK.
Preferably, this device also comprises: checking module, for the APK checked for integrity to signature.This can strengthen the security of APK.
As can be seen from the above description, the present invention can save time with the APK developing different editions for reusing source code, improves the efficiency compiling personalized APK.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (8)
1. a development approach of APK, is characterized in that, comprising:
The general information recorded in resource file in the engineering catalogue of replacement source and the AndroidMainfest.xml file revised in the engineering catalogue of described source and Java source code, revise the general information recorded in AndroidMainfest.xml file in the engineering catalogue of described source and Java source code to comprise: according to the requirement of user, arrange the server address in described general information, APK title and packagename;
Class bytecode is compiled under described resource file and described AndroidMainfest.xml file are put into the root directory of described APK and by the Java source code in the engineering catalogue of described source, then described Class bytecode is treated to Dex bytecode, and under being put into the root directory of described APK;
The packing of described Dex bytecode in described root directory, described AndroidMainfest.xml file and described resource file is obtained APK.
2. method according to claim 1, is characterized in that, described resource file comprises picture resource.
3. method according to claim 1, is characterized in that, also comprises:
Described APK is signed.
4. method according to claim 3, is characterized in that, also comprises:
To the APK checked for integrity of described signature.
5. a development device of APK, is characterized in that, comprising:
Modified module, for the general information recorded in the resource file replaced in the engineering catalogue of source and the AndroidMainfest.xml file revised in the engineering catalogue of described source and Java source code, described modified module is used for the requirement according to user, arranges the server address in described general information, APK title and packagename;
Collector, for being compiled into Class bytecode under described resource file and described AndroidMainfest.xml file are put into the root directory of described APK and by the Java source code in the engineering catalogue of described source, then described Class bytecode is treated to Dex bytecode, and under being put into the root directory of described APK;
Packetization module, for obtaining APK by the packing of the described Dex bytecode in described root directory, described AndroidMainfest.xml file and described resource file.
6. device according to claim 5, is characterized in that, described resource file comprises picture resource.
7. device according to claim 5, is characterized in that, also comprises:
Signature blocks, for signing to described APK.
8. device according to claim 7, is characterized in that, also comprises:
Checking module, for the APK checked for integrity to described signature.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110461665.9A CN103186380B (en) | 2011-12-31 | 2011-12-31 | The development approach of APK and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110461665.9A CN103186380B (en) | 2011-12-31 | 2011-12-31 | The development approach of APK and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103186380A CN103186380A (en) | 2013-07-03 |
CN103186380B true CN103186380B (en) | 2016-04-20 |
Family
ID=48677559
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110461665.9A Expired - Fee Related CN103186380B (en) | 2011-12-31 | 2011-12-31 | The development approach of APK and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103186380B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104111840A (en) * | 2014-08-06 | 2014-10-22 | 浪潮软件股份有限公司 | Method for generating APK installation package under non-Android environment |
CN105468351B (en) * | 2014-09-11 | 2018-11-27 | 阿里巴巴集团控股有限公司 | A kind of software integrating method and device applied for developing Android platform |
CN104318135B (en) * | 2014-10-27 | 2017-04-05 | 中国科学院信息工程研究所 | A kind of Java code Safety actuality loading method based on credible performing environment |
CN104536752A (en) * | 2014-12-26 | 2015-04-22 | 北京京东尚科信息技术有限公司 | Method and device for automatically generating APK files |
CN105446789A (en) * | 2015-11-23 | 2016-03-30 | 上海斐讯数据通信技术有限公司 | Method and apparatus for building application in android system |
CN105912342A (en) * | 2016-04-29 | 2016-08-31 | 乐视控股(北京)有限公司 | APK (Android Package) development method and system based on overlay mechanism |
CN107193544B (en) * | 2017-04-01 | 2021-01-15 | 北京五八信息技术有限公司 | Application program componentization development method and device |
CN110990019B (en) * | 2019-11-20 | 2023-05-02 | 腾讯音乐娱乐科技(深圳)有限公司 | Java class analysis method and device, storage medium and electronic equipment |
CN112083953A (en) * | 2020-08-26 | 2020-12-15 | 武汉普利商用机器有限公司 | Android application program construction method and device |
CN113076147B (en) * | 2021-03-09 | 2024-02-02 | 北京一亩田新农网络科技有限公司 | Dynamic APK resource loading method, device, system and medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102053836A (en) * | 2010-12-31 | 2011-05-11 | 广东欧珀电子工业有限公司 | Implementation method of version management tool for Android application development |
CN102236757A (en) * | 2011-06-30 | 2011-11-09 | 北京邮电大学 | Software protection method and system applicable to Android system |
-
2011
- 2011-12-31 CN CN201110461665.9A patent/CN103186380B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102053836A (en) * | 2010-12-31 | 2011-05-11 | 广东欧珀电子工业有限公司 | Implementation method of version management tool for Android application development |
CN102236757A (en) * | 2011-06-30 | 2011-11-09 | 北京邮电大学 | Software protection method and system applicable to Android system |
Non-Patent Citations (3)
Title |
---|
Android工程的编译过程;Devin Zhang;《www.cnblogs.com/dev inzhang/archive/2011/12/20/2294686.html》;20111220;全文 * |
APK文件夹结构;GaoMatrix;《blog.csdn.net/gaomatrix /article/details/7062062》;20111211;全文 * |
如何用同一份代码产生不同包名得APK包;cdlda;《blog.chinaunix.net/uid-20665441-id-376295.html》;20110617;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN103186380A (en) | 2013-07-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103186380B (en) | The development approach of APK and device | |
Bergmayr et al. | A systematic review of cloud modeling languages | |
CN109491695B (en) | Incremental updating method for integrated android application | |
WO2017185606A1 (en) | Overlay mechanism-based apk development method and system | |
Ed-Douibi et al. | EMF-REST: generation of RESTful APIs from models | |
Hopkins | Component primer | |
Boudreau et al. | Rich Client Programming: Plugging into the NetBeans (TM) Platform | |
CN103036678B (en) | A kind of method and system of Symbian signature application authorization | |
CN101040259A (en) | Run time dynamic linking | |
US20090064196A1 (en) | Model based device driver code generation | |
CN102023885A (en) | Method and system for storing bytecode of JCRE (Java card run time environment) | |
WO2018032653A1 (en) | Function implementing method and apparatus for java card application | |
CN112835584B (en) | Method for realizing component expansion and management based on REACTNATIVE | |
Sabbah | Aspects: from promise to reality | |
CN106681782B (en) | Method and device for compiling dynamic link library SO file of android installation package | |
CN114721647B (en) | Object-oriented programming method based on codeless application development | |
Chesta et al. | A toolchain for delta-oriented modeling of software product lines | |
Ďurfina et al. | Design of an automatically generated retargetable decompiler | |
CN106775608A (en) | The implementation method and device of autonomous system process | |
CN106778270B (en) | Malicious application detection method and system | |
CN109857447A (en) | A kind of automation packaging method of the Android APP application packet batch with security signature | |
CN115857999A (en) | Method and system for obtaining micro front-end system architecture based on vue system architecture transformation | |
CN105373384A (en) | Software development method and apparatus | |
Bohez et al. | Androsgi: bringing the power of OSGi to Android | |
Kim et al. | Component Adaptation Mechanism |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160420 Termination date: 20191231 |
|
CF01 | Termination of patent right due to non-payment of annual fee |