CN105068853A - Channel package output method and apparatus - Google Patents

Channel package output method and apparatus Download PDF

Info

Publication number
CN105068853A
CN105068853A CN201510419351.0A CN201510419351A CN105068853A CN 105068853 A CN105068853 A CN 105068853A CN 201510419351 A CN201510419351 A CN 201510419351A CN 105068853 A CN105068853 A CN 105068853A
Authority
CN
China
Prior art keywords
channel
version
bag
channel bag
signature
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
Application number
CN201510419351.0A
Other languages
Chinese (zh)
Inventor
段凌云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guiyang Yuwan Science & Technology Co Ltd
Original Assignee
Guiyang Yuwan Science & Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guiyang Yuwan Science & Technology Co Ltd filed Critical Guiyang Yuwan Science & Technology Co Ltd
Priority to CN201510419351.0A priority Critical patent/CN105068853A/en
Publication of CN105068853A publication Critical patent/CN105068853A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The invention discloses a channel package output method and apparatus. The method comprises: classifying channel packages and setting the channel packages to have multiple types of versions; executing a compiling instruction and outputting an original program package corresponding to each version; writing a first script file in which channel numbers are written, wherein the original program package required to be used is assigned for each channel package in the first script file; and executing the first script file, wherein for each channel package, the original program package required to be used and assigned by the channel package is copied and the channel number is written in the copied original program package. According to the technical scheme provided by the invention, the channel packages are classified, the multiple necessary original packages are compiled and copied in batches through the script file, and the channel numbers are written in the original packages, so that the channel packages can be flexibly customized and efficiently output.

Description

