Application installation method and device, electronic equipment and storage medium
By parsing and modifying the version information of the application installation package and using a preset configuration file to adapt it to lower version systems, the problem of Android system version limitations is solved, enabling the installation of higher version applications on lower version devices and enhancing the usability and stability of the devices.
Patent Information
- Application Number
- CN202210625292.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-06-02
AI Technical Summary
Android system version limitations prevent older devices from installing newer apps, hindering their widespread adoption.
By parsing the version information of the application installation package and modifying the version information according to the preset configuration file, it is made compatible with low-version systems. A blocking version number is added to bypass upgrade detection and ensure successful application installation.
This allows devices with older system versions to install newer applications, enhancing device availability, avoiding automatic upgrade prompts, and improving system flexibility and stability.
Smart Images

Figure CN114895928B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal software application installation, and in particular to an application installation method and device, an electronic device and a storage medium. BACKGROUND
[0002] The version number of an Android system is increased with continuous updating of the Android system. Each application running on the Android system is usually configured with a minimum version number of a runnable Android system, and cannot be installed on an Android system lower than the configured minimum version number. However, with the updating of the application, the development of new applications and the updating of the Android system, the configured minimum version number of the runnable Android system is also increased.
[0003] Under the default design of the Android system, when an application is installed, if it is detected that the current version number of the Android system is lower than the configured minimum version number of the runnable Android system of the application to be installed, an installation error occurs when the application is installed, so that the Android system cannot install the application. Even if the application is pre-installed in the system, the installation cannot be completed. For example, some 4.0 platform Android systems include projectors, set-top boxes and other products, which cannot install some mainstream online media playback software due to version restrictions, resulting in the products being unable to be promoted. SUMMARY
[0004] The present application provides an application installation method and device, an electronic device and a storage medium, which enable a low-version system to install a high-version application and enhance the usability of a low-version system device.
[0005] In one aspect of the present application, an application installation method is provided. The method comprises the steps of: obtaining version information of an application installation package; obtaining a preset configuration file and modifying the version information according to the configuration file; and installing the application installation package according to the modified version information.
[0006] In some embodiments, modifying the version information according to the configuration file comprises: if it is determined that the version information matches the configuration file, modifying the version information according to the configuration file.
[0007] In some embodiments, the configuration file comprises an application version range, and the application installation method further comprises: sequentially obtaining the application installation package of different version information; and if it is determined that an application generated by the application installation package satisfies a preset running condition, adding the version information corresponding to the application installation package to the application version range.
[0008] In some embodiments, the configuration file comprises a blocking version number, and modifying the version information according to the configuration file comprises: adding an original field in the application installation package; copying content of the version information to the original field; and replacing the version information with the blocking version number.
[0009] In some embodiments, the blocking version number and the version information both comprise version numbers, and replacing the version information with the blocking version number comprises: replacing the version number of the version information with the version number of the blocking version number, the version number of the blocking version number being a preset extreme value.
[0010] In some embodiments, the application installation method further comprises: obtaining a setting instruction, and modifying and saving the configuration file according to the setting instruction.
[0011] In some embodiments, the application installation method further comprises: setting the configuration file under a system directory; and reading and storing the configuration file if the system is powered on.
[0012] In some embodiments, the version information comprises minimum executable version number information, and modifying the version information according to the configuration file comprises: obtaining a preset value according to the configuration file; and modifying the minimum executable version number information to the preset value.
[0013] In another aspect of the present application, an application installation device is provided. The device comprises: an obtaining module configured to obtain version information of an application installation package; a configuration module configured to obtain a preset configuration file, and modify the version information according to the configuration file; and an installation module configured to install the application installation package according to the modified version information.
[0014] In still another aspect of the present application, an electronic device is provided. The electronic device comprises a memory configured to store a computer program; and a processor configured to execute the computer program to perform the above-mentioned application installation method.
[0015] In yet another aspect of the present application, a computer readable medium is provided. The medium has a computer program stored thereon, the computer program being executed by a processor to implement the above-mentioned application installation method.
[0016] According to the embodiment of the present application, when the system receives the application installation instruction and the application installation package, the version information corresponding to the application installation package is obtained by analyzing the application installation package, and the modified version information is obtained according to the preset configuration file, so that the interval of the system version number adapted by the modified version information changes, so that the system judges that the current system version number can adapt to the application installation package to be installed, and installs the application installation package to be installed, thereby realizing the effect that the low-version system can install the high-version application, and enhancing the usability of the low-version system device. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 a flowchart of an application installation method according to an embodiment of the present application;
[0018] Figure 2 a flowchart of another step of an application installation method according to an embodiment of the present application;
[0019] Figure 3 a flowchart of application version range acquisition in white list information of an application installation method according to an embodiment of the present application;
[0020] Figure 4 a structural schematic diagram of an application installation device according to an embodiment of the present application;
[0021] Figure 5 a structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to describe the technical content, the achieved purposes and effects of the present application in detail, the following will be described in combination with the embodiments and the accompanying drawings.
[0023] In the prior art, an application is configured with a minimum version number of a runnable Android system. If the version number of the Android system in the device is lower than the configured minimum version number of the Android system, an installation error occurs when the application is installed. However, sometimes, the configuration is usually set to be higher for safety, that is, the application can actually run on a lower system, but cannot be successfully installed.
[0024] In order to solve at least the above technical problems, the present disclosure provides an application installation method. According to the present disclosure, when an application installation instruction is received and an application installation package is obtained, the version information of the application installation package is obtained by analyzing the application installation package, and a preset configuration file is obtained, whether the application installation package can be successfully run is judged according to the configuration file, and if so, the version information is modified to enable the application to be successfully installed. In this way, according to the embodiment of the present disclosure, the effect that the high-version application can be installed in the low-version system can be realized, and the usability of the low-version system device is enhanced.
[0025] Hereinafter, the technical solutions according to the present disclosure will be described with reference to specific embodiments and in conjunction with the accompanying drawings.
[0026] Figure 1 is a flowchart showing an application installation method 100 according to an embodiment of the present disclosure. Referring to Figure 1 , the method 100 includes the following steps 102 to 106.
[0027] At step 102, the version information of the application installation package is acquired.
[0028] At step 104, the preset configuration file is acquired, and the version information is modified according to the configuration file. In some embodiments, the step of modifying the version information according to the configuration file includes the following steps: querying whether the version information matches the configuration file, and if so, performing the step of modifying the version information according to the configuration file. In this way, the application installation package that can be adapted to the current system version is selected by the configuration file, and the application installation package whose version information does not match the configuration file is removed, so that the application installation package filtered by the configuration file is adapted to the current system version, thereby improving the stability of the system.
[0029] In some embodiments, the configuration file includes an application version range; and the step of acquiring the preset configuration file includes the following steps: sequentially acquiring and installing the application installation package of different version information; determining whether the application generated by the application installation package satisfies a preset running condition, and if so, adding the version information corresponding to the application installation package to the application version range. In this way, the application installation package of different version information is sequentially installed on the system, and the version information of the application installation package that meets the running condition is generated into the application version range, thereby ensuring that the application installation package matched with the configuration file can run under the current system version.
[0030] In some embodiments, the configuration file includes a blocked version number; and the step of modifying the version information according to the configuration file includes the following steps: adding an original field in the application installation package; copying the content of the version information to the original field; and replacing the version information with the blocked version number. In this way, the application version information obtained by the application itself or other application update software is the replaced blocked version number, which bypasses the application upgrade detection, thereby avoiding the situation of automatic application upgrade or pop-up upgrade prompt.
[0031] In some embodiments, the blocking version number and the version information both comprise version numbers; replacing the version information with the blocking version number comprises: replacing the version number of the version information with the version number of the blocking version number; and the version number of the blocking version number is a preset extreme value. In this way, the version number of the blocking version number is far greater than the version number of the version information, and the application is prevented from being automatically upgraded or prompted to upgrade.
[0032] In some embodiments, the setting instruction is obtained, and the configuration file is modified and saved according to the setting instruction. In this way, the user can modify the configuration file by the setting instruction, and the flexibility of the system is improved.
[0033] In some embodiments, before the preset configuration file is obtained, the configuration file is set in a system directory; and it is determined whether the system is powered on, and if yes, the configuration file is read and stored. In this way, the configuration file is more convenient to modify on the system.
[0034] In some embodiments, the version information comprises minimum executable version number information; and the version information is modified according to the configuration file, comprising: obtaining a preset value according to the configuration file, and modifying the minimum executable version number information to the preset value. In this way, the minimum executable version number information is lower than the current version information of the system, so that the system can install an application installation package higher than the version information of the system.
[0035] In step 106, the application installation package is installed according to the modified version information.
[0036] In the following, the application scenario of the technical solution according to the embodiment of the application in a projector with an Android system version of 4.4 will be described by an example. In the example, the sdk version number of the Android system in the projector is 19, and the application version number versionName of a certain online video software is 10.2.1 (the corresponding versionCode is 503 obtained by a pc tool), that is, the minimum system installation sdk version number required by the online video software is 23. Since the Android system in the projector is lower than the minimum system installation sdk version number of the online video software, the projector cannot install the online video software. However, by the steps in the embodiment, the online video software with the minimum system installation sdk version number of 23 can be installed in the projector with the Android system version of 4.4.
[0037] Figure 2 is another step flowchart 200 showing the application installation method according to the embodiment of the application. As shown in Figure 2 the method comprises the following steps 202 to 242.
[0038] At step 202, the installation application executes a native package manager service, and initiates an unpacking request to a package parser.
[0039] At step 204, the package parser parses the package name, and performs a whitelist query according to the package name.
[0040] At step 206, it is determined whether the package name is a whitelisted application and the version number falls within the whitelisted range according to the returned whitelist of the specified package name.
[0041] At step 208, if the application installation package is a whitelisted application and the version number falls within the whitelisted range, the minSdkversion is modified to 0.
[0042] In step 210, the packageinfo (installation package information) and the applicationinfo (application information) are modified; the field originversioncode (original version code information) = versionCode (version code information) = displayVersionCode (displayed version code information) in the whitelist is added; and the field originversionname (original version character information) = versionName (version character information) = displayVersionName (displayed version character information) in the whitelist is added. Specifically, the PackageInfo.java and the ApplicationInfo.java of the system framework framework themselves carry the fields versionName and versionCode (wherein the versionName is a version number character used for display, such as 10.2.1, 20220501sp, and happy_version; and the versionCode is an integer, and since it is an integer, the value is usually accumulated for upgrading, such as 1, 2, 3, 503, and 504, and the versionName and the versionCode do not have a corresponding relationship, and for different apks, the values are different, which can be viewed by using some pc tools to view the versionName and the versionCode of the apks), and the fields originversioncode and originversionname are added in the framework; that is, in the original process of assigning the versionName and the versionCode of the packageinfo and the applicationinfo by the packagemanagerservice, the original assignment is directly replaced by the new value of the whitelist versionName and versionCode; and the original value is directly assigned to the originversionname and the originversioncode for the settings application to display.
[0043] In step 212, the normal installation process is continued. Wherein, the application itself or other non-setting applications obtain the modified versionCode as the version information, and will not be upgraded. If the application installation package does not meet the condition that the package name is whether a whitelist application and the version number falls within the whitelist range, the installation fails is prompted.
[0044] In step 214, the Android system starts the data service after booting. Specifically, according to the actual effect of a specific application on the machine, an initial white list configuration xml file (i.e. the above-mentioned configuration file) is pre-installed in the system's system / user / share / directory. For example, the xml places 2 white list applications: com.aaa.bbb and com.aaa.ccc. The xml content is as follows:
[0045]
[0046]
[0047] Among them, one <package>< / package> is configured for an application. The package name is the application package name, and the application will have a version number. Different version numbers correspond to different versionCode, and versionCode falls between minVersionCode and maxVersionCode (including the two end versions of min and max) to take effect the white list effect. displayVersionName is the version number to be displayed and the modified versionCode. When booting, the PackageManager service starts, which will parse the xml and read the above information for judgment when installing. The com.aaa.ccc segment example configuration is equivalent to configuring that only the minimum installation limit is opened, but the upgrade detection is not controlled; displayVersionCode=0 is a reserved value, and setting it to 0 value represents retaining the original app version code unchanged, without replacing the version code processing. If there is a new software version later, the update behavior will be detected.
[0048] In step 216, the pre-configured items are parsed to obtain the current configuration version number, application package name, minimum application version range, maximum application version range, and version number to be displayed.
[0049] In step 218, it is judged whether the current storage version number of the Settingprovider is less than the configuration version number.
[0050] In step 220, if not, no processing is performed.
[0051] In step 222, if yes, the storage is updated according to the configuration file information passed, and the current storage version number is updated.
[0052] In step 224, the white list is stored. That is, the package name to be processed, the version range allowed to install, and the version information (versionName and versionCode two fields) to be displayed after modification are stored.
[0053] At step 226, the configuration process is ended.
[0054] At step 228, the user opens the setting application.
[0055] At step 230, the user clicks the add item "low version application configuration" and queries all the white list.
[0056] At step 232, all the returned white lists are received and the current configuration is displayed according to the white list information.
[0057] At step 234, the user modifies the current configuration.
[0058] At step 236, the user clicks the application information and queries the application version number.
[0059] At step 238, the package info and the application info are obtained.
[0060] At step 240, the default display version name is changed to the origin version name.
[0061] At step 242, the setting process is ended.
[0062] Figure 3 FIG. 300 is a flowchart showing the application version range acquisition in the white list information according to the application installation method of an embodiment of the present application. It includes the following steps 302 to 304.
[0063] At step 302, the application installation package of different versions is obtained in sequence and installed. For example, if the online video software includes 10.2.1 to 10.2.15 versions, the different versions of the online video software are forcibly installed on the system in sequence. Or, a relatively low version is installed and the software is upgraded.
[0064] At step 304, it is judged whether the application generated by the application installation package meets the preset running condition. If yes, the version information corresponding to the application installation package is added to the application version range. For example, after the online video software is upgraded to, for example, 10.2.8 (versionCode is 510), the running appears to be stuck and there are abnormally large problems, the version is not suitable for the Android system 4.4 version running. Therefore, the versions from 10.2.1 to 10.2.7 (versionCode is 503-509) are allowed to bypass the limitation to be installed, but the software cannot be upgraded or installed to the version after 10.2.7.
[0065] According to another aspect of the present application, Figure 4is a block diagram illustrating an application installation device 400 according to an embodiment of the present application. Referring to Figure Figure 4 The application installation device 400 comprises an obtaining module 402 configured to obtain version information of an application installation package; a configuring module 404 configured to obtain a preset configuration file and modify the version information according to the configuration file; and an installation module 406 configured to install the application installation package according to the modified version information.
[0066] According to yet another aspect of the present application, Figure 5 is a schematic diagram illustrating an application installation device 500 according to an embodiment of the present application. Referring to Figure Figure 5 The electronic device 500 comprises a memory 502, a processor 504, and a computer program stored in the memory and executable on the processor, and the processor implements each step of the application installation method as described above when executing the computer program.
[0067] According to yet another aspect of the present application, a computer readable medium is provided. The computer readable medium stores a computer program executable by a processor to implement the application installation method as described above.
[0068] To sum up, the application installation method, device, equipment and storage medium provided by the present application, when the system receives an application installation instruction and an application installation package, the version information corresponding to the application installation package is obtained by analyzing the application installation package, and the modified version information is modified according to the preset configuration file, so that the modified version information is adapted to the change of the installable system version number interval, so that the system can judge that the current system version number can adapt to the application installation package to be installed, and the application installation package to be installed is installed, the effect that the low version system can install the high version application is realized, and the usability of the low version system equipment is enhanced. Among them, by adding an original field in the application installation package, the content of the version information is copied to the original field, and the version information is replaced by the blocking version number, so that the application version information obtained by the application itself or other application update software is the replaced blocking version number, bypassing the application upgrade detection, avoiding the application automatic upgrade or pop-up upgrade prompt.
[0069] The above description is only an embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent transformation or direct or indirect application in related technical fields according to the content of the present application specification and drawings is also included in the patent protection scope of the present application.
Claims
1. An application installation method, characterized in that, include: Get the version information of the application installation package; The application installation packages with different version information are obtained sequentially, and the application installation packages with different version information are forcibly installed on the system sequentially. If it is determined that the application generated by the application installation package meets the preset running conditions, then the version information corresponding to the application installation package will be added to the application version range; Obtain a preset configuration file and modify the version information according to the configuration file, wherein the configuration file includes the application version range; as well as Install the application installation package according to the modified version information. The configuration file includes a blocking version number, and both the blocking version number and the version information include a version number. Modifying the version information according to the configuration file includes: adding an original field to the application installation package; copying the content of the version information to the original field; and replacing the version number of the version information with the version number of the blocked version number, wherein the version number of the blocked version number is a preset extreme value.
2. The application installation method according to claim 1, characterized in that, Modifying the version information according to the configuration file includes: If it is determined that the version information matches the configuration file, then the version information is modified according to the configuration file.
3. The application installation method according to claim 1, characterized in that, Also includes: Obtain the setting instructions, modify and save the configuration file according to the setting instructions.
4. The application installation method according to claim 1, characterized in that, Also includes: Set the configuration file in the system directory; as well as If the system is powered on, the configuration file is read and stored.
5. The application installation method according to claim 1, characterized in that, The version information includes the minimum executable version number, and modifying the version information according to the configuration file includes: Obtain preset values according to the configuration file; and Modify the minimum executable version number information to the preset value.
6. An application installation device, characterized in that, include: The acquisition module is configured to acquire the version information of the application installation package, and sequentially acquire the application installation packages with different version information; The configuration module is configured to sequentially force the installation of application packages with different version information on the system. If it is determined that the application generated by the application package meets the preset running conditions, the version information corresponding to the application package is added to the application version range, and a preset configuration file is obtained. The version information is modified according to the configuration file, which includes the application version range. as well as The installation module is configured to install the application installation package based on the modified version information. The configuration file includes a blocking version number, and both the blocking version number and the version information include a version number. The configuration module is configured to add an original field to the application installation package, copy the content of the version information to the original field, and replace the version number of the version information with the version number of the blocked version number, wherein the version number of the blocked version number is a preset extreme value.
7. An electronic device, characterized in that, include: Memory, configured to store computer programs; as well as The processor is configured to execute the computer program to perform the application installation method according to any one of claims 1 to 5.
8. A computer-readable medium having a computer program stored thereon, characterized in that, The computer program is executed by a processor to implement the application installation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Patch installation method and device thereof
CN102156649A
Modem configuration file processing method, device and mobile terminal
CN107318099A