WO2019165705A1 - 安卓应用打包上传方法、装置、计算机设备及存储介质 - Google Patents

安卓应用打包上传方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2019165705A1
WO2019165705A1 PCT/CN2018/085250 CN2018085250W WO2019165705A1 WO 2019165705 A1 WO2019165705 A1 WO 2019165705A1 CN 2018085250 W CN2018085250 W CN 2018085250W WO 2019165705 A1 WO2019165705 A1 WO 2019165705A1
Authority
WO
WIPO (PCT)
Prior art keywords
compiled
file
installation package
package
current
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.)
Ceased
Application number
PCT/CN2018/085250
Other languages
English (en)
French (fr)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2019165705A1 publication Critical patent/WO2019165705A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/50Service provisioning or reconfiguring
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Definitions

  • the present application relates to the field of Android application development technologies, and in particular, to an Android application package uploading method, device, computer device, and storage medium.
  • Android applications that is, applications in Android
  • IDE packaging such as Eclipse or Android Studio, manually modify the configuration, after the package is finished, manually upload to the specified server address
  • Eclipse is an open source, Java-based scalable development platform, which is A framework and a set of services for building a development environment through plug-in components
  • Android Studio is an Android development environment that provides integrated Android development tools for development and debugging
  • IDE the full name is Integrated Development Environment, which represents an integrated development environment.
  • An application that provides a program development environment typically including a code editor, compiler, debugger, and graphical user interface tools;
  • the application provides an Android application package uploading method, device, computer device and storage medium, which aims to solve the problem that the Android application packaging relies on manual manual configuration of the packaging tool or the configuration of the independent server, which is error-prone and inefficient. The problem.
  • the present application provides an Android application package uploading method, which includes: acquiring an automatic packaging script stored on a shared server; determining, by using an automatic packaging script, whether a compiled configuration cache file exists in a local file; if the local file exists Compile the configuration cache file, read the compiled configuration cache file, and set the current configuration parameters according to the compiled configuration cache file; if the compiled configuration cache file does not exist in the local file, initialize the current configuration parameters; configure the current configuration parameters into the installation package program, Compile and package the installation package program to get the installation package apk file, and upload the installation package apk file to the specified server address preset.
  • an Android application package uploading apparatus including:
  • a script obtaining unit for acquiring an automatic packaging script stored on the shared server
  • a determining unit configured to determine, by using an automatic packaging script, whether a compiled configuration cache file exists in the local file
  • the first configuration parameter obtaining unit is configured to: if the compiled configuration cache file exists in the local file, read the compiled configuration cache file, and set the current configuration parameter according to the compiled configuration cache file;
  • a second configuration parameter obtaining unit configured to initialize a current configuration parameter if a compiled configuration cache file does not exist in the local file
  • the uploading unit is configured to configure the current configuration parameter into the installation package program, compile and package the installation package program to obtain the installation package apk file, and upload the installation package apk file to the preset server address.
  • the present application further provides a computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the computer program
  • a computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the computer program
  • the present application also provides a storage medium, wherein the storage medium stores a computer program, the computer program comprising program instructions, the program instructions, when executed by a processor, causing the processor to execute the application Any of the provided Android application package uploading methods.
  • the application provides an Android application package uploading method, device, computer device and storage medium. This method implements packaging automation, eliminating the need to manually configure the parameters of the packaging tool, and eliminates the need to deploy a separate server, improving packaging efficiency and success rate.
  • FIG. 1 is a schematic flowchart of a method for uploading and uploading an Android application according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a sub-flow of an Android application package uploading method according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of another sub-flow of an Android application package uploading method according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of another sub-flow of an Android application package uploading method according to an embodiment of the present application.
  • FIG. 5 is another schematic flowchart of an Android application package uploading method according to an embodiment of the present application.
  • FIG. 6 is a schematic block diagram of an Android application package uploading apparatus according to an embodiment of the present application.
  • FIG. 7 is a schematic block diagram of a subunit of an Android application package uploading apparatus according to an embodiment of the present application.
  • FIG. 8 is a schematic block diagram of another subunit of an Android application package uploading apparatus according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic block diagram of another subunit of an Android application package uploading apparatus according to an embodiment of the present application.
  • FIG. 10 is another schematic block diagram of an Android application package uploading apparatus according to an embodiment of the present application.
  • FIG. 11 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of a method for uploading and uploading an Android application according to an embodiment of the present application.
  • the method is applied to terminals such as desktop computers, laptop computers, and tablet computers.
  • the method includes steps S101 to S105.
  • the shell script is selected as an automatic package script, and the shell script is used to determine whether the local configuration file has a compiled configuration cache file, the current configuration parameters are configured into the installation package program, and the installation package program is compiled and packaged and uploaded to the server.
  • the shell script is similar to the batch processing under Windows/Dos, that is, a program file that is pre-loaded into a file with various commands, which is convenient for one-time execution.
  • the automatic package script (that is, the shell script) is stored in the project project directory of the shared server, any terminal that needs to pull the shell script establishes a connection with the shared server, and then directly pulls the shell script from the project project directory, so that the same At present, multiple terminals can pull shell scripts to automatically package apk files, so that multiple terminals can be packaged at the same time without interference, which improves the packaging efficiency.
  • S102 Determine, by using an automatic packaging script, whether a compiled configuration cache file exists in the local file.
  • the automatic packaging script is started to start the Android application packaging.
  • the last configured configuration cache file is recorded.
  • the configuration cache file mainly includes the compiled user information (by who triggered the compilation), the compiled version number, the compilation time, and Applicable environment of the installation package (indicating whether the installation package is a production environment installation package or a test environment installation package, etc.).
  • the configuration parameters need not be set again, but can be directly obtained from the compiled configuration cache file; if the compiled configuration cache file does not exist, it indicates that the current configuration parameters need to be initialized.
  • the automatic packaging script is used instead of the manual judgment, and the compiled configuration cache file is automatically pulled from the local file, thereby improving the reading efficiency of the configuration file.
  • reading the compiled configuration cache file in step S103, and setting the current configuration parameters according to the compiled configuration cache file includes the following substeps:
  • S1031 Obtain compiled user information, compiled version number, compiled time, and applicable environment of the installation package included in the compiled configuration cache file;
  • the compiler environment identifier in the automatic packaging script is test, and the applicable environment of the installation package is set as a test environment installation package; in the automatic packaging script, the compiler environment identifier is product, and the applicable environment of the installation package is set to production. Environment installation package.
  • each time the shell script is packaged the time of the last package is recorded in the compiled configuration cache file, the build version number (a number, that is, the compiled version number, such as 23), the compiled user information, etc.
  • the build version number a number, that is, the compiled version number, such as 23
  • the compiled user information etc.
  • the next time you directly read the cache file modify the compilation on the last basis (the version number of the previous compilation is 23, the program automatically adds 1 and 24 is the version number of this compilation).
  • the user can manually modify and directly compile the configuration cache file through the automatic packaging script.
  • the initial configuration parameter in the step S104 includes the following sub-steps:
  • S1041 Acquire user information currently compiled in the system, and set the compiled user information as current compiled user information;
  • S1044 Obtain an applicable environment corresponding to the compiler environment identifier in the shell script, and set an applicable environment of the installation package to an applicable environment corresponding to the compiler environment identifier;
  • the compiled configuration cache file if the compiled configuration cache file does not exist in the local file, it indicates that the current configuration parameter needs to be initialized.
  • the difference between the compiled configuration cache file and the local file is that the compiled version number needs to be set to 1, and the current configuration parameters are initialized directly by the automatic packaging script without manual modification by the user.
  • step S105 the current configuration parameters are configured into the installation package program, and the installation package program is compiled and packaged to obtain the installation package apk file including the following sub-steps:
  • S1052 Compile user information, compiled version number, compile time, and applicable environment of the installation package included in the current configuration parameter, corresponding to a folder that is sent to the installation package program.
  • the current terminal pulls the shell script on the shared server and obtains the current configuration parameters locally, then Compile the current configuration parameters into a local installation package that is to be packaged and not compiled.
  • the shell script recognizes that the current configuration parameters exist in the installation package program, and can be further automatically packaged.
  • the installation package apk file is compiled and packaged in the step S105 to include the following sub-steps (that is, the following sub-steps are also included after the step S1052):
  • S1055 Locating the root directory of the source code, and executing the preset second instruction to generate a second automatic package file under the source code;
  • S1057 Obtain a signature file corresponding to the storage path set in the shell script, and add the signature file, the first automatic package file, and the second automatic package file to the unsigned apk file to obtain the installation package apk file.
  • the first instruction preset is android update lib-project-p.-t android-17, where -p. means to execute in the current root directory, -t android-17 means this
  • the source code is compiled using the android-17 api. The above parameters can be modified according to the project conditions. All dependent libraries must perform this step.
  • the preset second instruction is android update project-p.-t android-17, which is different from the first instruction in that the first instruction is to update the dependent library lib to generate the first automatic package file under the dependency library.
  • the second instruction is to update the source code in the project project to generate a second automatic package file.
  • the signature file is a META-INF file, which is equivalent to a packet.
  • the files and directories in the directory are recognized and interpreted by the Java 2 platform.
  • Applications, extensions, class loaders, and service manifest.mf files are automatically generated when packaged with jars. In the above manner, the installation package program is automatically compiled and packaged, and the packaging process does not need to deploy a separate server.
  • the method realizes the packaging automation of the Android application, and does not need to manually configure the parameters of the packaging tool, and does not need to deploy a separate server, thereby improving the packaging efficiency and success rate.
  • the embodiment of the present application further provides an Android application package uploading device, where the Android application package uploading device is configured to execute any of the foregoing Android application package uploading methods.
  • FIG. 6 is a schematic block diagram of an Android application package uploading apparatus according to an embodiment of the present application.
  • the Android application package uploading device 100 can be installed in a desktop computer, a tablet computer, a laptop computer, and the like.
  • the Android application package uploading apparatus 100 includes a script acquiring unit 101, a determining unit 102, a first configuration parameter acquiring unit 103, a second configuration parameter acquiring unit 104, and an uploading unit 105.
  • the script obtaining unit 101 is configured to acquire an automatic packaging script stored on the shared server.
  • the shell script is selected as the automatic package script, and the shell script is used to determine whether the local configuration file has a compiled configuration cache file, the current configuration parameters are configured into the installation package program, and the installation package program is compiled and packaged and uploaded to the server.
  • the shell script is similar to the batch processing under WindoWs/Dos, that is, a program file that is pre-loaded into a file with various commands, which is convenient for one-time execution.
  • the automatic package script (that is, the shell script) is stored in the project project directory of the shared server, any terminal that needs to pull the shell script establishes a connection with the shared server, and then directly pulls the shell script from the project project directory, so that the same At present, multiple terminals can pull shell scripts to automatically package apk files, so that multiple terminals can be packaged at the same time without interference, which improves the packaging efficiency.
  • the determining unit 102 is configured to determine, by using an automatic packaging script, whether a compiled configuration cache file exists in the local file.
  • the automatic packaging script is started to start the Android application packaging.
  • the last configured configuration cache file is recorded.
  • the configuration cache file mainly includes the compiled user information (by who triggered the compilation), the compiled version number, the compilation time, and Applicable environment of the installation package (indicating whether the installation package is a production environment installation package or a test environment installation package, etc.).
  • the configuration parameters need not be set again, but can be directly obtained from the compiled configuration cache file; if the compiled configuration cache file does not exist, it indicates that the current configuration parameters need to be initialized.
  • the automatic packaging script is used instead of the manual judgment, and the compiled configuration cache file is automatically pulled from the local file, thereby improving the reading efficiency of the configuration file.
  • the first configuration parameter obtaining unit 103 is configured to: if the compiled configuration cache file exists in the local file, read the compiled configuration cache file, and set the current configuration parameter according to the compiled configuration cache file.
  • the first configuration parameter obtaining unit 103 includes the following subunits:
  • the local cache file obtaining unit 1301 is configured to obtain the compiled user information, the compiled version number, the compiled time, and the applicable environment of the installation package included in the compiled configuration cache file.
  • the self-incrementing unit 1302 is configured to use the compiled version number.
  • the first time setting unit 1303 is configured to set the compiled time as the current system time;
  • the first user information setting unit 1304 is configured to set the compiled user information as the current compiled user information;
  • the compiler environment identifier in the automatic packaging script is test, and the applicable environment of the installation package is set as a test environment installation package; in the automatic packaging script, the compiler environment identifier is product, and the applicable environment of the installation package is set to production. Environment installation package.
  • each time the shell script is packaged the time of the last package is recorded in the compiled configuration cache file, the build version number (a number, that is, the compiled version number, such as 23), the compiled user information, etc.
  • the build version number a number, that is, the compiled version number, such as 23
  • the compiled user information etc.
  • the next time you directly read the cache file modify the compilation on the last basis (the version number of the previous compilation is 23, the program automatically adds 1 and 24 is the version number of this compilation).
  • the user can manually modify and directly compile the configuration cache file through the automatic packaging script.
  • the second configuration parameter obtaining unit 104 is configured to initialize the current configuration parameter if the compiled configuration cache file does not exist in the local file.
  • the second configuration parameter obtaining unit 104 includes the following subunits: a second user information setting unit 1041, configured to acquire current compiled user information in the system, and set the compiled user information. Compiling the user information for the current; the version number initial setting unit 1042 is configured to set the compiled version number to 1; the second time setting unit 1043 is configured to acquire the current system time, and set the compiled time to the current system time; The environment setting unit 1044 is configured to obtain an applicable environment corresponding to the compiler environment identifier in the shell script, and set an applicable environment of the installation package to an applicable environment corresponding to the compiler environment identifier.
  • the parameter initialization unit 1045 is configured to use the compiled user information. The compiled version number, the compile time, and the applicable environment of the installation package, get the current configuration parameters initialized.
  • the compiled configuration cache file if the compiled configuration cache file does not exist in the local file, it indicates that the current configuration parameter needs to be initialized.
  • the difference between the compiled configuration cache file and the local file is that the compiled version number needs to be set to 1, and the current configuration parameters are initialized directly by the automatic packaging script without manual modification by the user.
  • the uploading unit 105 is configured to configure the current configuration parameter into the installation package program, compile and package the installation package program to obtain the installation package apk file, and upload the installation package apk file to the preset specified server address.
  • the uploading unit 105 includes the following subunits: an installation package obtaining unit 1051, configured to acquire a locally stored uncompiled installation package program, and an information input unit 1052, configured to use the current configuration parameter.
  • the compiled user information, the compiled version number, the compile time, and the applicable environment of the installation package are included in the folder corresponding to the installation package program.
  • the current terminal pulls the shell script on the shared server and obtains the current configuration parameters locally, then Compile the current configuration parameters into a local installation package that is to be packaged and not compiled.
  • the shell script recognizes that the current configuration parameters exist in the installation package program, and can be further automatically packaged.
  • the uploading unit 105 further includes the following subunit: an installation package parsing unit 1053, configured to acquire source code of the installation package program, and a dependent library source code corresponding to the source code; and a first positioning unit 1054 for positioning Depending on the library source directory, the first automatic package file under the dependency library is generated by executing the preset first instruction; the second positioning unit 1055 is configured to locate the root directory of the source code, and generate the source code by executing the preset second instruction.
  • an installation package parsing unit 1053 configured to acquire source code of the installation package program, and a dependent library source code corresponding to the source code
  • a first positioning unit 1054 for positioning Depending on the library source directory, the first automatic package file under the dependency library is generated by executing the preset first instruction
  • the second positioning unit 1055 is configured to locate the root directory of the source code, and generate the source code by executing the preset second instruction.
  • the signature file corresponding to the set storage path is added to the unsigned apk file by the signature file, the first automatic package file, and the second automatic package file to obtain the installation package apk file.
  • the first instruction preset is android update lib-project-p.-t android-17, where -p. means to execute in the current root directory, -t android-17 means this
  • the source code is compiled using the android-17 api.
  • the above parameters can be modified according to the project conditions. All dependent libraries must perform this step.
  • the preset second instruction is android update project-p.-t android-17, which is different from the first instruction in that the first instruction is to update the dependent library lib to generate the first automatic package file under the dependency library.
  • the second instruction is to update the source code in the project project to generate a second automatic package file.
  • the signature file is a META-INF file, which is equivalent to a packet.
  • the files and directories in the directory are recognized and interpreted by the Java 2 platform.
  • Applications, extensions, class loaders, and service manifest.mf files are automatically generated when packaged with jars. In the above manner, the installation package program is automatically compiled and packaged, and the packaging process does not need to deploy a separate server.
  • the device realizes the packaging automation of the Android application, and does not need to manually configure the parameters of the packaging tool, and does not need to deploy a separate server, thereby improving the packaging efficiency and success rate.
  • the Android application package uploading device described above can be implemented in the form of a computer program that can be run on a computer device as shown in FIG.
  • FIG. 11 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the computer device 500 device can be a terminal.
  • the terminal can be an electronic device such as a tablet computer, a notebook computer, a desktop computer, or a personal digital assistant.
  • the computer device 500 includes a processor 502, a memory, and a network interface 505 connected by a system bus 501, wherein the memory can include a non-volatile storage medium 503 and an internal memory 504.
  • the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
  • the computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform an Android application package upload method.
  • the processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
  • the internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503.
  • the computer program 5032 can cause the processor 502 to perform an Android application package upload method.
  • the network interface 505 is used for network communication, such as sending assigned tasks and the like. It will be understood by those skilled in the art that the structure shown in FIG.
  • 11 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device 500 to which the solution of the present application is applied, and a specific computer device. 500 may include more or fewer components than shown, or some components may be combined, or have different component arrangements.
  • the processor 502 is configured to run a computer program 5032 stored in the memory to implement the following functions: acquiring an automatic packaging script stored on the shared server; and determining, by the automatic packaging script, whether the compiled configuration cache file exists in the local file; If the compiled configuration cache file exists in the local file, read the compiled configuration cache file, and set the current configuration parameters according to the compiled configuration cache file; if the compiled configuration cache file does not exist in the local file, initialize the current configuration parameters; configure the current configuration parameters to In the installation package program, the installation package program is compiled and packaged to obtain the installation package apk file, and the installation package apk file is uploaded to the preset server address.
  • the processor 502 further performs the following operations: acquiring the compiled user information included in the compiled configuration cache file, the compiled version number, the compiling time, and the applicable environment of the installation package; automatically adding the compiled version number 1; set the compilation time to the current system time; set the compiled user information to the current compiled user information; set the applicable environment of the installation package to the applicable environment corresponding to the compiler environment identifier in the automatic packaging script, and obtain the updated compilation.
  • Configure the cache file set the current configuration parameters to the updated build configuration cache file.
  • the processor 502 further performs the following operations: acquiring current compiled user information in the system, setting the compiled user information as current compiled user information; setting the compiled version number to 1; acquiring the current system time, and compiling The time is set to the current system time; obtain the applicable environment corresponding to the compiler environment identifier in the shell script, and set the applicable environment of the installation package to the applicable environment corresponding to the compiler environment identifier; according to the compiled user information, the compiled version number, and the compiled The time, and the applicable environment of the installation package, get the current configuration parameters initialized.
  • the processor 502 further performs the following operations: acquiring a locally stored uncompiled installation package program; compiling the user information included in the current configuration parameter, the compiled version number, the compile time, and the installation
  • the applicable environment of the package corresponds to the folder that is passed to the installation package program.
  • the processor 502 further performs the following operations: acquiring the source code of the installation package program, and the dependent library source code corresponding to the source code; positioning the dependent library source directory, and executing the preset first instruction to generate the dependency library The first automatic package file; locate the root directory of the source code, and execute the preset second instruction to generate the second automatic package file under the source code; in the root directory of the source code, the directory is cleaned and compiled sequentially, and the unsigned apk file is obtained.
  • the signature file corresponding to the storage path set in the shell script is obtained, and the signature file, the first automatic package file, and the second automatic package file are added to the unsigned apk file to obtain the installation package apk file.
  • the embodiment of the computer device shown in FIG. 11 does not constitute a limitation on the specific configuration of the computer device.
  • the computer device may include more or fewer components than illustrated. Or combine some parts, or different parts.
  • the computer device may include only a memory and a processor. In such an embodiment, the structure and function of the memory and the processor are the same as those of the embodiment shown in FIG. 11, and details are not described herein again.
  • the processor 502 may be a central processing unit (CPU), and the processor 502 may also be another general-purpose processor, a digital signal processor (DSP), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc.
  • the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • a storage medium in another embodiment of the present application, is provided.
  • the storage medium can be a non-transitory computer readable storage medium.
  • the storage medium stores a computer program, wherein the computer program includes program instructions.
  • the program instruction is executed by the processor, the Android application package uploading method of the embodiment of the present application is implemented.
  • the storage medium may be an internal storage unit of the aforementioned device, such as a hard disk or a memory of the device.
  • the storage medium may also be an external storage device of the device, such as a plug-in hard disk equipped on the device, a smart memory card (SMC), a secure digital (SD) card, and a flash memory card. (Flash Card), etc.
  • the storage medium may also include both an internal storage unit of the device and an external storage device.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