The output intent of channel bag and device
Technical field
The present invention relates to the communications field, in particular to a kind of output intent and device of channel bag.
Background technology
At present, the scheme of Android application software output channel bag when issuing is above-mentioned as follows:
Using AndroidGradle plug-in unit to build Android application program, going out bag configuration script code by all kinds of means by writing in build.gradle script file, and perform this script file and compile different channel bag respectively to call Android compiler.
First in AndroidManifest.xml file, define the MetaTag (metadata) of a channel, and its value used an occupy-place variable to carry out occupy-place; Secondly define each channel name or channel number respectively under the productFlavors in build.gradle file, in addition, can also customize for this channel in the configuration block of different functions according to the channel name of definition or channel number; Finally telling that the placeholder of channel is replaced with the undefined channel name of productFlavors or channel number when compiling by compiler automatically, carrying out program compilation according to the custom configuration of this channel simultaneously.Circulation like this, finally can export several channel bags.
When program performs, the API provided by operating system reads the MetaTag in AndroidManifest.xml file, just can get the channel number of this bag.
But although such scheme is very flexible, can carry out customizing, configuring according to different channels, it is very slow that maximum shortcoming is exactly all channel bags of output.Because often export a channel bag, once, the size of compilation time and project is inversely proportional to need complete compiling again, and the larger compiling of project is slower (complete recompility language project of playing needs 6-7 minute) then.And the content of most of channel bag is all the same, be only that channel number is had any different.
Summary of the invention
Fundamental purpose of the present invention is the output intent and the device that disclose a kind of channel bag, exports the very slow problem of channel bag at least to solve in correlation technique.
According to an aspect of the present invention, a kind of output intent of channel bag is provided.
Output intent according to channel bag of the present invention comprises: classify to channel bag, is set to the version of plurality of classes; Perform compiler directive, export the program original packet corresponding with various above-mentioned version; Write the first script file for writing channel number, wherein, be that the program original packet needing to use specified by each channel bag in above-mentioned first script file; Perform above-mentioned first script file, wherein, for each channel bag, this channel bag is specified and needs the program original packet used to copy, and write channel number in program original packet after replication.
According to a further aspect in the invention, a kind of output unit of channel bag is provided.
Output unit according to channel bag of the present invention comprises: classification setting module, for classifying to channel bag, is set to the version of plurality of classes; First execution module, for performing compiler directive, exports the program original packet corresponding with various above-mentioned version; First writes module, for writing the first script file for writing channel number, wherein, is that the program original packet needing to use specified by each channel bag in above-mentioned first script file; Second execution module, for performing above-mentioned first script file, wherein, for each channel bag, specifying this channel bag and needing the program original packet used to copy, and writing channel number in program original packet after replication.
By the present invention, will classify to channel bag, by the compiling of necessary several original packet (unsigning) out, write channel number by script file batch duplicating subsequently, can flexible customization, efficiently export channel bag.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the output intent of channel bag according to the embodiment of the present invention;
Fig. 2 is the process flow diagram of the output intent of channel bag according to the preferred embodiment of the invention;
Fig. 3 is the structured flowchart of the output unit of channel bag according to the embodiment of the present invention; And
Fig. 4 is the structured flowchart of the output unit of channel bag according to the preferred embodiment of the invention.
Embodiment
Below in conjunction with Figure of description, specific implementation of the present invention is made a detailed description.
Fig. 1 is the process flow diagram of the output intent of channel bag according to the embodiment of the present invention.As shown in Figure 1, the output intent of this channel bag comprises:
Step S101: classify to channel bag, is set to the version of plurality of classes;
Step S103: perform compiler directive, export the program original packet corresponding with various above-mentioned version;
Step S105: write the first script file for writing channel number wherein, is that the program original packet needing to use specified by each channel bag in above-mentioned first script file;
Step S107: perform above-mentioned first script file, wherein, for each channel bag, specifies this channel bag and needs the program original packet used to copy, and write channel number in program original packet after replication.
By the output intent of the channel bag shown in Fig. 1, by the compiling of necessary several original packet (unsigning) out.Write channel number by script file batch duplicating subsequently, thus without the need to often exporting a channel bag, complete compiling once all again, the project that greatly saves goes out the bag time, improves efficiency.
Preferably, in step S101, channel bag is classified, the version being set to plurality of classes may further include following process: the version name defining the plurality of classes of all channel bags in the productFlavors in build.gradle script file, wherein, the version name of above-mentioned plurality of classes comprises: full version, scaled-down version, China Mobile's channel version, CHINAUNICOM's channel version.
In preferred implementation process, can build based on AndroidGradle plug-in unit, the version name of several kinds that there will be is defined in all channels in productFlavors in build.gradle script file, such as: Full (full version), Lite (scaled-down version), CMCC (China Mobile's channel version, shield UNICOM to pay), CUCC (CHINAUNICOM's channel version, shields mobile payment) etc.
Preferably, after execution step S101, can also comprise: for often kind of above-mentioned version, in each functional configuration unit, be configured the customization to above-mentioned version respectively.
Preferably, after execution step S107, following process can also being comprised: write the crus secunda presents for signing, wherein, in above-mentioned crus secunda presents, specifying the channel bag needing signature and the channel bag without the need to signature.Perform above-mentioned crus secunda presents, the channel bag of being signed by above-mentioned needs is signed.
The essence of signature is exactly to prevent bag by third party's malicious modification, because revise bag after packet signature, if add a file in bag, can destroy the signature of bag, cause installing unsuccessfully.Due in the embodiment of the present invention, signature performs after above-mentioned S101 to S107, so there is not the problem destroying bag, channel file also can be signed in signature process subsequently, becomes a legal file.
Preferably, at the above-mentioned crus secunda presents of execution, after the channel bag of being signed by above-mentioned needs is signed, following process can also be comprised: install and channel bag after performing above-mentioned signature, the channel file acquisition channel number under assets catalogue is read by system application interface (ApplicationProgrammingInterface, referred to as API).
Preferably, at the above-mentioned crus secunda presents of execution, the channel bag of being signed by above-mentioned needs can also comprise following process after signing: install and channel bag after performing above-mentioned signature, read the channel file acquisition channel number under assets catalogue by system API.
In preferred implementation process, the script file (i.e. above-mentioned crus secunda presents) for signing can be write, in script, specify which channel bag to need signature, which channel bag does not need signature (need be detected and allograph, as China Mobile by third party).Perform the script file for signing, the channel bag being designated signature will be signed, and the file not being designated signature will not process.Installing and perform the channel bag by oneself signature or third party's allograph, by reading the channel file under assets catalogue, just can obtain channel number.Because channel number writes unsigned time, so the problem destroying signature can not be there is.
Above-mentioned preferred implementation is further described below in conjunction with Fig. 2.
Fig. 2 is the process flow diagram of the output intent of channel bag according to the preferred embodiment of the invention.As shown in Figure 2, the output intent of this channel bag comprises:
Step S201: project builds based on AndroidGradle plug-in unit, the version name of several kinds that there will be is defined in all channels in productFlavors in build.gradle script file, as: Full (full version), Lite (scaled-down version), CMCC (China Mobile's channel version, shield UNICOM to pay), CUCC (CHINAUNICOM's channel version, shields mobile payment) etc.
Step S203: for the version of several kinds defined in step S201, writes corresponding configuration respectively to complete the customization to this several version in the configuration block of other function.
Step S205: perform compiler directive, the program original packet (unsigned regular edition, so bag can be revised arbitrarily, without META-INF catalogue) that several versions defined in output step S203 are corresponding.
Step S207: write the script file (as Python script) for writing channel number, for the original packet write channel number needing to use which kind of type specified by each channel bag in script.
Step S209: perform the script file for writing channel number, its appointed original packet copies by each channel bag, and channel file is write in assets catalogue in bag, and channel number is write in file.
Which channel bag step S211: write the script file for signing, specify need signature in script, and which channel bag does not need signature (need be detected and allograph, as China Mobile by third party).
Step S213: perform the script file for signing, the channel bag being designated signature will be signed, and the file not being designated signature will not process.
Step S215: installing and perform the channel bag by oneself signature or third party's allograph, by reading the channel file under assets catalogue, just can obtain channel number.Because channel number writes unsigned time, so the problem destroying signature can not be there is.
Fig. 3 is the structured flowchart of the output unit of channel bag according to the embodiment of the present invention.As shown in Figure 3, the output unit of this channel bag comprises: classification setting module 30, for classifying to channel bag, is set to the version of plurality of classes; First execution module 32, for performing compiler directive, exports the program original packet corresponding with various above-mentioned version; First writes module 34, for writing the first script file for writing channel number, wherein, is that the program original packet needing to use specified by each channel bag in above-mentioned first script file; Second execution module 36, for performing above-mentioned first script file, wherein, for each channel bag, specifying this channel bag and needing the program original packet used to copy, and writing channel number in program original packet after replication.
Adopt the output unit of the channel bag shown in Fig. 3, by the compiling of necessary several original packet (unsigning) out.Write channel number by script file batch duplicating subsequently, thus without the need to often exporting a channel bag, complete compiling once all again, the project that greatly saves goes out the bag time, improves efficiency.
Preferably, classification setting module 30, be further used for the version name of the plurality of classes defining all channel bags in the productFlavors in build.gradle script file, wherein, the version name of above-mentioned plurality of classes comprises: full version, scaled-down version, China Mobile's channel version, CHINAUNICOM's channel version.
Preferably, as shown in Figure 4, said apparatus can also comprise: configuration module 38, is connected with above-mentioned classification setting module, for for often kind of above-mentioned version, has been configured the customization to above-mentioned version respectively in each functional configuration unit.
Preferably, as shown in Figure 4, said apparatus can also comprise: second writes module 40, be connected with described second execution module 36, for writing the crus secunda presents for signing, wherein, in above-mentioned crus secunda presents, specify the channel bag needing signature and the channel bag without the need to signature.3rd execution module 42, for performing above-mentioned crus secunda presents, the channel bag of being signed by above-mentioned needs is signed.
Preferably, as shown in Figure 4, said apparatus can also comprise: acquisition module 44, for installing and performing the channel bag after above-mentioned signature, reads the channel file acquisition channel number under assets catalogue by system API.
In sum, by above-described embodiment provided by the invention, first several channel bags are classified, utilize the advantage that AndroidGradle flexible customization compiles, by the compiling of necessary several original packet (unsigning) out.Write channel number by script file batch duplicating subsequently, before this process occurs in signature, so there is not the problem destroying bag, channel file also can be signed in signature process subsequently, becomes a legal file.The requirement that last basis is concrete, to unsign but write file oneself signature of channel number or given third party's signature (as China Mobile, because channel number writes in advance, so do not need the file after to signature to modify, therefore the use of cell phone payment function can not be affected).Program, when performing, reads the channel file acquisition channel number under assets catalogue by system API, because channel filename is unified, channel number is file content, so there is not the process of traversal All Files, efficiency is greatly improved.
Be only several specific embodiment of the present invention above, but the present invention is not limited thereto, the changes that any person skilled in the art can think of all should fall into protection scope of the present invention.

