CN105487876A - Real-time and multi-channel packaging method for android - Google Patents

Real-time and multi-channel packaging method for android Download PDF

Info

Publication number
CN105487876A
CN105487876A CN201511027952.3A CN201511027952A CN105487876A CN 105487876 A CN105487876 A CN 105487876A CN 201511027952 A CN201511027952 A CN 201511027952A CN 105487876 A CN105487876 A CN 105487876A
Authority
CN
China
Prior art keywords
channel
apk
annotation data
android
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.)
Pending
Application number
CN201511027952.3A
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.)
Wuhan Shoumeng Network Technology Co Ltd
Original Assignee
Wuhan Shoumeng Network 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 Wuhan Shoumeng Network Technology Co Ltd filed Critical Wuhan Shoumeng Network Technology Co Ltd
Priority to CN201511027952.3A priority Critical patent/CN105487876A/en
Publication of CN105487876A publication Critical patent/CN105487876A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a real-time and multi-channel packaging method for android. According to the method, recording of channel numbers is achieved by modifying the annotation length and the annotation content in an APK program package, and therefore only the annotation of the APK program package needs to be modified without recompiling a program or conducting signing on a package body, the packaging efficiency can be greatly improved, and storage space can be saved. The method has the advantages of being simple in step, easy to achieve and the like. The method can be widely applied to the field of multi-channel packaging.

Description

