The rapid batch of a kind of Android program installation kit generates method and systemTechnical field
The invention belongs to mobile Internet field, the rapid batch more particularly, to a kind of Android program installation kit is rawBecome method and system.
Background technology
After developing a Mobile solution software, typically except be placed on company official website/personal homepage be supplied to user downloadOutside using, an also critically important way of promotion, it is simply that application the app store in shop, such as Apple, GoogleAndroid market.The application software wanting oneself can be understood by more user, use, and being published to apply shop is mustIndispensable channels.
Mobile Internet industry development is swift and violent at present, and various mobile phones, panel computer, intelligent television software emerge in an endless stream, and makeesFor the main download channel application shop of mobile software be also various, the most domestic application shop up to hundreds of.InstituteThe reasonable application done with general popularization, each edition upgrading, all can at least synchronize to be published in tens application shops.ForConvenience adds up each application download in shop, user's liveness, use habit etc. in the future, it is necessary to for for each shouldThe program installation kit packing out different with the application in shop.Thus when statistical data, it is corresponding logical for distinguishing which userCross the software which application shop is downloaded.
So often issuing a program version, it is necessary to produce tens program installation kits, by such as in prior artUnder type generates program installation kit: (1) generates installation kit by android studio programming tool, but in said methodCan only produce 1 installation kit for every 1 time, often producing 1 installation kit probably needs 5 minutes, if producing 50 installation kits, then needs bigThe repetitive operation of amount, efficiency is the lowest, and is manual operation every time, and error rate is higher;(2) by writing Gradle packingScript realizes Mass production installation kit, often produces 1 installation kit in the above-mentioned methods due to Gradle, is required for rebuilding1 projects, building 1 projects probably needs 5 minutes, builds projects relevant with computing power, although subtractLack manual operation, but efficiency has the most still had much room for improvement.In a word, in the above-mentioned methods, packing is required for again completing to compile every timeTranslate build, and the existence of this process makes batch consuming time of packing long, seriously reduces for application shop programThe batch packing efficiency of installation kit.
Summary of the invention
For disadvantages described above or the Improvement requirement of prior art, the invention provides the quick of a kind of Android program installation kitMass production method system, its object is to improve the Mass production efficiency of big program installation kit.
For achieving the above object, according to one aspect of the present invention, it is provided that quickly criticizing of a kind of Android program installation kitAmount generation method, it is characterised in that this generation method comprises the steps:
Packaging file prepares: generates Android program installation kit of unsigning, arranges a literary composition with multiple support channels symbolic identifierPart;
Android of unsigning described in decompression program installation kit;
The described channel symbolic identifier being successively read in the file of described channel symbolic identifier, to not signing after described decompressionThe channel number of the configuration file in name Android program installation kit is modified and is become described channel symbolic identifier, again beats after amendmentBag is achieved in the Mass production of Android program installation kit.
Further, the configuration file in corresponding installation procedure is AndroidManifest.
Further, the identifier of the file of described channel symbolic identifier is used for identifying described Android program installation kit correspondenceApplication shop.
Further, described channel symbolic identifier line feed editor.
Further, described packaging file preparation process also includes the key literary composition generating described Android program installation kitPart.
Further, also include after repacking the step of the Android program installation kit after revising described channel number described inAndroid program installation kit to each packing fills in path and the password of described key file.
Further, described decompression, revise and repack step and automatically perform by writing script file.
Additionally aspect, the rapid batch that the invention allows for a kind of Android program installation kit generates system, and its feature existsIn, this system specifically includes that
Unsigned Android program installation kit generation module, script run module and memory module;
Described script runs module and includes signature procedure installation kit generation module and interface instructions unit;Batch packing is depositedStorage module includes the first memory element and the second memory element;
Described interface instructions unit receives directive script, and described signature procedure installation kit generation module refers to according to described scriptMake the generation of signature procedure installation kit;
Described signature procedure installation kit generation module includes decompressing subelement, amendment subelement;
Described decompression subelement carries out decompressing and by the literary composition after decompression for calling unsigned Android program installation kitPart is stored in described first memory element;
Described amendment subelement is for reading the channel symbolic identifier file in described first memory element and to described solutionThe channel number of the configuration file AndroidManifest file unsigned in Android program installation package file after pressure is revised as canalRoad symbolic identifier is laid equal stress on and is newly packed.
Further, after described first memory element stores described unsigned Android program installation kit decompression alwaysCopy.
Further, described signature procedure installation kit generation module also includes that key adds subelement;Described key addsThe installation kit that described amendment subelement is produced by subelement adds the key file read from described first memory element and generates labelName installation kit is sent in described second memory element.
In general, by the contemplated above technical scheme of the present invention compared with prior art, it is possible to show under acquirementBenefit effect:
(1) present invention uses and directly revises the channel name in installation kit, it is not necessary to compiling, owing to the means used are to pass throughPerform the python script designed, computer be automatically performed the work of production routine bag, reduce manual intervention degree, error rateIt is 0;
(2) execution efficiency is high, and the averagely generation time of each installation kit is reduced to 20 seconds, in the installation of working system batchBao Shi, the work efficiency of raising is the most considerable.
Accompanying drawing explanation
Fig. 1 is the basic procedure signal of the rapid batch generation method of the Android program installation kit according to present invention realizationFigure;
Fig. 2 is the operational process details in the rapid batch generation method of the Android program installation kit according to present invention realizationProcess schematic;
Fig. 3 be according to the present invention realize Android program installation kit rapid batch generation method in script perform automaticChange the schematic flow sheet of packing;
Fig. 4 is the composition frame chart of the rapid batch generation system of the Android program installation kit according to present invention realization;
Fig. 5 is in the script module in the rapid batch generation system of the Android program installation kit according to present invention realizationThe composition frame chart of program installation kit signal generating unit;
Fig. 6 is that the core process contrast of the rapid batch generation method of the Android program installation kit according to present invention realization is shownIt is intended to.
Detailed description of the invention
In order to make the purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, rightThe present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, andIt is not used in the restriction present invention.If additionally, technical characteristic involved in each embodiment of invention described belowThe conflict of not constituting each other just can be mutually combined.
According to the rapid batch generation method of the Android program installation kit that the present invention realizes, it mainly solves following aspectProblem:
The strapping tool of Android program installation kit is installed;
The Android program installation kit being applicable to different application shop is identified;
Realize the generation of automated execution program bag.
The rapid batch wherein performed according to the present invention generates method, and it is different from key component of the prior art and isMark and automated execution, i.e. being identified the Android program installation kit in different application shop when, have devisedA kind of new mode, and use automated execution process based on script edit, it is possible to significantly increase Android program and installThe efficiency that the rapid batch of bag generates.
From the point of view of in its essence, it is simply that packaging method of the prior art, after the process completing compiling build, reviseFor the identifier code in application shop, then regenerate unsigned APK, recompilate again after signature, and in the present inventionIn, directly use the mode of decompression that the APK that unsigns is realized operation, thus again the file in Android program installation kit is carried outThe operation of amendment code, saves the time repeatedly compiled.
Specifically, solve above-mentioned problem mainly to perform through following means:
(1) packing problem is solved
Firstly the need of getting out computer software instrument: jdk, apkTool, it is ensured that they are correctly installed in computer,Performed the packing of android program by these 2 instruments, the Android program installation kit now generated includes not for application shopThe installation package file of mark, and for the signature key key file of each installation kit and password;
(2) the Android program installation kit being applicable to different application shop is identified
In the configuration file of the application program of each Android program installation kit, a channel number mark is setChannelCode, this mark is to need follow-up to carry out batch write when pack, and belongs in configuration fileHold, it is modified thus completes the channel number that different application shop distribution is different, generate a special unification simultaneously and depositPut the file of the ChannelCode identifier stating each application shop to be written, all of application shop is realized unifiedApplication management, wherein form the no requirement (NR) to this document, and to storage position the most not requirement, it is only necessary to hold follow-upIt can be conveniently read the when of row packing program automatically.
(3) automated execution problem is solved
In the present invention, by writing python script, by execution python script realization, APK file is first unpacked,The ChannelCode in configuration file is revised channel number mark again, the most again packs.For each different application shopAndroid program installation kit only need to perform an order, and waits that computer completes task and can generate, and the packing of whole batchProcess Exactly-once compiles, and in this manner, order performs, and the rapid batch that thus can complete Android program installation kit is rawBecome.
Embodiment 1
As it is shown in figure 1, the method that the present embodiment relates to mainly includes following core process:
Packaging file prepares: include unsign installation kit, key, cipher key path, channel symbolic identifier file;
Decompressing files bag: directly installation kit of unsigning is realized decompression;
The channel number in configuration file in amendment installation kit;
Key generates and obtains installation kit.
As in figure 2 it is shown, in concrete execution step, according to the rapid batch of the Android program installation kit that the present invention realizesGeneration method, the generation of whole rapid batch program bag comprises the steps:
STEP1: determine the information applying shop corresponding to the installation kit needing to upload, for each application shop distribution markKnowing symbol, typically this identifier is numbering form;
STEP2: writing application store channel symbolic identifier unified file, this document, will be for often without any call formatUse between the channel symbolic identifier in individual different application shop and can distinguish the separator of extraction such as, #, { }, wait to distinguish and write?.It is channel by file designation, the unformatted requirement of filename, but python script later needs to pass through this articlePart name reads this document thus obtains application shop corresponding channel symbolic identifier, in order to realize in configuration file contentChannel=" code " code be written as corresponding channel symbolic identifier.
STEP3: install required software packaging instrument on computers: guarantee that jdk, apkTool, python are correctly installed toIn computer;
STEP4: unsigned program bag of packing: utilize android studio instrument, unsigned application journey of packing outSequence installation kit;
STEP5: decompress the above-mentioned application program installation kit not signing channel name packed out by apkTool.jar;
STEP6: the channel number in configuration file AndroidManifest in the amendment application program that presses out of solution for fromThe channel number that CHANNEL file reads out;
STEP7: repack out the program installation kit of label channel name;
STEP8: obtain signature key key and the password of application program to be packed;
STEP9: fill in path and the password of signature key file key for the program installation kit of above-mentioned packing;
STEP10: repeat above-mentioned STEP6-STEP9 until completing the generation of all of batch program installation kit.
Embodiment 2
As it is shown on figure 3, in completing above-mentioned Mass production step, the present invention is additionally also by writing python scriptMode assists the generation automatically performing batch installation kit, and the step that wherein function of script relates to is as follows:
STEP1: decompressing the above-mentioned application program installation kit not signing channel name packed out by apkTool.jar, this is notThe installation kit signing channel name is the installation kit not generated for each application shop;
STEP2: read the wherein channel symbolic identifier in channel symbolic identifier file;
STEP3: the channel number in configuration file AndroidManifest in the application program that amendment solution presses out is for readingThe channel symbolic identifier taken out;
STEP4: repack out the program installation kit of label channel name;
STEP5: the path and the password that fill signature key file key thus complete the Android for an application shopThe generation of program installation kit;
Repeat the above steps STEP2~STEP5, thus complete the Android program installation kit for all of application shopRapid batch generates.
According to the rapid batch generation method of the Android program installation kit that the present embodiment realizes, the batch that its script performs is beatenBag generation process specific operation process is as follows:
(1) by the key key file of signature procedure installation kit, apktool.jar file, channel symbolic identifier fileChannel, python script file BuildTool.py is put under certain unified file catalogue;
(2) at the Command Line Interface of windows, enter under this document catalogue;
(3) at the Command Line Interface of windows, input order python BuildTool.py can automatic packed canalThe all of channel installation kit related in Taoist monastic name file.
In a word, according to the rapid batch generation method of the Android program installation kit that the present invention realizes, find according to configurationAt the one of file, amendment need not recompilate, and is the packaging method being adapted to the present invention, has given up the base of current employingClick on button in upper strata developing instrument and be directly realized by the mode of operation of a key packing, but use script directly to go to call exploitationInstrument realizes packing so that whole process is capable of more quickly packing and processes.As shown in table 1 below, it is i.e. according to thisBatch packaging method and the process of batch packaging method of the prior art that invention realizes contrast schematic diagram, can send out from whichSubstantive difference in existing process, because saving the process of build compiling, saves the time significantly.
The sequence of steps contrast of table 1 packaging method
| The packaging method of prior art | The packaging method of the present invention |
| Build | Build |
| Amendment code | Generation is unsigned APK |
| Generation is unsigned APK | Decompression |
| Signature | Amendment code |
| Build | Signature |
| Amendment code | Amendment code |
| Signature |
Such as Fig. 4,5 still further aspects, the invention also discloses a kind of for realizing quickly generating of Android program installation kitSystem, this system specifically includes that
Android of unsigning program installation kit generation module, script run module and memory module, and wherein script runs moduleIncluding signature procedure installation kit generation module and interface instructions unit;
Wherein memory module includes the first memory element and the second memory element;
Peace of wherein unsigning program installation kit generation module is mainly used in using strapping tool to generate unsigned installation kitFile apktool.jar file;
The channel symbolic identifier file that wherein the first memory element edits for storage, key file, and be used for depositingStore up unsigned Android program installation package file apktool.jar file;
Wherein, signature procedure installation kit generation module includes that decompressing subelement, amendment subelement and key adds son listUnit;
Decompression subelement carries out decompressing and by the file after decompression for calling installation package file apktool.jar fileIt is stored in the first memory element;
Amendment subelement for call channel symbolic identifier file and read channel symbolic identifier to decompression afterThe channel number of the configuration file AndroidManifest file in apktool.jar file is modified thus is generated this channelThe installation kit in number corresponding application shop;
Installation kit after above-mentioned amendment channel number is repacked and is added key file and generates by key interpolation subelementThe installation kit in whole application shop is sent in the second memory element;
Its median surface running unit enters the interface of script command for providing, and receives startup and calls script operation mouldThe order of block, the rapid batch thus driving whole system to complete installation kit generates.
As shown in Figure 6, illustrate the generation process of the present invention and existing difference, on the left side of Fig. 6, be through severalThe APK process in stage so that the generation time significantly increases, and in the present system, has deposited installation in the first memory element alwaysCopy after APMB package apktool.jar file decompression, constantly calls it and generates the installation kit issued for each application shop,It is stored in the second memory element, thus raw batches of installer package.
Wherein interface instructions unit can be the order line runnable interface of the band CMD under windows system.
As it will be easily appreciated by one skilled in the art that and the foregoing is only presently preferred embodiments of the present invention, not in order toLimit the present invention, all any amendment, equivalent and improvement etc. made within the spirit and principles in the present invention, all should compriseWithin protection scope of the present invention.