Claims (10)

1. an output intent for channel bag, is characterized in that, comprising:
Channel bag is classified, is set to the version of plurality of classes;
Perform compiler directive, export the program original packet corresponding with various described version;
Write the first script file for writing channel number, wherein, be that the program original packet needing to use specified by each channel bag in described first script file;
Perform described first script file, wherein, for each channel bag, this channel bag is specified and needs the program original packet used to copy, and write channel number in program original packet after replication.
2. method according to claim 1, is characterized in that, classifies to channel bag, and the version being set to plurality of classes comprises:
The version name of the plurality of classes of all channel bags is defined in product performance productFlavors in build.gradle script file, wherein, the version name of described plurality of classes comprises: full version, scaled-down version, China Mobile's channel version, CHINAUNICOM's channel version.
3. method according to claim 1, it is characterized in that, channel bag is being classified, after being set to the version of plurality of classes, also comprise: for version often kind described, in each functional configuration unit, be configured the customization to described version respectively.
4. method according to claim 1, is characterized in that, after writing channel number, also comprises in program original packet after replication:
Writing the crus secunda presents for signing, wherein, in described crus secunda presents, specifying the channel bag needing signature and the channel bag without the need to signature.
Perform described crus secunda presents, the described channel bag of signature that needs is signed.
5. method according to claim 4, is characterized in that, at the described crus secunda presents of execution, after being signed by the channel bag of described needs signature, also comprises:
Install and channel bag after performing described signature, read the channel file acquisition channel number under assets catalogue by system application interface API.
6. an output unit for channel bag, is characterized in that, comprising:
Classification setting module, for classifying to channel bag, is set to the version of plurality of classes;
First execution module, for performing compiler directive, exports the program original packet corresponding with various described version;
First writes module, for writing the first script file for writing channel number, wherein, is that the program original packet needing to use specified by each channel bag in described first script file;
Second execution module, for performing described first script file, wherein, for each channel bag, specifying this channel bag and needing the program original packet used to copy, and writing channel number in program original packet after replication.
7. device according to claim 6, is characterized in that,
Described classification setting module, be further used for the version name of the plurality of classes defining all channel bags in the productFlavors in build.gradle script file, wherein, the version name of described plurality of classes comprises: full version, scaled-down version, China Mobile's channel version, CHINAUNICOM's channel version.
8. device according to claim 6, is characterized in that, also comprises:
Configuration module, for for version often kind described, has been configured the customization to described version respectively in each functional configuration unit.
9. device according to claim 6, is characterized in that, also comprises:
Second writes module, for writing the crus secunda presents for signing, wherein, specifies the channel bag needing signature and the channel bag without the need to signature in described crus secunda presents.
3rd execution module, for performing described crus secunda presents, signs the described channel bag of signature that needs.
10. device according to claim 9, is characterized in that, also comprises:
Acquisition module, for installing and performing the channel bag after described signature, reads the channel file acquisition channel number under assets catalogue by system API.
CN201510419351.0A 2015-07-16 2015-07-16 Channel package output method and apparatus Pending CN105068853A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510419351.0A CN105068853A (en) 2015-07-16 2015-07-16 Channel package output method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510419351.0A CN105068853A (en) 2015-07-16 2015-07-16 Channel package output method and apparatus