The real-time packaging method by all kinds of means of a kind of Android
Technical field
The present invention relates to channel bag generation technique, particularly relate to the real-time packaging method by all kinds of means of a kind of Android based on Android APK routine package.
Background technology
For current existing channel bag generation technique, it often generates a channel bag, all needs to revise the channel parameter value in AndroidManifest.xml, and then could generate new channel bag after compiling.But, owing to all needing recompility program and signing to inclusion at every turn, be therefore no matter that it is all very slow, and work efficiency is very low, thus greatly reduces a point speed for channel packing with craft or the mode of program to carry out this process.
Summary of the invention
In order to solve the problems of the technologies described above, the object of this invention is to provide a kind of Android in real time packaging method by all kinds of means, be adapted at using when disk generating different channel bag.
In order to solve the problems of the technologies described above, the object of this invention is to provide the real-time packaging method by all kinds of means of a kind of Android, use when being adapted at the different channel bag of the real-time dynamically generation of http server.
The present invention adopts a technical scheme to be: a kind of Android packaging method by all kinds of means in real time, and be adapted at using when disk generating different channel bag, it comprises:
A, open APK routine package;
B, acquisition channel numbering, then number according to the channel obtained thus generate annotation data;
C, annotation data is write in APK routine package, then close APK routine package.
Further, described step B specifically comprises:
Whether B1, judgement have comment field in the APK routine package of front opening, if having, then perform step B2; Otherwise, then step B3 is performed;
B2, the length in comment field is set to zero, and removes follow-up annotation data, then perform step B3;
B3, acquisition channel numbering, then number according to the channel obtained thus generate annotation data.
Further, the step that the annotation data generated is encrypted is provided with between described step B and step C.
Further, described step C is specially: the byte length calculating annotation data, writes byte length in comment field, and write on after this byte length by annotation data.
The present invention adopts another technical scheme to be: a kind of Android packaging method by all kinds of means in real time, and be adapted at using when http server dynamically generates different channel bag in real time, it comprises:
The acquisition of channel numbering is triggered after S1, the request of acquisition channel bag;
S2, according to obtain channel numbering, thus judge whether exist number corresponding channel comment file with this channel, if exist, then execution step S5; Otherwise, then step S3 is performed;
S3, according to obtain channel numbering thus generate annotation data;
S4, obtain the byte length of annotation data, then with small end sequence by this byte length writing in files, and after this byte length, write annotation data, to generate channel comment file;
S5, send original APK file content to client, retain last two bytes and do not send;
S6, transmission channel comment file are to client, and described APK file and channel comment file merge the complete APK routine package of generation one;
S7, described client receive the APK routine package of a complete band channel comment file.
Further, the step that the annotation data generated is encrypted is provided with between described step S3 and step S4.
The invention has the beneficial effects as follows: the real-time packaging method by all kinds of means of Android of the present invention, be adapted at using when disk generating different channel bag, and by adopting this packaging method of the present invention, when generating channel bag then without the need to carrying out recompility program and signing to inclusion, only needing that corresponding amendment is carried out to the content of the comment field of APK routine package and recording channel numbering and just can.Therefore can obtain thus, the method for the application of the invention, the effect of packing fast can be realized.
Another beneficial effect of the present invention is: the real-time packaging method by all kinds of means of Android of the present invention, uses when being adapted at the different channel bag of the real-time dynamically generation of http server.By adopting this packaging method of the present invention, when generating channel bag then without the need to carrying out recompility program and signing to inclusion, only need to generate annotation data according to channel numbering, thus generation comment file, then the APK routine package of a complete band comment file can just be generated after comment file and original APK file being merged, i.e. a channel bag.Can obtain thus, the method for the application of the invention, the effect of fast packing can be realized, and only need on http server preservation main bag and channel comment file just can, dramatically saves on time and the storage space of packing.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is described further:
Fig. 1 is a kind of specific embodiment flow chart of steps being adapted at disk generates the real-time packaging method by all kinds of means of Android of different channel bag of the present invention;
Fig. 2 is a kind of specific embodiment flow chart of steps being adapted at the real-time packaging method by all kinds of means of Android of the different channel bag of the real-time dynamically generation of http server of the present invention;
Fig. 3 is the flow chart of steps of APK routine package being carried out to reading process.
Embodiment
For the existing packing manner by amendment AndroidManifest.xml, to generate 100 channel bags, then need to repeat compiling and signature just can obtain 100 channel bags 100 times, so then the significant wastage packing time, greatly reduce the efficiency of packing process.Therefore, for a technical matters, the annotation that the invention provides in a kind of APK of utilization routine package carries out channel number record, thus realizes the method for packing fast.
For described APK routine package, it is actual is a ZIP file, and the form of described ZIP file is divided into three parts, is respectively pressure source file data district, pressure source file directory district and pressure source file directory end mark.
For above-mentioned pressure source file data district, pressure source file directory district and pressure source file directory end mark, specifically describe as follows:
1, pressure source file data district
In this data field each compression source file/catalogue be a record, the form of record is [file header+file data+data descriptor], wherein, the form of described file header and the form of data descriptor as follows:
(1), the form of file header
(2), the form of data descriptor
This data descriptor only just exists, after last byte of packed data when being set to 1 for the 3rd of global mode position mark.This data descriptor is only used in when can not retrieve the ZIP file exported and just uses (such as: in the ZIP file on a driver that can not retrieve (as: on magnetic tape station)), if the ZIP file on disk does not generally have this data descriptor;
2, pressure source file directory district
The corresponding data in pressure source file data district of each record in this data field, and its form is as follows:
3, pressure source file directory end mark
The form of described pressure source file directory end mark is as follows:
Obtained by above-mentioned, the present invention realizes quick packing particular by the annotation length in amendment APK routine package and notes content.Described annotation length and notes content composition comment field, the data comprised in described notes content are annotation data.
As shown in Figure 1, a kind of Android in real time packaging method by all kinds of means, be adapted at disk generates different channel bag, its step specifically includes:
S101, open APK routine package;
Whether S102, judgement have comment field in the APK routine package of front opening, if having, then perform step S103; Otherwise, then step S104 is performed;
S103, the length in comment field is set to zero, and removes follow-up annotation data, then perform step S104;
S104, acquisition channel numbering, then number according to the channel obtained thus generate annotation data;
Described is numbered according to the channel obtained thus generate annotation data, it is specially: utilize certain mark rule, thus generating a string annotation word, i.e. annotation data according to channel numbering, this word can read for program and reduce and obtain original channel numbering;
S105, carrying out distorting of channel numbering to prevent third party from revising notes content simply, therefore, the annotation data generated being encrypted;
S106, by the annotation data write APK routine package after encryption, then close APK routine package;
Particularly, calculate the byte length of the annotation data after encryption, the byte length calculated is write in the annotation length areas of comment field, and the annotation data after encryption is write on after this byte length, namely access in notes content region, then close APK routine package.
Obtained by above-mentioned, adopt above-mentioned packaging method, when disk generates different channel bag, then without the need to carrying out recompility program and signing to inclusion, only need that corresponding amendment is carried out to the content of the comment field of APK routine package and record channel numbering and just can.Can obtain thus, the method for the application of the invention, the effect of fast packing can be realized on disk, and method of the present invention also have step simple, be easy to the advantages such as realization.
As shown in Figure 2, a kind of Android in real time packaging method by all kinds of means, be adapted at http server and dynamically generate different channel bag in real time, it specifically comprises:
S201, http server trigger the acquisition of channel numbering after obtaining the request of channel bag, wherein, described channel bag request is sent by client;
S202, according to obtain channel numbering, thus judge whether exist number corresponding channel comment file with this channel, namely judge whether to have existed and number according to this channel the channel comment file generated, if existence, then execution step S206; Otherwise, then step S203 is performed;
S203, according to obtain channel numbering thus generate annotation data;
Described step S203 is specially, and utilizes certain mark rule, thus generates a string annotation word, i.e. annotation data according to channel numbering, and this word can read for program and reduce and obtain original channel numbering;
S204, carry out distorting of channel numbering to prevent third party from revising notes content simply, the annotation data generated is encrypted;
S205, obtain the byte length of annotation data after encryption, then with small end sequence by this byte length writing in files, and the annotation data after this byte length after write encryption, to generate channel comment file;
From the above, the length mark of the comment field of ZIP file is small end sequence (little-endian), so first the byte length of the annotation data after encryption is write with small end sequence, and the annotation data after writing encryption thereafter, so just can generate the encryption comment file belonging to this channel;
S206, send original APK file content to client, retain last two bytes and do not send, namely http server is sent to client original APK file, because last two bytes are generally annotation length 0, so last two bytes do not send;
S207, transmission channel comment file are to client;
Due to the length that channel comment file head two bytes are exactly notes content, so described APK file and channel comment file just generate a complete APK routine package after merging;
S208, described client receive the APK routine package of a complete band channel comment file, and then client just can carry out every follow-up work according to the APK routine package received.
And for the above-mentioned APK routine package as channel bag, as shown in Figure 3, the step that it carries out reading process is specifically included:
S301, acquisition APK routine package;
S302, judge whether have annotation in APK routine package, if so, then perform step S303; Otherwise, then terminate;
S303, the annotation read in this APK routine package, and the decrypt data to this annotation;
S304, when after successful decryption, according to deciphering after annotation data thus reduction channel numbering;
S305, carry out corresponding operational processes according to the channel numbering obtained, as channel numbering is issued the operation of statistical server and so on.
More than that better enforcement of the present invention is illustrated, but the invention is not limited to described embodiment, those of ordinary skill in the art also can make all equivalent variations or replacement under the prerequisite without prejudice to spirit of the present invention, and these equivalent distortion or replacement are all included in the application's claim limited range.

