CN103838572A - System and method for packing Android SDK - Google Patents
System and method for packing Android SDK Download PDFInfo
- Publication number
- CN103838572A CN103838572A CN201310714631.5A CN201310714631A CN103838572A CN 103838572 A CN103838572 A CN 103838572A CN 201310714631 A CN201310714631 A CN 201310714631A CN 103838572 A CN103838572 A CN 103838572A
- Authority
- CN
- China
- Prior art keywords
- new
- jar
- bag
- unit
- code library
- 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.)
- Pending
Links
Images
Abstract
The invention discloses a system and method for packing an Android SDK. The system comprises a code library unit, a kit name obtaining unit, a source code changing and packing unit, a call namespace changing unit, a local code library generating unit and a mixing unit, wherein the code library unit is used for establishing the compilation run environment for data packet packing; the kit name obtaining unit is used for obtaining a new kit name input by a user and jar kit information needing to be changed; the source code changing and packing unit is used for changing keywords, related to lit names of original jar kits, in an SDK source code into new kit names, and a new jar kit is generated according to the new source code and stored; the call namespace changing unit is used for changing the JNI call namespace in an SDK local C source code file and changing the keywords related to the kit names of the original jar kits into the new kit names; the local code library generating unit is used for compiling a modified local C source code file into a new local code library to be stored, and the newly generated local code library is added into the new jar kit; the mixing unit is used for generating a new Android SDK in a mixing mode according to the new jar kit and the local code library. According to the system and method for packing the Android SDK, repeated labor of a developer is saved, and automatic executing can be achieved.
Description
Technical field
The invention belongs to computer realm, relate to a kind of packaging method and system of Android SDK kit.
Background technology
Along with the development of the virus proof tech of Android mobile phone, at present, if embed the jar bag of specific bag name in the application program of Android SDK, be easy to detected advertisement by anti-virus software, whether its principle mainly bag name based on detecting in the source code of application program installation kit has some key words and draws, now, generally need to again change the bag name of jar bag.
But, again change the bag name that jar wraps at present, need to manually unpack and pack, it is comparatively complicated comparatively speaking.
Summary of the invention
Technical matters to be solved by this invention is to provide the packaging method of the Android kit that can automatically change bag name, and the method has been saved developer's the duplication of labour, and can automatically perform, and in addition, also discloses a kind of packaging system of Android kit.
It is as follows that the present invention solves the problems of the technologies described above taked technical scheme:
A packaging system for Android kit, comprising:
Code library unit, for building the compilation run environment of packet packing;
Bag name acquiring unit, for obtaining the new jar package informatin that wraps name and need change of user's input;
Source code change and packaged unit, all change to new bag for the key word of the bag name that SDK source code related to former jar bag, and generate new jar according to new source code and wrap and store;
Call NameSpace changing unit, call NameSpace for the JNI that changes the local C source code file of SDK, the bag name keyword that relates to former jar bag is replaced by new bag name;
Native code library generation unit, for being compiled into new native code library and storing according to local C source code file after change, then adds newly-generated native code library in described new jar bag;
Obscure unit, for obscuring the new Android kit of generation according to described new jar bag and native code library.
Preferably, be also provided with: whether query unit, meet setting for inquiring about current compilation run environment; Wherein, when not meeting, notify described code library unit to rebuild the compilation run environment of packet packing.
Preferably, compilation run environment comprises: for building the Java compilation run environment for compiling jar bag;
For building the Cygwin environment for compiling native code library;
For compile local code Android NDK development environment; And for obscuring the Proguard environment of jar bag and native code library.
Preferably, further comprise:
File storage unit, the new jar APMB package generating for storing described source code change and packaged unit, and store the new local code library file that described native code library generation unit generates.
A packaging method for Android kit, comprising:
Build the compilation run environment of packet packing;
Obtain the new bag name and the jar package informatin that needs change of user's input;
The key word of the bag name that relates to former jar bag in SDK source code is all changed to new bag, and generate new jar according to new source code and wrap and store;
JNI in the local C source code file of change SDK calls NameSpace, and the bag name keyword that relates to former jar bag is replaced by new bag name;
Be compiled into new native code library and store according to local C source code file after change, then newly-generated native code library being added in described new jar bag;
Obscure the new Android kit of generation according to described new jar bag and native code library.
Preferably, be also provided with: inquire about current compilation run environment and whether meet setting; Wherein, when not meeting, rebuild the compilation run environment of packet packing.
Preferably, compilation run environment comprises: for building the Java compilation run environment for compiling jar bag;
For building the Cygwin environment for compiling native code library;
For compile local code Android NDK development environment; And for obscuring the Proguard environment of jar bag and native code library.
Preferably, the new jar APMB package of described source code change and packaged unit generation is stored in new file, described new local code library file is also deposited in described new file.
After having taked such scheme, can automatically carry out repacking of SDK kit according to the new bag name of user's input with the jar package informatin that needs change, it has saved developer's the duplication of labour, and can automatically perform, and has good effect.
Other features and advantages of the present invention will be set forth in the following description, and, partly from instructions, become apparent, or understand by implementing the present invention.Object of the present invention and other advantages can be realized and be obtained by specifically noted structure in write instructions, claims and accompanying drawing.
Brief description of the drawings
Below in conjunction with accompanying drawing, the present invention is described in detail, to make above-mentioned advantage of the present invention clearer and more definite.Wherein,
Fig. 1 is the schematic flow sheet of the packaging method of Android kit of the present invention;
Fig. 2 is the structural representation of the packaging method of Android kit of the present invention.
Embodiment
Describe embodiments of the present invention in detail below with reference to drawings and Examples, to the present invention, how application technology means solve technical matters whereby, and the implementation procedure of reaching technique effect can fully understand and implement according to this.It should be noted that, only otherwise form conflict, each feature in each embodiment and each embodiment in the present invention can mutually combine, and the technical scheme forming is all within protection scope of the present invention.
In addition, can in the computer system such as one group of computer executable instructions, carry out in the step shown in the process flow diagram of accompanying drawing, and, although there is shown logical order in flow process, but in some cases, can carry out shown or described step with the order being different from herein.
As shown in Figure 1, the packaging method of described Android kit, mainly comprises:
Step 101: the compilation run environment that builds packet packing; Wherein, in preferred embodiment, compilation run environment comprises: for building the Java compilation run environment for compiling jar bag; For building the Cygwin environment for compiling native code library; For compile local code Android NDK development environment; And for obscuring the Proguard environment of jar bag and native code library.
Step 102: the new bag name and the jar package informatin that needs change of obtaining user's input; For example, user inputs the bag name com.ado.pn that will change, and change after bag name, such as com.tecent.pn,
Step 103: inquire about current compilation run environment and whether meet setting; Wherein, when not meeting, rebuild the compilation run environment of packet packing.
Step 104: the key word of the bag name that relates to former jar bag in SDK source code is all changed to new bag, and generate new jar according to new source code and wrap and store;
For example, the source code of the bag of more correcting one's mistakes is broken into new jar wrap and store by calling the compiling of java and packing order, and these new jar APMB packages are multiple, and be stored in a new file;
Step 104: the JNI in the local C source code file of change SDK calls NameSpace, is replaced by new bag name by the bag name keyword that relates to former jar bag;
Step 105: be compiled into new native code library and store according to local C source code file after change, then newly-generated native code library being added in described new jar bag;
Step 106: obscure the new Android kit of generation according to described new jar bag and native code library.
For example, according to default obscure strategy file call Proguard packing command function before newly-generated jar bag and native code library obscure the final new kit of generation
And according to description above, the new jar APMB package of described source code change and packaged unit generation is stored in new file, described new local code library file is also deposited in described new file.
After having taked such scheme, can automatically carry out repacking of SDK kit according to the new bag name of user's input with the jar package informatin that needs change, it has saved developer's the duplication of labour, and can automatically perform, and has good effect.
As shown in Figure 2, be the structural representation of the packaging method of Android kit of the present invention, as shown in Figure 2, described system, mainly comprises:
Code library unit, for building the compilation run environment of packet packing;
Bag name acquiring unit, for obtaining the new jar package informatin that wraps name and need change of user's input;
Source code change and packaged unit, all change to new bag for the key word of the bag name that SDK source code related to former jar bag, and generate new jar according to new source code and wrap and store;
Call NameSpace changing unit, call NameSpace for the JNI that changes the local C source code file of SDK, the bag name keyword that relates to former jar bag is replaced by new bag name;
Native code library generation unit, for being compiled into new native code library and storing according to local C source code file after change, then adds newly-generated native code library in described new jar bag;
Obscure unit, for obscuring the new Android kit of generation according to described new jar bag and native code library.
Preferably, be also provided with: whether query unit, meet setting for inquiring about current compilation run environment; Wherein, when not meeting, notify described code library unit to rebuild the compilation run environment of packet packing.
Preferably, compilation run environment comprises: for building the Java compilation run environment for compiling jar bag;
For building the Cygwin environment for compiling native code library;
For compile local code Android NDK development environment; And for obscuring the Proguard environment of jar bag and native code library.
Preferably, further comprise:
File storage unit, the new jar APMB package generating for storing described source code change and packaged unit, and store the new local code library file that described native code library generation unit generates.
System of the present invention has the technique effect that method is identical, be that it can automatically carry out repacking of SDK kit according to the new bag name of user's input with the jar package informatin that needs change, it has saved developer's the duplication of labour, and can automatically perform, and has good effect.
It should be noted that, for said method embodiment, for simple description, therefore it is all expressed as to a series of combination of actions, but those skilled in the art should know, the application is not subject to the restriction of described sequence of movement, because according to the application, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and related action and module might not be that the application is necessary.
Those skilled in the art should understand, the application's embodiment can be provided as method, system or computer program.Therefore, the application can adopt complete hardware implementation example, completely implement software example or the form in conjunction with the embodiment of software and hardware aspect.
And the application can adopt the form at one or more upper computer programs of implementing of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) that wherein include computer usable program code.
Finally it should be noted that: the foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, although the present invention is had been described in detail with reference to previous embodiment, for a person skilled in the art, its technical scheme that still can record aforementioned each embodiment is modified, or part technical characterictic is wherein equal to replacement.Within the spirit and principles in the present invention all, any amendment of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.
Claims (8)
1. a packaging system for Android kit, is characterized in that, comprising:
Code library unit, for building the compilation run environment of packet packing;
Bag name acquiring unit, for obtaining the new jar package informatin that wraps name and need change of user's input;
Source code change and packaged unit, all change to new bag for the key word of the bag name that SDK source code related to former jar bag, and generate new jar according to new source code and wrap and store;
Call NameSpace changing unit, call NameSpace for the JNI that changes the local C source code file of SDK, the bag name keyword that relates to former jar bag is replaced by new bag name;
Native code library generation unit, for being compiled into new native code library and storing according to local C source code file after change, then adds newly-generated native code library in described new jar bag;
Obscure unit, for obscuring the new Android kit of generation according to described new jar bag and native code library.
2. the packaging system of Android kit according to claim 1, is characterized in that, is also provided with: whether query unit, meet setting for inquiring about current compilation run environment; Wherein, when not meeting, notify described code library unit to rebuild the compilation run environment of packet packing.
3. the packaging system of Android kit according to claim 1 and 2, is characterized in that, compilation run environment comprises: for building the Java compilation run environment for compiling jar bag;
For building the Cygwin environment for compiling native code library;
For compile local code Android NDK development environment; And for obscuring the Proguard environment of jar bag and native code library.
4. the packaging system of Android kit according to claim 3, is characterized in that, further comprises:
File storage unit, the new jar APMB package generating for storing described source code change and packaged unit, and store the new local code library file that described native code library generation unit generates.
5. a packaging method for Android kit, is characterized in that, comprising:
Build the compilation run environment of packet packing;
Obtain the new bag name and the jar package informatin that needs change of user's input;
The key word of the bag name that relates to former jar bag in SDK source code is all changed to new bag, and generate new jar according to new source code and wrap and store;
JNI in the local C source code file of change SDK calls NameSpace, and the bag name keyword that relates to former jar bag is replaced by new bag name;
Be compiled into new native code library and store according to local C source code file after change, then newly-generated native code library being added in described new jar bag;
Obscure the new Android kit of generation according to described new jar bag and native code library.
6. the packaging method of Android kit according to claim 5, is characterized in that, is also provided with: inquire about current compilation run environment and whether meet setting; Wherein, when not meeting, rebuild the compilation run environment of packet packing.
7. according to the packaging method of the Android kit described in claim 5 or 6, it is characterized in that, compilation run environment comprises: for building the Java compilation run environment for compiling jar bag;
For building the Cygwin environment for compiling native code library;
For compile local code Android NDK development environment; And for obscuring the Proguard environment of jar bag and native code library.
8. the packaging system of Android kit according to claim 7, it is characterized in that, the new jar APMB package of described source code change and packaged unit generation is stored in new file, and described new local code library file is also deposited in described new file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310714631.5A CN103838572A (en) | 2013-12-20 | 2013-12-20 | System and method for packing Android SDK |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310714631.5A CN103838572A (en) | 2013-12-20 | 2013-12-20 | System and method for packing Android SDK |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103838572A true CN103838572A (en) | 2014-06-04 |
Family
ID=50802108
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310714631.5A Pending CN103838572A (en) | 2013-12-20 | 2013-12-20 | System and method for packing Android SDK |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103838572A (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104317573A (en) * | 2014-10-03 | 2015-01-28 | 李宏伟 | Android installation package transformation method and device as well as method and device for operating application |
CN104572237A (en) * | 2015-01-19 | 2015-04-29 | 上海动联信息技术股份有限公司 | Automatic quick generation system and method for UKey installation package |
CN104881294A (en) * | 2015-06-10 | 2015-09-02 | 北京奇虎科技有限公司 | System and method for realizing automatic packing |
CN105671389A (en) * | 2016-01-29 | 2016-06-15 | 张颖 | Surface copper electroplating liquid of magnesium alloy intelligent mobile phone shell |
CN105678120A (en) * | 2014-11-20 | 2016-06-15 | 中国移动通信集团公司 | Safety protection method of application programs and server |
CN106919431A (en) * | 2015-12-25 | 2017-07-04 | 航天信息股份有限公司 | Code comparison method, equipment and system in continuous integrating |
CN107291436A (en) * | 2016-04-13 | 2017-10-24 | 上海思立微电子科技有限公司 | SDK contracts for fixed output quotas generation method, device and terminal |
CN108037927A (en) * | 2017-12-29 | 2018-05-15 | 有米科技股份有限公司 | Kit packaging method, system, readable storage medium storing program for executing and computer equipment |
CN108304158A (en) * | 2016-08-24 | 2018-07-20 | 北京花甲科技有限公司 | A kind of Proxy Method and equipment of dynamic base |
CN108647033A (en) * | 2018-04-03 | 2018-10-12 | 四川新网银行股份有限公司 | A kind of SDK automatic packaging methods of open platform |
CN109918075A (en) * | 2017-12-12 | 2019-06-21 | 北京奇虎科技有限公司 | Utilize the SDK packaging method, packing plug-in unit and corresponding terminal for being packaged plug-in unit |
WO2020000810A1 (en) * | 2018-06-29 | 2020-01-02 | 平安科技(深圳)有限公司 | Application component construction packaging method and device, and computer storage medium |
-
2013
- 2013-12-20 CN CN201310714631.5A patent/CN103838572A/en active Pending
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104317573A (en) * | 2014-10-03 | 2015-01-28 | 李宏伟 | Android installation package transformation method and device as well as method and device for operating application |
CN104317573B (en) * | 2014-10-03 | 2017-06-16 | 李宏伟 | Android installation kit conversion method and device and the method and apparatus of operation application |
CN105678120A (en) * | 2014-11-20 | 2016-06-15 | 中国移动通信集团公司 | Safety protection method of application programs and server |
CN104572237B (en) * | 2015-01-19 | 2017-12-12 | 上海动联信息技术股份有限公司 | A kind of automatic quick-speed generation system of UKey installation kits and its method |
CN104572237A (en) * | 2015-01-19 | 2015-04-29 | 上海动联信息技术股份有限公司 | Automatic quick generation system and method for UKey installation package |
CN104881294B (en) * | 2015-06-10 | 2019-03-01 | 北京奇虎科技有限公司 | Realize the system and method for automatic packaging |
CN104881294A (en) * | 2015-06-10 | 2015-09-02 | 北京奇虎科技有限公司 | System and method for realizing automatic packing |
CN106919431A (en) * | 2015-12-25 | 2017-07-04 | 航天信息股份有限公司 | Code comparison method, equipment and system in continuous integrating |
CN105671389A (en) * | 2016-01-29 | 2016-06-15 | 张颖 | Surface copper electroplating liquid of magnesium alloy intelligent mobile phone shell |
CN107291436A (en) * | 2016-04-13 | 2017-10-24 | 上海思立微电子科技有限公司 | SDK contracts for fixed output quotas generation method, device and terminal |
CN107291436B (en) * | 2016-04-13 | 2020-11-27 | 上海思立微电子科技有限公司 | SDK packet generation method, device and terminal |
CN108304158A (en) * | 2016-08-24 | 2018-07-20 | 北京花甲科技有限公司 | A kind of Proxy Method and equipment of dynamic base |
CN108304158B (en) * | 2016-08-24 | 2021-12-10 | 北京顶象技术有限公司 | Dynamic library proxy method and device |
CN109918075A (en) * | 2017-12-12 | 2019-06-21 | 北京奇虎科技有限公司 | Utilize the SDK packaging method, packing plug-in unit and corresponding terminal for being packaged plug-in unit |
CN108037927B (en) * | 2017-12-29 | 2020-10-30 | 有米科技股份有限公司 | Development kit packaging method, system, readable storage medium and computer equipment |
CN108037927A (en) * | 2017-12-29 | 2018-05-15 | 有米科技股份有限公司 | Kit packaging method, system, readable storage medium storing program for executing and computer equipment |
CN108647033A (en) * | 2018-04-03 | 2018-10-12 | 四川新网银行股份有限公司 | A kind of SDK automatic packaging methods of open platform |
WO2020000810A1 (en) * | 2018-06-29 | 2020-01-02 | 平安科技(深圳)有限公司 | Application component construction packaging method and device, and computer storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103838572A (en) | System and method for packing Android SDK | |
CN108920133B (en) | Cross-language programming method and device, electronic equipment and storage medium | |
US10795660B1 (en) | Live code updates | |
US10324909B2 (en) | Omega names: name generation and derivation utilizing nested three or more attributes | |
US8997070B2 (en) | Extension mechanism for scripting language compiler | |
KR101318313B1 (en) | Method for dynamically linking program on embedded platform and a computer readable storage medium recording an embedded platform | |
CN111770113A (en) | Method for executing intelligent contract, block chain node and node equipment | |
CN109491695A (en) | A kind of increment updating method of integrated Android application | |
CN105677302A (en) | Application program modularization developing method and device | |
CN106933610B (en) | Application program installation package generation method and device and electronic equipment | |
CN111179086B (en) | Intelligent contract virtual machine based on WebAsssemly | |
CN103399734A (en) | Method for generating REST service and achieving REST and corresponding equipment | |
US9483508B1 (en) | Omega names: name generation and derivation | |
KR20140067018A (en) | Describing native application programming interfaces of an operating system with metadata | |
CN112835975B (en) | Method for deploying, updating and calling intelligent contracts in blockchain | |
US10635472B2 (en) | Import mechanism for hardware intrinsics | |
CN114168111B (en) | Method, device, product and storage medium for realizing componentized route | |
CN109933381A (en) | A kind of loading method and device of kernel | |
CN105094878A (en) | System library file integration method and apparatus | |
CN105068851A (en) | Secure packaging method and system for mobile terminal ROM packets and mobile terminal | |
CN103677778A (en) | Method for analyzing Classref constant of CAP file | |
CN103473034A (en) | Method and device for dynamically publishing Web service | |
CN102999371B (en) | Interface Development method and system based on Lua script | |
CN105005497A (en) | Method and apparatus for calling local function in Java card virtual machine | |
KR102141749B1 (en) | APP program execution method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20140604 |
|
WD01 | Invention patent application deemed withdrawn after publication |