Publications (1)

Publication Number Publication Date
CN105068853A true CN105068853A (en) 2015-11-18

Family

ID=54498231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510419351.0A Pending CN105068853A (en) 2015-07-16 2015-07-16 Channel package output method and apparatus

Country Status (1)

Country Link
CN (1) CN105068853A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843909A (en) * 2017-03-07 2017-06-13 东软集团股份有限公司 Support the channel packaging method and device of channel customization
CN106843939A (en) * 2016-12-30 2017-06-13 百度在线网络技术(北京)有限公司 The generation method and device of the channel bag of application
CN106897049A (en) * 2015-12-21 2017-06-27 五八同城信息技术有限公司 The packaging method and device of a kind of installation kit
CN107943494A (en) * 2017-08-04 2018-04-20 上海壹账通金融科技有限公司 Distribution method and mobile terminal are applied by all kinds of means
CN109492349A (en) * 2018-10-30 2019-03-19 连尚(新昌)网络科技有限公司 A kind of method and apparatus with management document distribution channel for identification
CN109857455A (en) * 2018-12-29 2019-06-07 深圳Tcl新技术有限公司 Installation kit packaging method, system, equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104754062A (en) * 2015-04-16 2015-07-01 腾讯科技(北京)有限公司 Internet based information popularization method, server and user terminal

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104754062A (en) * 2015-04-16 2015-07-01 腾讯科技(北京)有限公司 Internet based information popularization method, server and user terminal

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897049A (en) * 2015-12-21 2017-06-27 五八同城信息技术有限公司 The packaging method and device of a kind of installation kit
CN106843939A (en) * 2016-12-30 2017-06-13 百度在线网络技术(北京)有限公司 The generation method and device of the channel bag of application
CN106843909A (en) * 2017-03-07 2017-06-13 东软集团股份有限公司 Support the channel packaging method and device of channel customization
CN107943494A (en) * 2017-08-04 2018-04-20 上海壹账通金融科技有限公司 Distribution method and mobile terminal are applied by all kinds of means
CN109492349A (en) * 2018-10-30 2019-03-19 连尚(新昌)网络科技有限公司 A kind of method and apparatus with management document distribution channel for identification
CN109857455A (en) * 2018-12-29 2019-06-07 深圳Tcl新技术有限公司 Installation kit packaging method, system, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN105068853A (en) Channel package output method and apparatus
US20160357519A1 (en) Natural Language Engine for Coding and Debugging
CN111078290B (en) Compiler and compiling method for extensible instruction set
CN110262783B (en) Interface generation method and device and terminal equipment
US8209341B2 (en) Configurable transformation macro
WO2016196854A1 (en) Cross-library framework architecture feature sets
CN103902859A (en) Code protecting method and system based on hook technology in JAVA
CN102591777A (en) Unit test code generation method and device
CN111176717B (en) Method and device for generating installation package and electronic equipment
CN104298534B (en) Programmed method and device based on Lua language
CN104123481A (en) Method and device for preventing application program from being tampered
CN111090433A (en) Data processing method, device and storage medium
WO2018032653A1 (en) Function implementing method and apparatus for java card application
CN104050085A (en) Forced code standard inspection method and system
CN110109671B (en) Webpack label size and style conversion method and device
CN112835975B (en) Method for deploying, updating and calling intelligent contracts in blockchain
CN111367510A (en) Android function module development method and device
CN103744684A (en) Heterogeneous hardware and software collaborative developing method and system
CN111209001A (en) Method, system, equipment and medium for batch generation of APKs of android channels
CN104503778A (en) Installation method and installation device for applications
CN111966357A (en) Operating system application compiling method and device and electronic equipment
CN104133676A (en) Function execution method and function execution device based on scripts
CN109918075A (en) Utilize the SDK packaging method, packing plug-in unit and corresponding terminal for being packaged plug-in unit
CN109857468A (en) A kind of method and system for supporting more DTB in single linux system mirror image
CN112256670A (en) Data migration method, terminal device and readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20151118

RJ01 Rejection of invention patent application after publication