Claims (6)

1. the real-time packaging method by all kinds of means of Android, is characterized in that: it comprises:
A, open APK routine package;
B, acquisition channel numbering, then number according to the channel obtained thus generate annotation data;
C, annotation data is write in APK routine package, then close APK routine package.
2. a kind of Android in real time packaging method by all kinds of means according to claim 1, is characterized in that: described step B specifically comprises:
Whether B1, judgement have comment field in the APK routine package of front opening, if having, then perform step B2; Otherwise, then step B3 is performed;
B2, the length in comment field is set to zero, and removes follow-up annotation data, then perform step B3;
B3, acquisition channel numbering, then number according to the channel obtained thus generate annotation data.
3. the real-time packaging method by all kinds of means of a kind of Android according to claim 1 or 2, is characterized in that: be provided with the step be encrypted the annotation data generated between described step B and step C.
4. the real-time packaging method by all kinds of means of a kind of Android according to claim 1 or 2, is characterized in that: described step C is specially: the byte length calculating annotation data, writes byte length in comment field, and write on after this byte length by annotation data.
5. the real-time packaging method by all kinds of means of Android, is characterized in that: it comprises:
The acquisition of channel numbering is triggered after S1, the request of acquisition channel bag;
S2, according to obtain channel numbering, thus judge whether exist number corresponding channel comment file with this channel, if exist, then execution step S5; Otherwise, then step S3 is performed;
S3, according to obtain channel numbering thus generate annotation data;
S4, obtain the byte length of annotation data, then with small end sequence by this byte length writing in files, and after this byte length, write annotation data, to generate channel comment file;
S5, send original APK file content to client, retain last two bytes and do not send;
S6, transmission channel comment file are to client, and described APK file and channel comment file merge the complete APK routine package of generation one;
S7, described client receive the APK routine package of a complete band channel comment file.
6. a kind of Android in real time packaging method by all kinds of means according to claim 5, is characterized in that: be provided with the step be encrypted the annotation data generated between described step S3 and step S4.
CN201511027952.3A 2015-12-30 2015-12-30 Real-time and multi-channel packaging method for android Pending CN105487876A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511027952.3A CN105487876A (en) 2015-12-30 2015-12-30 Real-time and multi-channel packaging method for android

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511027952.3A CN105487876A (en) 2015-12-30 2015-12-30 Real-time and multi-channel packaging method for android