本申请公开了一种安卓应用打包上传方法、装置、计算机设备及存储介质。该方法包括:获取存储在共享服务器上的自动打包脚本;通过自动打包脚本判断本地文件中是否存在编译配置缓存文件;若本地文件中存在编译配置缓存文件,读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数;若本地文件中不存在编译配置缓存文件,初始化当前配置参数;将当前配置参数配置至安装包程序中,对安装包程序编译打包得到安装包apk文件,将安装包apk文件上传到预先设置的指定服务器地址。该方法实现了打包自动化,无需手动配置打包工具的参数,也无需部署独立服务器,提高了打包效率和成功率。

Description

安卓应用打包上传方法、装置、计算机设备及存储介质
本申请要求于2018年3月2日提交中国专利局、申请号为201810176085.7、申请名称为“安卓应用打包上传方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及安卓应用开发技术领域,尤其涉及一种安卓应用打包上传方法、装置、计算机设备及存储介质。
背景技术
目前,Android应用(即安卓系统中的应用程序)在打包时,一般采用如下两种方案:
1)在本地使用Eclipse或Android Studio等IDE打包,手动修改配置,打完包之后,手动上传到指定服务器地址(其中,Eclipse是一个开放源代码的、基于Java的可扩展开发平台,也即是一个框架和一组服务,用于通过插件组件构建开发环境;Android Studio是一个安卓开发环境,提供了集成的Android开发工具用于开发和调试;IDE,全称是Integrated Development Environment,表示集成开发环境,其用于提供程序开发环境的应用程序,一般包括代码编辑器、编译器、调试器和图形用户界面工具);
2)使用Jenkins(其是一个开源软件项目,是基于Java开发的一种持续集成工具,用于监控持续重复的工作)集成工具打包,需要独立的服务器做配置,流水线执行job(job即数据库中的定时任务)方式打包;
但采用1)中方案时,依赖依靠人工手动配置,容易出错,效率低;
采用2)中方案时,需要独立服务器配置,耗时耗资源,且不够灵活。
发明内容
本申请提供了一种安卓应用打包上传方法、装置、计算机设备及存储介质,旨在解决现有技术中安卓应用打包依赖依靠人工手动配置打包工具的参数或是 配置独立服务器,容易出错,效率低下的问题。
第一方面,本申请提供了一种安卓应用打包上传方法,其包括:获取存储在共享服务器上的自动打包脚本;通过自动打包脚本判断本地文件中是否存在编译配置缓存文件;若本地文件中存在编译配置缓存文件,读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数;若本地文件中不存在编译配置缓存文件,初始化当前配置参数;将当前配置参数配置至安装包程序中,对安装包程序编译打包得到安装包apk文件,将安装包apk文件上传到预先设置的指定服务器地址。
第二方面,本申请提供了一种安卓应用打包上传装置,其包括:
脚本获取单元,用于获取存储在共享服务器上的自动打包脚本;
判断单元,用于通过自动打包脚本判断本地文件中是否存在编译配置缓存文件;
第一配置参数获取单元,用于若本地文件中存在编译配置缓存文件,读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数;
第二配置参数获取单元,用于若本地文件中不存在编译配置缓存文件,初始化当前配置参数;
上传单元,用于将当前配置参数配置至安装包程序中,对安装包程序编译打包得到安装包apk文件,将安装包apk文件上传到预先设置的指定服务器地址。
第三方面,本申请又提供了一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现本申请提供的任一项所述的安卓应用打包上传方法。
第四方面,本申请还提供了一种存储介质,其中所述存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行本申请提供的任一项所述的安卓应用打包上传方法。
本申请提供一种安卓应用打包上传方法、装置、计算机设备及存储介质。该方法实现了打包自动化,无需手动配置打包工具的参数,也无需部署独立服务器,提高了打包效率和成功率。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要 使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种安卓应用打包上传方法的示意流程图;
图2是本申请实施例提供的一种安卓应用打包上传方法的子流程示意图;
图3是本申请实施例提供的一种安卓应用打包上传方法的另一子流程示意图;
图4为本申请实施例提供的一种安卓应用打包上传方法的另一子流程示意图;
图5为本申请实施例提供的一种安卓应用打包上传方法的另一示意流程图;
图6为本申请实施例提供的一种安卓应用打包上传装置的示意性框图;
图7为本申请实施例提供的一种安卓应用打包上传装置的子单元示意性框图;
图8为本申请实施例提供的一种安卓应用打包上传装置的另一子单元示意性框图;
图9为本申请实施例提供的一种安卓应用打包上传装置的另一子单元示意性框图;
图10为本申请实施例提供的一种安卓应用打包上传装置的另一示意性框图;
图11为本申请实施例提供的一种计算机设备的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参阅图1,图1是本申请实施例提供的一种安卓应用打包上传方法的示意流程图。该方法应用于台式电脑、手提电脑、平板电脑等终端中。如图1所示,该方法包括步骤S101~S105。
S101、获取存储在共享服务器上的自动打包脚本。
在本实施例中,选取shell脚本作为自动打包脚本,通过shell脚本判断本地 文件中是否存在编译配置缓存文件、将当前配置参数配置至安装包程序中、以及对安装包程序编译打包和上传服务器。其中,shell脚本与Windows/Dos下的批处理相似,也就是用各类命令预先放入到一个文件中,方便一次性执行的一个程序文件。由于是将自动打包脚本(即shell脚本)存储在共享服务器的项目工程目录下,任何需要拉取shell脚本的终端与共享服务器建立连接后,直接从项目工程目录下拉取shell脚本即可,这样同一时刻多台终端可以分别拉取shell脚本来自动打包apk文件,实现多台终端都可以在同一时刻打包,互不干扰,提高了打包效率。
S102、通过自动打包脚本判断本地文件中是否存在编译配置缓存文件。
在本实施例中,当在系统中检测到指定指令(如sh genProductBetaApk.sh命令,该指令用于激活生成apk打包)被执行时,就开始执行自动打包脚本以启动安卓应用打包。在通过执行shell脚本所启动的安装包打包时,会记录上一次打包的配置缓存文件,配置缓存文件主要包括编译的用户信息(由谁触发编译的)、编译的版本号、编译的时间、及安装包的适用环境(表示安装包是生产环境安装包还是测试环境安装包等)。如果判断存在编译配置缓存文件,则表示无需再次设置配置参数,而直接从编译配置缓存文件中直接获取即可;若不存在编译配置缓存文件,则表示需要初始化当前配置参数。本申请中通过自动打包脚本代替人工判断,自动从本地文件中拉取编译配置缓存文件,提高了配置文件读取效率。
S103、若本地文件中存在编译配置缓存文件,读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数。
如图2所示,该步骤S103中读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数包括以下子步骤:
S1031、获取编译配置缓存文件中所包括编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境;
S1032、将编译的版本号自动加1;
S1033、将编译的时间置为当前系统时间;
S1034、将编译的用户信息置为当前编译用户信息;
S1035、将安装包的适用环境置为自动打包脚本中编译环境标识符对应的适用环境,得到更新后的编译配置缓存文件;
S1036、将当前配置参数置为更新后的编译配置缓存文件。
在一实施例中,自动打包脚本中编译环境标识符为test,将安装包的适用环境置为测试环境安装包;自动打包脚本中编译环境标识符为product,将安装包的适用环境置为生产环境安装包。
在本实施例中,shell脚本每次打包完成后,在编译配置缓存文件都会记录上次打包的时间,Build版本号(一个数字,也即编译的版本号,如23),编译的用户信息等在本地的缓存文件中,下次就直接读取缓存文件在上次的基础上修改编译(如上次编译的版本号是23,程序自动加1,将24作为本次编译的版本号),无需用户手动修改,直接通过自动打包脚本来读取编译配置缓存文件即可。
S104、若本地文件中不存在编译配置缓存文件,初始化当前配置参数。
在一实施例中,如图3所示,所述步骤S104中初始化当前配置参数包括以下子步骤:
S1041、获取系统中当前编译用户信息,将编译的用户信息置为当前编译用户信息;
S1042、将编译的版本号置为1;
S1043、获取当前系统时间,将编译的时间置为当前系统时间;
S1044、获取shell脚本中编译环境标识符对应的适用环境,将安装包的适用环境置为编译环境标识符对应的适用环境;
S1045、根据编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,得到初始化的当前配置参数。
在本实施例中,若本地文件中不存在编译配置缓存文件,则表示需要初始化当前配置参数。与本地文件中存在编译配置缓存文件不同之处在于,需将编译的版本号置为1,也实现了无需用户手动修改,直接通过自动打包脚本来初始化当前配置参数。
S105、将当前配置参数配置至安装包程序中,对安装包程序编译打包得到安装包apk文件,将安装包apk文件上传到预先设置的指定服务器地址。
如图4所示,该步骤S105中将当前配置参数配置至安装包程序中,对安装包程序编译打包得到安装包apk文件包括以下子步骤:
S1051、获取本地存储的未进行编译的安装包程序;
S1052、将当前配置参数中所包括的编译的用户信息、编译的版本号、编译 的时间、及安装包的适用环境,对应传入安装包程序的文件夹。
在本实施例中,由于多台终端可分别拉取共享服务器上的shell脚本来自动打包apk文件,故当前终端拉取了共享服务器上的shell脚本并在本地获得了当前配置参数后,则需将当前配置参数编译到本地待打包且未进行编译的安装包程序中。shell脚本识别了安装包程序中存在当前配置参数,即可进一步进行自动打包。
如图5所示,该步骤S105中对安装包程序编译打包得到安装包apk文件包括以下子步骤(也即步骤S1052之后还包括以下子步骤):
S1053、获取安装包程序的源码,及与源码对应的依赖库源码;
S1054、定位依赖库源码目录,通过执行预设的第一指令,生成依赖库下的第一自动打包文件;
S1055、定位源码的根目录,通过执行预设的第二指令,生成源码下的第二自动打包文件;
S1056、在源码的根目录下依次进行目录清理及编译,得到未签名的apk文件;
S1057、获取shell脚本中设置的存储路径所对应的签名文件,将签名文件、第一自动打包文件、及第二自动打包文件增加至未签名的apk文件,得到安装包apk文件。
在本实施例中,预设的第一指令为android update lib-project-p.-t android-17,其中-p.的意思是在当前根目录下执行,-t android-17的意思是此源码使用android-17 api进行编译,上述参数可根据项目情况自行修改,所有的依赖库都要执行这一步操作。
预设的第二指令为android update project-p.-t android-17,其与第一指令的不同之处在于,第一指令是更新依赖库lib以生成依赖库下的第一自动打包文件,第二指令是更新项目project中的源码以生成第二自动打包文件。
获取shell脚本中设置的存储路径所对应的签名文件中,所述签名文件为META-INF文件,相当于一个信息包,目录中的文件和目录获得Java 2平台的认可与解释,其用来配置应用程序、扩展程序、类加载器和服务manifest.mf文件,在用jar打包时自动生成。通过上述方式,实现了对安装包程序自动编译打包,而且打包过程无需部署独立服务器。
可见,该方法实现了安卓应用打包自动化,无需手动配置打包工具的参数,也无需部署独立服务器,提高了打包效率和成功率。
本申请实施例还提供一种安卓应用打包上传装置,该安卓应用打包上传装置用于执行前述任一项安卓应用打包上传方法。具体地,请参阅图6,图6是本申请实施例提供的一种安卓应用打包上传装置的示意性框图。安卓应用打包上传装置100可以安装于台式电脑、平板电脑、手提电脑、等终端中。
如图6所示,安卓应用打包上传装置100包括脚本获取单元101、判断单元102、第一配置参数获取单元103、第二配置参数获取单元104、及上传单元105。
脚本获取单元101,用于获取存储在共享服务器上的自动打包脚本。
在本实施例中,选取shell脚本作为自动打包脚本,通过shell脚本判断本地文件中是否存在编译配置缓存文件、将当前配置参数配置至安装包程序中、以及对安装包程序编译打包和上传服务器。其中,shell脚本与WindoWs/Dos下的批处理相似,也就是用各类命令预先放入到一个文件中,方便一次性执行的一个程序文件。由于是将自动打包脚本(即shell脚本)存储在共享服务器的项目工程目录下,任何需要拉取shell脚本的终端与共享服务器建立连接后,直接从项目工程目录下拉取shell脚本即可,这样同一时刻多台终端可以分别拉取shell脚本来自动打包apk文件,实现多台终端都可以在同一时刻打包,互不干扰,提高了打包效率。
判断单元102,用于通过自动打包脚本判断本地文件中是否存在编译配置缓存文件。
在本实施例中,当在系统中检测到指定指令(如sh genProductBetaApk.sh命令,该指令用于激活生成apk打包)被执行时,就开始执行自动打包脚本以启动安卓应用打包。在通过执行shell脚本所启动的安装包打包时,会记录上一次打包的配置缓存文件,配置缓存文件主要包括编译的用户信息(由谁触发编译的)、编译的版本号、编译的时间、及安装包的适用环境(表示安装包是生产环境安装包还是测试环境安装包等)。如果判断存在编译配置缓存文件,则表示无需再次设置配置参数,而直接从编译配置缓存文件中直接获取即可;若不存在编译配置缓存文件,则表示需要初始化当前配置参数。本申请中通过自动打包脚本代替人工判断,自动从本地文件中拉取编译配置缓存文件,提高了配置文件读取效率。
第一配置参数获取单元103,用于若本地文件中存在编译配置缓存文件,读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数。
在一实施例中,如图7所示,所述第一配置参数获取单元103包括以下子单元:
本地缓存文件获取单元1301,用于获取编译配置缓存文件中所包括编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境;自增单元1302,用于将编译的版本号自动加1;第一时间设置单元1303,用于将编译的时间置为当前系统时间;第一用户信息设置单元1304,用于将编译的用户信息置为当前编译用户信息;第一环境设置单元1305,用于将安装包的适用环境置为自动打包脚本中编译环境标识符对应的适用环境,得到更新后的编译配置缓存文件;参数更新单元1306,用于将当前配置参数置为更新后的编译配置缓存文件。
在一实施例中,自动打包脚本中编译环境标识符为test,将安装包的适用环境置为测试环境安装包;自动打包脚本中编译环境标识符为product,将安装包的适用环境置为生产环境安装包。
在本实施例中,shell脚本每次打包完成后,在编译配置缓存文件都会记录上次打包的时间,Build版本号(一个数字,也即编译的版本号,如23),编译的用户信息等在本地的缓存文件中,下次就直接读取缓存文件在上次的基础上修改编译(如上次编译的版本号是23,程序自动加1,将24作为本次编译的版本号),无需用户手动修改,直接通过自动打包脚本来读取编译配置缓存文件即可。
第二配置参数获取单元104,用于若本地文件中不存在编译配置缓存文件,初始化当前配置参数。
在一实施例中,如图8所示,所述第二配置参数获取单元104包括以下子单元:第二用户信息设置单元1041,用于获取系统中当前编译用户信息,将编译的用户信息置为当前编译用户信息;版本号初始设置单元1042,用于将编译的版本号置为1;第二时间设置单元1043,用于获取当前系统时间,将编译的时间置为当前系统时间;第二环境设置单元1044,用于获取shell脚本中编译环境标识符对应的适用环境,将安装包的适用环境置为编译环境标识符对应的适用环境;参数初始化单元1045,用于根据编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,得到初始化的当前配置参数。
在本实施例中,若本地文件中不存在编译配置缓存文件,则表示需要初始 化当前配置参数。与本地文件中存在编译配置缓存文件不同之处在于,需将编译的版本号置为1,也实现了无需用户手动修改,直接通过自动打包脚本来初始化当前配置参数。
上传单元105,用于将当前配置参数配置至安装包程序中,对安装包程序编译打包得到安装包apk文件,将安装包apk文件上传到预先设置的指定服务器地址。
如图9所示,所述上传单元105包括以下子单元:安装包获取单元1051,用于获取本地存储的未进行编译的安装包程序;信息传入单元1052,用于将当前配置参数中所包括的编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,对应传入安装包程序的文件夹。
在本实施例中,由于多台终端可分别拉取共享服务器上的shell脚本来自动打包apk文件,故当前终端拉取了共享服务器上的shell脚本并在本地获得了当前配置参数后,则需将当前配置参数编译到本地待打包且未进行编译的安装包程序中。shell脚本识别了安装包程序中存在当前配置参数,即可进一步进行自动打包。
如图10所示,所述上传单元105还包括以下子单元:安装包解析单元1053,用于获取安装包程序的源码,及与源码对应的依赖库源码;第一定位单元1054,用于定位依赖库源码目录,通过执行预设的第一指令,生成依赖库下的第一自动打包文件;第二定位单元1055,用于定位源码的根目录,通过执行预设的第二指令,生成源码下的第二自动打包文件;未签名apk获取单元1056,用于在源码的根目录下依次进行目录清理及编译,得到未签名的apk文件;安装包apk获取单元1057,用于获取shell脚本中设置的存储路径所对应的签名文件,将签名文件、第一自动打包文件、及第二自动打包文件增加至未签名的apk文件,得到安装包apk文件。
在本实施例中,预设的第一指令为android update lib-project-p.-t android-17,其中-p.的意思是在当前根目录下执行,-t android-17的意思是此源码使用android-17 api进行编译,上述参数可根据项目情况自行修改,所有的依赖库都要执行这一步操作。预设的第二指令为android update project-p.-t android-17,其与第一指令的不同之处在于,第一指令是更新依赖库lib以生成依赖库下的第一自动打包文件,第二指令是更新项目project中的源码以生成第二自动打包文 件。
获取shell脚本中设置的存储路径所对应的签名文件中,所述签名文件为META-INF文件,相当于一个信息包,目录中的文件和目录获得Java 2平台的认可与解释,其用来配置应用程序、扩展程序、类加载器和服务manifest.mf文件,在用jar打包时自动生成。通过上述方式,实现了对安装包程序自动编译打包,而且打包过程无需部署独立服务器。
可见,该装置实现了安卓应用打包自动化,无需手动配置打包工具的参数,也无需部署独立服务器,提高了打包效率和成功率。
上述安卓应用打包上传装置可以实现为一种计算机程序的形式,该计算机程序可以在如图11所示的计算机设备上运行。
请参阅图11,图11是本申请实施例提供的一种计算机设备的示意性框图。该计算机设备500设备可以是终端。该终端可以是平板电脑、笔记本电脑、台式电脑、个人数字助理等电子设备。
参阅图11,该计算机设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储器504。
该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032包括程序指令,该程序指令被执行时,可使得处理器502执行一种安卓应用打包上传方法。该处理器502用于提供计算和控制能力,支撑整个计算机设备500的运行。该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行一种安卓应用打包上传方法。该网络接口505用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图11中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现如下功能:获取存储在共享服务器上的自动打包脚本;通过自动打包脚本判断本地文件中是否存在编译配置缓存文件;若本地文件中存在编译配置缓存文件,读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数;若 本地文件中不存在编译配置缓存文件,初始化当前配置参数;将当前配置参数配置至安装包程序中,对安装包程序编译打包得到安装包apk文件,将安装包apk文件上传到预先设置的指定服务器地址。
在一实施例中,处理器502还执行如下操作:获取编译配置缓存文件中所包括编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境;将编译的版本号自动加1;将编译的时间置为当前系统时间;将编译的用户信息置为当前编译用户信息;将安装包的适用环境置为自动打包脚本中编译环境标识符对应的适用环境,得到更新后的编译配置缓存文件;将当前配置参数置为更新后的编译配置缓存文件。
在一实施例中,处理器502还执行如下操作:获取系统中当前编译用户信息,将编译的用户信息置为当前编译用户信息;将编译的版本号置为1;获取当前系统时间,将编译的时间置为当前系统时间;获取shell脚本中编译环境标识符对应的适用环境,将安装包的适用环境置为编译环境标识符对应的适用环境;根据编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,得到初始化的当前配置参数。
在一实施例中,处理器502还执行如下操作:获取本地存储的未进行编译的安装包程序;将当前配置参数中所包括的编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,对应传入安装包程序的文件夹。
在一实施例中,处理器502还执行如下操作:获取安装包程序的源码,及与源码对应的依赖库源码;定位依赖库源码目录,通过执行预设的第一指令,生成依赖库下的第一自动打包文件;定位源码的根目录,通过执行预设的第二指令,生成源码下的第二自动打包文件;在源码的根目录下依次进行目录清理及编译,得到未签名的apk文件;获取shell脚本中设置的存储路径所对应的签名文件,将签名文件、第一自动打包文件、及第二自动打包文件增加至未签名的apk文件,得到安装包apk文件。
本领域技术人员可以理解,图11中示出的计算机设备的实施例并不构成对计算机设备具体构成的限定,在其他实施例中,计算机设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。例如,在一些实施例中,计算机设备可以仅包括存储器及处理器,在这样的实施例中,存储器及处理器的结构及功能与图11所示实施例一致,在此不再赘述。
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central Processing Unit,CPU),该处理器502还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
在本申请的另一实施例中提供一种存储介质。该存储介质可以为非易失性的计算机可读存储介质。该存储介质存储有计算机程序,其中计算机程序包括程序指令。该程序指令被处理器执行时实现本申请实施例的安卓应用打包上传方法。
所述存储介质可以是前述设备的内部存储单元,例如设备的硬盘或内存。所述存储介质也可以是所述设备的外部存储设备,例如所述设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储介质还可以既包括所述设备的内部存储单元也包括外部存储设备。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的设备、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种安卓应用打包上传方法,其特征在于,包括:
    获取存储在共享服务器上的自动打包脚本;
    通过自动打包脚本判断本地文件中是否存在编译配置缓存文件;
    若本地文件中存在编译配置缓存文件,读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数;
    若本地文件中不存在编译配置缓存文件,初始化当前配置参数;
    将当前配置参数配置至安装包程序中,对安装包程序编译打包得到安装包apk文件,将安装包apk文件上传到预先设置的指定服务器地址。
  2. 根据权利要求1所述的安卓应用打包上传方法,其特征在于,所述读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数,包括:
    获取编译配置缓存文件中所包括编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境;
    将编译的版本号自动加1;
    将编译的时间置为当前系统时间;
    将编译的用户信息置为当前编译用户信息;
    将安装包的适用环境置为自动打包脚本中编译环境标识符对应的适用环境,得到更新后的编译配置缓存文件;
    将当前配置参数置为更新后的编译配置缓存文件。
  3. 根据权利要求2所述的安卓应用打包上传方法,其特征在于,所述初始化当前配置参数,包括:
    获取系统中当前编译用户信息,将编译的用户信息置为当前编译用户信息;
    将编译的版本号置为1;
    获取当前系统时间,将编译的时间置为当前系统时间;
    获取shell脚本中编译环境标识符对应的适用环境,将安装包的适用环境置为编译环境标识符对应的适用环境;
    根据编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,得到初始化的当前配置参数。
  4. 根据权利要求2所述的安卓应用打包上传方法,其特征在于,所述将当 前配置参数配置至安装包程序中,包括:
    获取本地存储的未进行编译的安装包程序;
    将当前配置参数中所包括的编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,对应传入安装包程序的文件夹。
  5. 根据权利要求1所述的安卓应用打包上传方法,其特征在于,所述对安装包程序编译打包得到安装包apk文件,包括:
    获取安装包程序的源码,及与源码对应的依赖库源码;
    定位依赖库源码目录,通过执行预设的第一指令,生成依赖库下的第一自动打包文件;
    定位源码的根目录,通过执行预设的第二指令,生成源码下的第二自动打包文件;
    在源码的根目录下依次进行目录清理及编译,得到未签名的apk文件;
    获取shell脚本中设置的存储路径所对应的签名文件,将签名文件、第一自动打包文件、及第二自动打包文件增加至未签名的apk文件,得到安装包apk文件。
  6. 一种安卓应用打包上传装置,其特征在于,包括:
    脚本获取单元,用于获取存储在共享服务器上的自动打包脚本;
    判断单元,用于通过自动打包脚本判断本地文件中是否存在编译配置缓存文件;
    第一配置参数获取单元,用于若本地文件中存在编译配置缓存文件,读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数;
    第二配置参数获取单元,用于若本地文件中不存在编译配置缓存文件,初始化当前配置参数;
    上传单元,用于将当前配置参数配置至安装包程序中,对安装包程序编译打包得到安装包apk文件,将安装包apk文件上传到预先设置的指定服务器地址。
  7. 根据权利要求6所述的安卓应用打包上传装置,其特征在于,所述第一配置参数获取单元,包括:
    本地缓存文件获取单元,用于获取编译配置缓存文件中所包括编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境;
    自增单元,用于将编译的版本号自动加1;
    第一时间设置单元,用于将编译的时间置为当前系统时间;
    第一用户信息设置单元,用于将编译的用户信息置为当前编译用户信息;
    第一环境设置单元,用于将安装包的适用环境置为自动打包脚本中编译环境标识符对应的适用环境,得到更新后的编译配置缓存文件;
    参数更新单元,用于将当前配置参数置为更新后的编译配置缓存文件。
  8. 根据权利要求6所述的安卓应用打包上传装置,其特征在于,所述上传单元,包括:
    安装包解析单元,用于获取安装包程序的源码,及与源码对应的依赖库源码;
    第一定位单元,用于定位依赖库源码目录,通过执行预设的第一指令,生成依赖库下的第一自动打包文件;
    第二定位单元,用于定位源码的根目录,通过执行预设的第二指令,生成源码下的第二自动打包文件;
    未签名apk获取单元,用于在源码的根目录下依次进行目录清理及编译,得到未签名的apk文件;
    安装包apk获取单元,用于获取shell脚本中设置的存储路径所对应的签名文件,将签名文件、第一自动打包文件、及第二自动打包文件增加至未签名的apk文件,得到安装包apk文件。
  9. 根据权利要求7所述的安卓应用打包上传装置,其特征在于,所述第二配置参数获取单元包括以下子单元:
    第二用户信息设置单元,用于获取系统中当前编译用户信息,将编译的用户信息置为当前编译用户信息;
    版本号初始设置单元,用于将编译的版本号置为1;
    第二时间设置单元,用于获取当前系统时间,将编译的时间置为当前系统时间;
    第二环境设置单元,用于获取shell脚本中编译环境标识符对应的适用环境,将安装包的适用环境置为编译环境标识符对应的适用环境;
    参数初始化单元,用于根据编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,得到初始化的当前配置参数。
  10. 根据权利要求7所述的安卓应用打包上传装置,其特征在于,所述所述 上传单元,包括:
    安装包获取单元,用于获取本地存储的未进行编译的安装包程序;
    信息传入单元,用于将当前配置参数中所包括的编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,对应传入安装包程序的文件夹。
  11. 一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现以下步骤:
    获取存储在共享服务器上的自动打包脚本;
    通过自动打包脚本判断本地文件中是否存在编译配置缓存文件;
    若本地文件中存在编译配置缓存文件,读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数;
    若本地文件中不存在编译配置缓存文件,初始化当前配置参数;
    将当前配置参数配置至安装包程序中,对安装包程序编译打包得到安装包apk文件,将安装包apk文件上传到预先设置的指定服务器地址。
  12. 根据权利要求11所述的计算机设备,其特征在于,所述读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数,包括:
    获取编译配置缓存文件中所包括编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境;
    将编译的版本号自动加1;
    将编译的时间置为当前系统时间;
    将编译的用户信息置为当前编译用户信息;
    将安装包的适用环境置为自动打包脚本中编译环境标识符对应的适用环境,得到更新后的编译配置缓存文件;
    将当前配置参数置为更新后的编译配置缓存文件。
  13. 根据权利要求12所述的计算机设备,其特征在于,所述初始化当前配置参数,包括:
    获取系统中当前编译用户信息,将编译的用户信息置为当前编译用户信息;
    将编译的版本号置为1;
    获取当前系统时间,将编译的时间置为当前系统时间;
    获取shell脚本中编译环境标识符对应的适用环境,将安装包的适用环境置 为编译环境标识符对应的适用环境;
    根据编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,得到初始化的当前配置参数。
  14. 根据权利要求12所述的计算机设备,其特征在于,所述将当前配置参数配置至安装包程序中,包括:
    获取本地存储的未进行编译的安装包程序;
    将当前配置参数中所包括的编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,对应传入安装包程序的文件夹。
  15. 根据权利要求11所述的计算机设备,其特征在于,所述对安装包程序编译打包得到安装包apk文件,包括:
    获取安装包程序的源码,及与源码对应的依赖库源码;
    定位依赖库源码目录,通过执行预设的第一指令,生成依赖库下的第一自动打包文件;
    定位源码的根目录,通过执行预设的第二指令,生成源码下的第二自动打包文件;
    在源码的根目录下依次进行目录清理及编译,得到未签名的apk文件;
    获取shell脚本中设置的存储路径所对应的签名文件,将签名文件、第一自动打包文件、及第二自动打包文件增加至未签名的apk文件,得到安装包apk文件。
  16. 一种存储介质,其特征在于,所述存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行以下操作:
    获取存储在共享服务器上的自动打包脚本;
    通过自动打包脚本判断本地文件中是否存在编译配置缓存文件;
    若本地文件中存在编译配置缓存文件,读取编译配置缓存文件,并根据编译配置缓存文件设置当前配置参数;
    若本地文件中不存在编译配置缓存文件,初始化当前配置参数;
    将当前配置参数配置至安装包程序中,对安装包程序编译打包得到安装包apk文件,将安装包apk文件上传到预先设置的指定服务器地址。
  17. 根据权利要求16所述的存储介质,其特征在于,所述读取编译配置缓存 文件,并根据编译配置缓存文件设置当前配置参数,包括:
    获取编译配置缓存文件中所包括编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境;
    将编译的版本号自动加1;
    将编译的时间置为当前系统时间;
    将编译的用户信息置为当前编译用户信息;
    将安装包的适用环境置为自动打包脚本中编译环境标识符对应的适用环境,得到更新后的编译配置缓存文件;
    将当前配置参数置为更新后的编译配置缓存文件。
  18. 根据权利要求17所述的存储介质,其特征在于,所述所述初始化当前配置参数,包括:
    获取系统中当前编译用户信息,将编译的用户信息置为当前编译用户信息;
    将编译的版本号置为1;
    获取当前系统时间,将编译的时间置为当前系统时间;
    获取shell脚本中编译环境标识符对应的适用环境,将安装包的适用环境置为编译环境标识符对应的适用环境;
    根据编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,得到初始化的当前配置参数。
  19. 根据权利要求17所述的存储介质,其特征在于,所述将当前配置参数配置至安装包程序中,包括:
    获取本地存储的未进行编译的安装包程序;
    将当前配置参数中所包括的编译的用户信息、编译的版本号、编译的时间、及安装包的适用环境,对应传入安装包程序的文件夹。
  20. 根据权利要求16所述的存储介质,其特征在于,所述对安装包程序编译打包得到安装包apk文件,包括:
    获取安装包程序的源码,及与源码对应的依赖库源码;
    定位依赖库源码目录,通过执行预设的第一指令,生成依赖库下的第一自动打包文件;
    定位源码的根目录,通过执行预设的第二指令,生成源码下的第二自动打包文件;
    在源码的根目录下依次进行目录清理及编译,得到未签名的apk文件;
    获取shell脚本中设置的存储路径所对应的签名文件,将签名文件、第一自动打包文件、及第二自动打包文件增加至未签名的apk文件,得到安装包apk文件。