Publications (1)

Publication Number Publication Date
CN105487876A true CN105487876A (en) 2016-04-13

Family

ID=55674876

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511027952.3A Pending CN105487876A (en) 2015-12-30 2015-12-30 Real-time and multi-channel packaging method for android

Country Status (1)

Country Link
CN (1) CN105487876A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648643A (en) * 2016-12-12 2017-05-10 北京三快在线科技有限公司 Method and device for generating channel package, terminal and server
CN106775643A (en) * 2016-11-22 2017-05-31 武汉斗鱼网络科技有限公司 A kind of application file packaging system and method with channel data
CN106843962A (en) * 2017-01-19 2017-06-13 北京乐盟互动科技有限公司 One kind application packaging method and device
CN108196851A (en) * 2017-12-28 2018-06-22 腾讯科技(深圳)有限公司 Using dissemination method and device
CN110620827A (en) * 2019-10-29 2019-12-27 广州趣丸网络科技有限公司 Fragment packaging method, host, system and equipment on Android cloud
CN111610984A (en) * 2020-05-09 2020-09-01 上海万间信息技术有限公司 Plug-in-based android application packaging and distributing method and system and application terminal

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106775643A (en) * 2016-11-22 2017-05-31 武汉斗鱼网络科技有限公司 A kind of application file packaging system and method with channel data
CN106648643A (en) * 2016-12-12 2017-05-10 北京三快在线科技有限公司 Method and device for generating channel package, terminal and server
CN106843962A (en) * 2017-01-19 2017-06-13 北京乐盟互动科技有限公司 One kind application packaging method and device
CN108196851A (en) * 2017-12-28 2018-06-22 腾讯科技(深圳)有限公司 Using dissemination method and device
CN110620827A (en) * 2019-10-29 2019-12-27 广州趣丸网络科技有限公司 Fragment packaging method, host, system and equipment on Android cloud
CN110620827B (en) * 2019-10-29 2022-02-25 广州趣丸网络科技有限公司 Fragment packaging method, host, system and equipment on Android cloud
CN111610984A (en) * 2020-05-09 2020-09-01 上海万间信息技术有限公司 Plug-in-based android application packaging and distributing method and system and application terminal
CN111610984B (en) * 2020-05-09 2023-10-27 上海万间信息技术有限公司 Android application packaging and distributing method and system based on plug-in and application terminal

Similar Documents

Publication Publication Date Title
CN105487876A (en) Real-time and multi-channel packaging method for android
KR102098548B1 (en) Method and device for verifying block data in blockchain
EP4318410A3 (en) Distributed application architectures using blockchain and distributed file systems
CN109800582B (en) Traceable multi-party data processing method, device and equipment
CN104503745B (en) A kind of method and apparatus generated using channel packet
CN103577762B (en) Channel marking system and method in Android application distribution system
CN107908933A (en) A kind of character string encryption method based on intermediate language
CN106960156A (en) Data encryption and access method based on application program, device
CN103647636B (en) The method and device of security access data
CN103413076A (en) Block protection method for Android application programs
KR101535703B1 (en) Apparatus and method for converting Value Object
CN103324481A (en) Compiling method and compiling system for obfuscating codes by means of assembly
CN103065082A (en) Software security protection method based on Linux system
CN105718276A (en) Method and device for providing APK download and NGINX server
CN104778419A (en) User privacy data protection method based on dynamic data flow tracking under cloud environment
CN103473168B (en) A kind of statistical method of focus program
CN104298534A (en) Programming method and device based on Lua language
CN104168435A (en) Method and system for batched mergence and playing of audio files
CN104463020A (en) Method for protecting data integrity of memory
US20180234245A1 (en) Method and system for nfc-based mobile terminal password storage and recovery
KR101536920B1 (en) Method of Obfuscating Files Based on Advanced RISC Machine Processor
CN102880677B (en) A kind of packing of the file based on Hash and read method
CN109657167B (en) Data acquisition method, device, server and storage medium
CN113297611B (en) Data processing, encryption storage and reading method, device and storage medium
CN105808979A (en) Improved Android software installation package signature and signature verification method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160413

WD01 Invention patent application deemed withdrawn after publication