PCT/CN2018/085250 2018-03-02 2018-05-02 安卓应用打包上传方法、装置、计算机设备及存储介质 Ceased WO2019165705A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810176085.7A CN108418717B (zh) 2018-03-02 2018-03-02 安卓应用打包上传方法、装置、计算机设备及存储介质
CN201810176085.7 2018-03-02

Publications (1)

Publication Number Publication Date
WO2019165705A1 true WO2019165705A1 (zh) 2019-09-06

Family

ID=63129610

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/085250 Ceased WO2019165705A1 (zh) 2018-03-02 2018-05-02 安卓应用打包上传方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN108418717B (zh)
WO (1) WO2019165705A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114816498A (zh) * 2022-04-19 2022-07-29 中国工商银行股份有限公司 资源文件管理方法、装置、设备、存储介质和程序产品
CN115373682A (zh) * 2022-08-18 2022-11-22 中国建设银行股份有限公司 软件安装包生成方法、装置和服务器

Families Citing this family (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110888639A (zh) * 2018-09-10 2020-03-17 北京京东尚科信息技术有限公司 一种业务代码编译打包方法和装置
CN110895471B (zh) * 2018-09-12 2025-05-16 北京京东尚科信息技术有限公司 安装包生成方法、装置、介质及电子设备
CN109120641B (zh) * 2018-09-28 2022-09-09 中国平安财产保险股份有限公司 报表自动上传方法、装置、计算机设备及存储介质
CN109558137B (zh) * 2018-11-09 2021-01-26 深圳市海勤科技有限公司 客户订单管理软件配置优化方法
CN109656572A (zh) * 2018-11-14 2019-04-19 深圳壹账通智能科技有限公司 安装包的打包方法及装置、计算机设备、存储介质
CN109857454B (zh) * 2018-12-15 2023-07-18 中国平安人寿保险股份有限公司 安装包生成与缓存方法、装置、电子设备及存储介质
CN109710265A (zh) * 2018-12-28 2019-05-03 北京金山安全软件有限公司 一种软件安装包的获取方法、装置及电子设备
CN110580165A (zh) * 2019-07-24 2019-12-17 深圳壹账通智能科技有限公司 软件程序发布方法、装置、计算机设备和存储介质
CN110531962B (zh) * 2019-08-06 2023-11-17 上海连尚网络科技有限公司 小程序的开发处理方法、设备及计算机可读存储介质
CN111049889B (zh) * 2019-12-04 2022-07-08 车智互联(北京)科技有限公司 一种静态资源上传方法、装置、集成服务器和系统
CN111078277A (zh) * 2019-12-20 2020-04-28 上海米哈游天命科技有限公司 一种装包系统、装包方法及存储介质
CN111240689B (zh) * 2020-01-13 2023-08-01 广州虎牙科技有限公司 应用程序的构建方法、装置、设备及存储介质
CN111414308B (zh) * 2020-03-26 2023-08-22 抖音视界有限公司 应用程序包的处理方法和应用程序的运行方法、装置
CN111459541B (zh) * 2020-04-09 2023-03-14 武汉联影医疗科技有限公司 应用程序的打包方法、装置、计算机设备和存储介质
CN111552524B (zh) * 2020-05-06 2023-10-13 Oppo(重庆)智能科技有限公司 一种插件加载方法、装置及计算机可读存储介质
CN113741951B (zh) * 2020-05-29 2024-06-18 北京沃东天骏信息技术有限公司 本地打包方法和装置
CN111782730B (zh) * 2020-07-09 2021-07-06 腾讯科技(深圳)有限公司 一种文件上传方法、装置及存储介质
CN112947949B (zh) * 2020-09-22 2024-07-23 深圳市明源云科技有限公司 应用程序安装方法、装置及电子设备
CN112540768B (zh) * 2020-12-29 2025-01-24 Oppo广东移动通信有限公司 文件处理方法、装置、服务器、电子设备及存储介质
CN112612550B (zh) * 2020-12-30 2024-11-12 北京世纪互联宽带数据中心有限公司 一种文件配置方法及装置
CN113434157A (zh) * 2021-06-30 2021-09-24 青岛海尔科技有限公司 基于shell脚本的前端工程部署方法及装置
CN115951924A (zh) * 2021-10-09 2023-04-11 腾讯科技(深圳)有限公司 一种共享程序的生成方法及装置、计算机设备和存储介质
CN113986267B (zh) * 2021-10-27 2024-11-08 浪潮网络科技(山东)有限公司 一种sdn控制器安装的部署方法、设备及介质
CN114090063B (zh) * 2021-11-11 2025-09-19 北京百度网讯科技有限公司 对应用进行打包的方法、装置、电子设备及介质
CN113961474B (zh) * 2021-11-19 2024-11-08 深圳前海移联科技有限公司 一种基于自动化内部的分发测试方法、装置和计算机设备
CN114564230B (zh) * 2022-02-23 2024-01-16 北京布局未来科技发展有限公司 鸿蒙系统的一键上传实现方法、装置、电子设备及介质
CN114661374A (zh) * 2022-03-16 2022-06-24 无线生活(杭州)信息科技有限公司 加载typescript配置文件的方法及装置
CN114610318B (zh) * 2022-03-18 2025-03-18 平安国际智慧城市科技股份有限公司 安卓应用程序的打包方法、装置、设备及存储介质
CN114860213A (zh) * 2022-05-11 2022-08-05 北京字跳网络技术有限公司 一种应用程序包生成方法、装置、设备及介质
CN115826987A (zh) * 2022-12-05 2023-03-21 深圳太极数智技术有限公司 应用软件的打包上线方法、装置、终端设备和存储介质
CN118535179A (zh) * 2024-05-31 2024-08-23 广东保伦电子股份有限公司 一种安卓应用程序运维方法、装置、终端设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104516755A (zh) * 2013-10-08 2015-04-15 博雅网络游戏开发(深圳)有限公司 安装包生成方法和装置
CN105468428A (zh) * 2015-12-04 2016-04-06 上海斐讯数据通信技术有限公司 一种安卓源代码编译方法及系统
US20170337372A1 (en) * 2016-05-18 2017-11-23 Trustlook Inc. Maliciousness Categorization of Application Packages Based on Dynamic Analysis

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605505A (zh) * 2013-10-11 2014-02-26 索尔思光电(成都)有限公司 软件配置文件的共享方法
CN104572237B (zh) * 2015-01-19 2017-12-12 上海动联信息技术股份有限公司 一种UKey安装包自动快速生成系统及其方法
CN106155751B (zh) * 2016-08-02 2019-12-17 传线网络科技(上海)有限公司 应用打包发布方法及装置
CN107391155A (zh) * 2017-07-31 2017-11-24 北京北信源软件股份有限公司 一种打包方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104516755A (zh) * 2013-10-08 2015-04-15 博雅网络游戏开发(深圳)有限公司 安装包生成方法和装置
CN105468428A (zh) * 2015-12-04 2016-04-06 上海斐讯数据通信技术有限公司 一种安卓源代码编译方法及系统
US20170337372A1 (en) * 2016-05-18 2017-11-23 Trustlook Inc. Maliciousness Categorization of Application Packages Based on Dynamic Analysis

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114816498A (zh) * 2022-04-19 2022-07-29 中国工商银行股份有限公司 资源文件管理方法、装置、设备、存储介质和程序产品
CN115373682A (zh) * 2022-08-18 2022-11-22 中国建设银行股份有限公司 软件安装包生成方法、装置和服务器

Also Published As

Publication number Publication date
CN108418717B (zh) 2020-04-07
CN108418717A (zh) 2018-08-17

Similar Documents

Publication Publication Date Title
WO2019165705A1 (zh) 安卓应用打包上传方法、装置、计算机设备及存储介质
WO2019169726A1 (zh) 应用打包上传方法、装置、计算机设备及存储介质
US9405529B2 (en) Designing and cross-configuring software
US20210232388A1 (en) Software pipeline configuration
WO2020063252A1 (zh) 一种实现多版本依赖隔离的方法和装置
US10409567B2 (en) Trimming unused dependencies using package graph and module graph
WO2018045733A1 (zh) 一种安卓系统so文件的加载方法及电子设备
CN113885849B (zh) 基于工业互联网平台的应用开发方法、装置及终端设备
CN113835713B (zh) 源码包下载方法、装置、计算机设备和存储介质
WO2019090994A1 (zh) 测试脚本自动化执行方法、装置、设备以及存储介质
CN104572235A (zh) 一种可加载内核模块的编译方法和装置
WO2022156277A1 (zh) 一种应用程序安装方法、装置、计算设备及可读存储介质
CN111782474A (zh) 日志处理方法、装置、电子设备和介质
CN110471663A (zh) 一种代码编译方法、装置及电子设备
CN114003269A (zh) 组件处理方法、装置、电子设备及存储介质
CN104536788A (zh) 使应用的安装自动化的系统和方法
EP3336689B1 (en) Imposing a common build system for services from disparate sources
CN116303099B (zh) 自动化测试环境跨平台快速部署方法、装置、介质及设备
US10514940B2 (en) Virtual application package reconstruction
CN112947948B (zh) 应用服务的部署方法及装置
CN111694578A (zh) 一种获取基于WinSW的系统安装包的方法及装置
CN114579140A (zh) 项目部署方法、装置、电子设备及计算机可读存储介质
US20200142689A1 (en) System And Methods for Patch Management
CN120163125A (zh) Pdf文件的预览组件构建方法、pdf文件的预览方法、计算机可读存储介质及电子设备
CN110321138A (zh) 一种程序更新、迁移方法和装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18908208

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 01.12.20)

122 Ep: pct application non-entry in european phase

Ref document number: 18908208

Country of ref document: EP

Kind code of ref document: A1