Plug-in processing method and device, computer equipment and readable storage medium

Through project componentization and pre-configured packaging tools, the Java code and resources are separated and encrypted, combined with the pre-configured ClassLoader loading policy and the host proxy API, multiple problems in traditional plug-in processing methods are solved, and efficient, secure and flexible plug-ins are achieved. deal with.

CN119473424APending Publication Date: 2025-02-18GUANGZHOU HUANWANG TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411492570.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In mobile application development, traditional plug-in processing methods have problems such as too large packages, unable to issue resources separately, class loading conflicts, slow startup, poor model adaptability, and inability to load SDKs of third-party dynamic loading dex.

Method used

Through project componentization, separate java code and resources, call pre-configured packaging tools to compile java code into dex files, package resources into apk files, and encrypt the plug-in. Then decrypt the plugin, determine the host, call the preset ClassLoader loading policy to load the plugin, and use the host to proxy the Android native API, so that the plugin can run normally and seamlessly display it to the host's UI interface.

Benefits of technology

It effectively solves many problems handled by traditional plug-ins, improves the security, flexibility and compatibility of plug-ins, and realizes seamless integration and efficient loading between plug-ins and hosts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473424A_ABST
    Figure CN119473424A_ABST
Patent Text Reader

Abstract

The invention discloses a plug-in processing method and device, computer equipment and a readable storage medium. The plug-in processing method comprises the steps of firstly modularizing a project to separate java codes from resources; and calling a packaging tool to compile the java code into a dex file, packaging resources into an apk file, configuring the apk file to a plug-in, and encrypting the apk file. And then the plug-in is decrypted, a host is determined, and a preset ClassLoader loading strategy is called to load the plug-in. An Android native api is agented by a host, so that the plug-in can be accessed. And finally running the plug-in and seamlessly displaying the plug-in to a UI interface of the host Through the design, many problems of traditional plug-in processing are effectively solved, and the safety, flexibility and compatibility of the plug-in are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of plug-in processing, and in particular to a plug-in processing method, device, computer equipment and readable storage medium. Background Art

[0002] In mobile application development, the traditional plug-in processing method has many problems, such as apk packaging resulting in a large package, resources cannot be distributed separately, the same class cannot be loaded successfully in different SDKs, the application starts slowly when there are multiple plug-ins, the model adaptability is not high, and the third-party SDK with dynamic loading of dex cannot be loaded. To solve these problems, a more efficient, flexible and secure plug-in processing method is needed. Summary of the invention

[0003] The object of the present invention is to provide a plug-in processing method, device, computer equipment and readable storage medium.

[0004] In a first aspect, an embodiment of the present invention provides a plug-in processing method, including:

[0005] The project components the Java code and the resources so that the Java code and the resources are separated from each other;

[0006] Calling a pre-configured packaging tool, compiling the Java code into a dex file, packaging the resources into an apk file, configuring the dex file and the apk file to at least one plug-in, and then encrypting the at least one plug-in;

[0007] Decrypting the at least one plug-in and determining a host corresponding to the at least one plug-in;

[0008] Calling a preset ClassLoader loading strategy to load the at least one plug-in;

[0009] Based on the host proxy Android native API, so that the at least one plug-in scopes the Android native API;

[0010] The at least one plug-in is run and displayed seamlessly on the UI interface of the host.

[0011] In a possible implementation, calling a preconfigured packaging tool, compiling the Java code into a dex file, packaging the resources into an apk file, configuring the dex file and the apk file to at least one plug-in, and then encrypting the at least one plug-in includes:

[0012] Calling a pre-configured packaging tool to package the Java code into an aar format;

[0013] Calling a pre-configured conversion Gradle plug-in to convert the aar format into a dex format to obtain the dex file;

[0014] Based on a pre-configured encryption Gradle plug-in, after the dex file and the apk file are configured to at least one plug-in, the at least one plug-in is encrypted.

[0015] In a possible implementation, the preset ClassLoader loading strategy includes:

[0016] Each plugin only inherits the host's ClassLoader;

[0017] Each plug-in selects an independent ClassLoader or a non-independent ClassLoader to load;

[0018] Android's lower version system uses multidex to merge multiple dex, and Android's higher version system uses ClassLoader's multi-dex loading feature to load.

[0019] In a possible implementation, the at least one plug-in encryption is implemented by C++.

[0020] In a possible implementation, the at least one plug-in encryption is implemented by C++, including:

[0021] Using C++ to write an encryption algorithm to encrypt the dex file and the apk file in the at least one plug-in;

[0022] Before the plug-in is loaded, the encrypted plug-in is decrypted through the corresponding C++ decryption algorithm to ensure that the plug-in can be loaded and executed normally.

[0023] In a possible implementation, the proxying of the Android native API based on the host so that the at least one plug-in can access the Android native API includes:

[0024] The host application provides a set of proxy interfaces to forward the plug-in's call requests to the Android native API;

[0025] The plug-in indirectly accesses the Android native API through the proxy interface provided by the host to achieve function expansion and integration.

[0026] In a possible implementation, the running of the at least one plug-in and seamlessly displaying it on the UI interface of the host includes:

[0027] Running the at least one plug-in to generate corresponding UI elements and data;

[0028] The host application captures the UI elements and data generated by the plug-in and seamlessly integrates them into the host's UI interface, achieving interface fusion between the plug-in and the host application.

[0029] In a second aspect, an embodiment of the present invention provides a plug-in processing device, including:

[0030] An acquisition module is used to componentize Java code and resources in a project so that the Java code and the resources are separated from each other;

[0031] The processing module is used to call a pre-configured packaging tool, compile the Java code into a dex file, package the resources into an apk file, and after configuring the dex file and the apk file to at least one plug-in, encrypt the at least one plug-in; decrypt the at least one plug-in, and determine the host corresponding to the at least one plug-in; call a preset ClassLoader loading strategy to load the at least one plug-in; proxy the Android native API based on the host, so that the at least one plug-in can access the Android native API;

[0032] The running module is used to run the at least one plug-in and display it seamlessly on the UI interface of the host.

[0033] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor and a non-volatile memory storing computer instructions, wherein when the computer instructions are executed by the processor, the computer device executes the method described in at least one possible implementation of the first aspect.

[0034] In a fourth aspect, an embodiment of the present invention provides a readable storage medium, wherein the readable storage medium includes a computer program, and when the computer program is run, the computer device where the readable storage medium is located is controlled to execute the method described in at least one possible implementation manner of the first aspect.

[0035] Compared with the prior art, the beneficial effects provided by the present invention include: using a plug-in processing method, device, computer equipment and readable storage medium disclosed in the present invention, the Java code and resources are separated by componentizing the project. Call the packaging tool to compile the Java code into a dex file, package the resources into an apk file, and encrypt them after configuring them into the plug-in. Then decrypt the plug-in and determine the host, and call the preset ClassLoader loading strategy to load the plug-in. Through the host proxy Android native API, the plug-in can be accessed. Finally, run the plug-in and display it seamlessly on the host's UI interface. Such a design effectively solves many problems of traditional plug-in processing and improves the security, flexibility and compatibility of the plug-in. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings without creative work.

[0037] Figure 1 A schematic diagram of the steps of the plug-in processing method provided by an embodiment of the present invention;

[0038] Figure 2 A schematic block diagram of the structure of a plug-in processing device provided by an embodiment of the present invention;

[0039] Figure 3 A schematic block diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0041] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings.

[0042] In order to solve the technical problems in the aforementioned background technology, Figure 1 This is a flow chart of a plug-in processing method provided in an embodiment of the present disclosure. The plug-in processing method is introduced in detail below.

[0043] Step S201, componentizing the Java code and resources of the project so that the Java code and the resources are separated from each other;

[0044] Step S202, calling a pre-configured packaging tool, compiling the Java code into a dex file, packaging the resources into an apk file, configuring the dex file and the apk file to at least one plug-in, and then encrypting the at least one plug-in;

[0045] Step S203, decrypting the at least one plug-in and determining a host corresponding to the at least one plug-in;

[0046] Step S204, calling a preset ClassLoader loading strategy to load the at least one plug-in;

[0047] Step S205, based on the host proxy Android native API, so that the at least one plug-in scopes the Android native API;

[0048] Step S206, running the at least one plug-in and displaying it seamlessly on the UI interface of the host.

[0049] In the embodiment of the present invention, for example, in a large mobile application development project, the server plays the role of processing various complex tasks. Assume that we are developing a shopping application with rich functions, which includes multiple modules such as product display, shopping cart, user management, and payment.

[0050] First, the server componentizes the project, separating Java code and resources (such as images, layout XML files, etc.) from each other. Taking the product display module as an example, the server separates the Java code related to product display (such as obtaining product data, processing product sorting logic, etc.) to form a special Java code component. At the same time, resources such as product images and layout XML files of product details pages are separated separately. The advantage of this is that when the product display module needs to be modified or optimized, Java code or resources can be processed more specifically without interfering with each other. For example, if you only want to change the product image, you only need to update the resource part without changing the Java code. For another example, if you find that the algorithm for product sorting needs to be optimized during the development process, developers can focus on modifying the Java code component without worrying about affecting the related resource files. This separation makes project maintenance and updating more efficient and flexible.

[0051] The server continues the subsequent processing. For the above separated Java code and resources, the server calls the pre-configured packaging tool. Assume that the server receives a processing request for the product display module. First, the server packages the Java code of the module into aar format. In this process, the server will carefully check and optimize the Java code to ensure the quality and efficiency of the code. Next, the server calls the pre-configured conversion Gradle plug-in to convert the aar format into the dex format. At the same time, the server packages the resources of the product display module (such as pictures, XML layout files, etc.) into an apk file. This apk file only contains resources related to product display and does not contain any code logic. After configuring the dex file and apk file to the plug-in, the server encrypts the plug-in based on the pre-configured encryption Gradle plug-in. For example, for the product display plug-in, the server uses a complex encryption algorithm to encrypt it, so that unauthorized access cannot obtain the real content of the plug-in. Assume that in a market environment where e-commerce competition is fierce, our shopping application has a unique product recommendation algorithm plug-in. Through encryption, competitors cannot easily obtain and copy our core technology, thereby maintaining our competitive advantage in the market.

[0052] When a plug-in needs to be used, the server first decrypts the encrypted plug-in. Taking the product display plug-in as an example, the server uses a pre-stored decryption algorithm to decrypt it to ensure that the plug-in can be used normally. After the decryption is completed, the server needs to determine the host corresponding to the plug-in. Assuming that the host is the main interface of the shopping application, the server will associate the decrypted product display plug-in with the main interface so that the main interface can correctly call and use the functions of the product display plug-in. By accurately determining the host, the plug-in can work with other parts of the application to provide users with a complete functional experience.

[0053] The server loads plug-ins according to the preset ClassLoader loading strategy. For each plug-in, the server will select the appropriate loading method according to the specific situation. Suppose there are multiple plug-ins in the shopping application, such as product display plug-in, shopping cart plug-in and user management plug-in. For the product display plug-in, since its function is relatively independent and its resource requirements are large, the server chooses to assign it an independent ClassLoader for loading. This ensures that the product display plug-in will not be interfered with by other plug-ins during loading and running, ensuring its performance and stability. For the shopping cart plug-in and the user management plug-in, since there is a certain association and shared resources between them, the server can choose to use a non-independent ClassLoader for loading to improve resource utilization and loading efficiency. In the low-version Android system, the server uses Google's official multidex to merge multiple dex for loading. Suppose our shopping application needs to load multiple plug-ins at the same time, and the low-version Android system has a limit on the number of dex files. Through the multidex technology, the server merges multiple dex files into one, so that the application can run normally on the low-version system. In the high-version Android system, the server uses the official ClassLoader multi-dex loading feature to load

[0054] During the operation of the shopping app, the plug-in may need to call Android native APIs to implement certain functions. The server proxies these API calls through the host app.

[0055] Assume that the product display plug-in needs to obtain the device's screen resolution to optimize the display of product images. The host application provides a set of proxy interfaces to forward the plug-in's call requests to the Android native API. When the product display plug-in sends a request to obtain the screen resolution, the request will first reach the host application.

[0056] After receiving the request, the host application forwards the request to the native API of the Android system through the proxy interface it provides. After the Android system obtains the screen resolution, it returns the result to the host application, and the host application then passes the result to the product display plug-in.

[0057] In this way, the plug-in can indirectly access the Android native API, realizing the expansion and integration of functions. At the same time, the host application can manage and control the plug-in API calls to ensure the legitimacy and security of the calls.

[0058] Suppose in a shopping app, the user management plug-in needs to call Android's notification permission API to send push notifications. The host application will check and manage the plug-in's permissions. Only with user authorization will the plug-in be allowed to call the notification permission API through the host application's proxy interface, thus ensuring the user's privacy and security.

[0059] The server runs the plugin and displays the generated content seamlessly on the host's UI. Take the product display plugin as an example. When the plugin runs, it generates information such as the product's image, price, description, etc., and presents it in a specific layout and style.

[0060] The host application captures these UI elements and data generated by the plug-in and seamlessly integrates them into the host's UI interface. For example, the product list generated by the product display plug-in is embedded in the main interface of the shopping application, so that users cannot feel the difference between the plug-in and the host when browsing, providing a smooth and unified user experience.

[0061] Assume that during a shopping app promotion, the server runs a special product recommendation plug-in. The plug-in generates a series of popular promotional products and displays them in a striking way on the host UI. When users open the app, they can immediately see these recommended products, which increases their desire to buy and the app's conversion rate.

[0062] For example, when a user views a shopping cart, the shopping cart plug-in generates detailed information and total price of the items in the shopping cart. The host application accurately displays this data on the shopping cart page, allowing users to clearly understand their shopping situation.

[0063] In summary, through a series of steps such as project componentization of Java code and resources, calling packaging tools for compilation and encryption, decryption and host determination, adopting appropriate ClassLoader loading strategies, proxying Android native APIs through the host, and seamlessly displaying plug-ins to the host UI interface, the server can efficiently and securely process plug-ins and provide users with a rich, smooth and personalized mobile application experience. In the fiercely competitive mobile application market, this advanced plug-in processing method can help application developers improve the quality and competitiveness of their applications and meet the ever-changing needs of users.

[0064] Assuming that our shopping application is constantly updated and expanded, this plug-in processing method can easily add new plug-ins, such as order tracking plug-ins, after-sales evaluation plug-ins, etc. The server can process and integrate these new plug-ins according to the same process, so that the shopping application always remains dynamic and innovative, bringing more convenience and value to users.

[0065] In actual application development, the server also needs to deal with various emergencies and abnormal situations. For example, network interruption leads to plug-in download failure, errors occur during encryption and decryption, and compatibility issues between plug-ins and hosts. The server needs to have a complete error handling and recovery mechanism to ensure the stability and reliability of the application.

[0066] In the embodiment of the present invention, the aforementioned step S202 may be implemented through the following example execution.

[0067] Calling a pre-configured packaging tool to package the Java code into an aar format;

[0068] Calling a pre-configured conversion Gradle plug-in to convert the aar format into a dex format to obtain the dex file;

[0069] Based on a pre-configured encryption Gradle plug-in, after the dex file and the apk file are configured to at least one plug-in, the at least one plug-in is encrypted.

[0070] In the embodiment of the present invention, for example, in a large mobile game development project, the server undertakes key processing tasks. Assume that the game has a complex role system, rich game scenes and diverse prop modules.

[0071] For the role system module, the server first calls the pre-configured packaging tool to process the Java code in it. These Java codes contain the role's attribute definition, behavior logic, and interaction code with other modules. The server packages these Java codes into aar format. During this process, the server will carefully check the structure and syntax of the code to ensure that there are no errors and omissions.

[0072] For example, for the character's movement logic code, the server will confirm that the coordinate calculation, speed control and other parts are completely and accurately included in the packaged aar.

[0073] After packaging the aar format, the server then calls the pre-configured conversion Gradle plug-in. Through this conversion process, the resulting dex file can be more efficiently recognized and loaded by the Android system.

[0074] For example, when converting the relevant code for releasing character skills, the Gradle plug-in will optimize the execution efficiency of the code so that it can quickly respond to the player's operations when the game is running.

[0075] After packaging the resources of the character system (such as character image pictures, special effect resources, etc.) into an apk file, the server configures the dex file and the apk file into at least one plug-in based on a pre-configured encryption Gradle plug-in, and then encrypts these plug-ins.

[0076] Suppose there is a particularly rare character plug-in in the game, the server uses the encrypted Gradle plug-in to encrypt it with high strength. This is done to prevent this rare character plug-in from being illegally cracked and copied, to protect the balance of the game and the interests of the developer.

[0077] For the game scene module, the same process is carried out in an orderly manner on the server. The server packages the Java code related to scene construction, light and shadow effect processing, etc. into aar format, and then converts it into a dex file by converting the Gradle plug-in. The scene resources, such as map images, environmental sound effects, etc., are packaged into apk files.

[0078] Afterwards, these dex files and apk files are configured as scene plug-ins and encrypted. The encrypted scene plug-ins are highly secure during transmission and storage, ensuring that the unique scene design of the game cannot be easily stolen or imitated.

[0079] Let's look at the props module. The server packages the Java codes of various props such as generation logic and property adjustment into aar and dex. The resources such as prop icons and description pictures are packaged into apk files. After being configured as a prop plug-in, it is encrypted to ensure the security and uniqueness of the prop system.

[0080] When the game needs to be updated, such as adding a powerful weapon item, the server will execute the above process again, process the relevant code and resources of the new weapon item, and generate an encrypted plug-in to ensure that players can experience new and safe content after updating the game.

[0081] During the operation of the game, if any potential security threats or cracking attempts are found, the server can quickly detect the anomaly and take corresponding encryption upgrade measures to re-encrypt the plug-in at a higher level to meet the ever-changing security challenges.

[0082] In an embodiment of the present invention, the preset ClassLoader loading strategy includes:

[0083] Each plugin only inherits the host's ClassLoader;

[0084] Each plug-in selects an independent ClassLoader or a non-independent ClassLoader to load;

[0085] Android's lower version system uses multidex to merge multiple dex, and Android's higher version system uses ClassLoader's multi-dex loading feature to load.

[0086] In the embodiment of the present invention, for example, in a comprehensive mobile office application project, the server undertakes the crucial plug-in loading and management tasks. This application covers multiple functional modules such as document editing, task management, and meeting scheduling.

[0087] For each plug-in, the server follows the strategy of "each plug-in only inherits the host's ClassLoader". Assume that the host application is the main framework of the entire mobile office application, which contains some common basic classes and resources.

[0088] Taking the document editing plug-in as an example, when loading the plug-in, the server ensures that it only inherits the ClassLoader of the host application. This means that the document editing plug-in can access some common functions and resources defined in the host application, such as the font style library and the definition of the file storage path.

[0089] The server enables the document editing plug-in to utilize the basic classes and resources already loaded by the host application, thus avoiding duplicate loading and resource waste, while also ensuring compatibility and consistency between the plug-in and the host application.

[0090] When choosing the loading method for plug-ins, the server decides whether to use an independent ClassLoader or a non-independent ClassLoader to load each plug-in based on the specific situation.

[0091] For the task management plug-in, since its functions are relatively independent and there is little interaction with other plug-ins, the server selects an independent ClassLoader for it to load.

[0092] When the server receives a request from a user to turn on the task management function, it uses an independent ClassLoader to load the task management plug-in. This ensures that the task management plug-in has its own independent class loading environment during operation and is not affected by other plug-ins.

[0093] Even if other plug-ins encounter exceptions or resource conflicts, the task management plug-in can still run stably, ensuring that users can create, assign, and track tasks normally.

[0094] As for the meeting scheduling plug-in and document editing plug-in, since they have certain functional connections, for example, in meeting scheduling, it may be necessary to directly call some functions of document editing to generate meeting minutes, the server selects a non-independent ClassLoader for them to load.

[0095] When the user schedules a meeting and needs to generate meeting minutes, the server loads the two plug-ins through a non-independent ClassLoader, allowing them to share some classes and resources, improving resource utilization and loading efficiency.

[0096] When faced with different versions of the Android system, the server adopts a corresponding multi-dex loading strategy.

[0097] For lower-version Android systems, the server uses multidex to merge multiple dex files. Assume that in this mobile office application, there are multiple functional plug-ins, and each plug-in generates its own dex file.

[0098] In lower-version Android systems, due to system restrictions on the number of dex files, the server will use multidex technology to merge these multiple dex files into one.

[0099] For example, when the server detects that the user is using an Android device with a lower version to run the mobile office application, it will merge the dex files generated by the document editing plug-in, task management plug-in, and meeting scheduling plug-in.

[0100] In this way, despite the limitations of the device system, all necessary functional plug-ins can still be loaded and run smoothly, ensuring that users can enjoy a complete mobile office experience even on low-version devices.

[0101] For high-version Android systems, the server makes full use of its ClassLoader multi-dex loading feature.

[0102] When a user opens the app using a high-version Android device, the server will directly load the dex files generated by each plug-in.

[0103] For example, the dex file of the document editing plug-in, the dex file of the task management plug-in, and the dex file of the meeting scheduling plug-in can be loaded simultaneously by the ClassLoader of the higher-version Android system without the need for merging operations.

[0104] This method is more efficient and flexible, and can start applications and load plug-ins faster, improving the user experience.

[0105] During the actual operation, the server needs to monitor the user's device information and system version in real time, and dynamically select the most appropriate ClassLoader loading strategy and multi-dex processing method.

[0106] For example, when a large number of users are using this mobile office application at the same time, the server must quickly and accurately select the best loading solution for each user's device to ensure that no matter what Android device and system version the user uses, they can get a smooth, stable and efficient application experience.

[0107] Through such sophisticated and flexible ClassLoader loading strategy and multi-dex processing method, the server successfully provides high-quality mobile office services for users of different devices and system versions, improving the application's availability and user satisfaction.

[0108] In an embodiment of the present invention, the at least one plug-in encryption is implemented by C++.

[0109] In the embodiment of the present invention, for example, in the development and maintenance of an online education application, the server is responsible for processing the encryption of the plug-in. The application includes multiple functional plug-ins such as course video playback, online testing, and learning material downloading.

[0110] In order to ensure the security of the plug-in, the server uses C++ to implement plug-in encryption. Taking the course video playback plug-in as an example, the server uses an encryption algorithm written in C++ to process it.

[0111] First, the server obtains key data in the course video playback plug-in, such as the video decoding key, playback permission verification logic, etc. These data are crucial to ensure the copyright and legal use of the video.

[0112] Next, the server uses complex encryption functions and logic in C++ to encrypt the critical data. For example, it uses advanced symmetric encryption algorithms, such as the AES encryption algorithm, to generate encryption keys for the data and perform bit-by-bit encryption transformations on the data.

[0113] During the encryption process, the high efficiency of C++ is fully utilized. The server can quickly process large amounts of data, ensuring that the encryption process does not cause significant performance delays and does not affect the user's normal experience.

[0114] For the online test plug-in, the server also uses C++ for encryption. Sensitive information such as test questions, answers, and scoring mechanisms are carefully encrypted.

[0115] Through C++'s powerful bit operation and data processing capabilities, even complex scoring algorithms and random question generation logic can be securely encrypted to prevent unauthorized access and tampering.

[0116] In the learning material download plug-in, the download link, file verification information, etc. are also encrypted through C++. This ensures that only legitimate users can obtain valid download links and verify the integrity and correctness of the downloaded files.

[0117] When using C++ encryption, the server also fully considers the strength and security of encryption. Encryption keys are updated regularly and encryption complexity is increased to cope with ever-changing security threats.

[0118] For example, at regular intervals, the server will regenerate a new encryption key based on preset rules, and use C++ code logic to convert data encrypted with the old key to data encrypted with the new key.

[0119] At the same time, the server will also perform integrity verification on the encrypted plug-in data. The hash value of the data is calculated through C++, and it is calculated and compared again when verification is required to ensure that the data has not been tampered with during transmission and storage.

[0120] When a user requests to use a plug-in, the server first uses the corresponding C++ decryption algorithm to decrypt the encrypted plug-in. This process is fast and accurate, ensuring that the plug-in can be used by the user in a timely manner, while ensuring the security and reliability of the decryption process.

[0121] By using C++ to implement plug-in encryption, the server provides solid security for online education applications, protects the intellectual property rights of educational resources, and provides users with a trusted and secure learning environment.

[0122] In the embodiment of the present invention, the at least one plug-in encryption is implemented by C++ and can be implemented by the following example execution.

[0123] Using C++ to write an encryption algorithm to encrypt the dex file and the apk file in the at least one plug-in;

[0124] Before the plug-in is loaded, the encrypted plug-in is decrypted through the corresponding C++ decryption algorithm to ensure that the plug-in can be loaded and executed normally.

[0125] In the embodiment of the present invention, for example, in a large-scale financial transaction mobile application, the server undertakes the important task of ensuring the security and stable operation of the plug-in. This application includes multiple key function plug-ins such as account management, transaction record query, and market analysis.

[0126] For the account management plug-in, the server uses an encryption algorithm written in C++ to encrypt the dex files and apk files. First, the server obtains all data related to account management, including the user's account information, password encryption storage logic, and the processing code of fund transaction records.

[0127] The server uses the powerful programming capabilities of C++ to design a complex and efficient encryption algorithm. For example, a hybrid encryption algorithm that combines the advantages of symmetric encryption and asymmetric encryption is used. For user sensitive information, such as passwords, an asymmetric encryption algorithm is used to encrypt and generate public and private keys. The public key is used to encrypt data, and the private key is securely stored by the server for subsequent decryption operations.

[0128] The dex files in the account management plug-in contain key logic codes such as account fund calculation and transaction permission verification. The server uses a symmetric encryption algorithm, such as the AES algorithm, to encrypt these codes byte by byte. At the same time, the resources in the apk file, such as account icons and security reminder images, are also encrypted to ensure that all parts of the entire plug-in are under security protection.

[0129] In the transaction record query plug-in, the server also uses the encryption algorithm written in C++ for processing. The detailed data of the transaction record, the query logic, and the interface code for communicating with the server are all considered important encryption objects.

[0130] Through the carefully designed C++ encryption algorithm, each piece of data in the transaction record is encrypted, so that even if it is obtained during data storage or transmission, it cannot be easily interpreted. At the same time, the query logic code is encrypted to prevent malicious attackers from analyzing the code to obtain vulnerabilities or bypass security verification.

[0131] In the market analysis plug-in, the acquisition and analysis algorithms of real-time market data, chart generation codes, etc. are also processed by C++ encryption algorithms, ensuring the accuracy and timeliness of market data are protected, while preventing competitors from obtaining core analysis algorithms.

[0132] When users need to use these plug-ins, the server will decrypt the encrypted plug-ins through the corresponding C++ decryption algorithm before loading the plug-ins.

[0133] Taking the account management plug-in as an example, when the user opens the application and clicks to enter the account management page, the server first detects the user's operation request. Then, it quickly starts the pre-written C++ decryption algorithm. The server uses the saved private key to decrypt the encrypted user password and other sensitive information, and decrypts the encrypted code and resources in the dex file and apk file, restoring them to an executable and readable state.

[0134] When the transaction record query plug-in is loaded, the server also responds quickly. The moment the user's query request is received, the C++ decryption algorithm is started to decrypt the encrypted transaction record data and query logic code, so that the plug-in can load and execute query operations normally, quickly providing users with accurate transaction record information.

[0135] For the market analysis plug-in, when the user opens the market page, the server completes the decryption process in a very short time, ensuring that the real-time market data can be displayed to the user in a timely and accurate manner, and that the core analysis algorithm can operate normally, providing users with valuable market analysis results.

[0136] During the entire decryption process, the server strictly controls the decryption process and permissions. Decryption operations are performed only after legitimate user identity verification and authorization. At the same time, the execution process of the decryption algorithm is closely monitored and protected to prevent the decryption process from being attacked or interfered with.

[0137] For example, the server will regularly check the integrity and security of the decryption algorithm to ensure that it has not been maliciously tampered with. If any abnormality is found, emergency measures will be taken immediately, such as suspending the decryption operation, issuing a security alert, and starting the backup decryption mechanism.

[0138] By using C++ to write encryption and decryption algorithms to process plug-ins, the server builds a solid security line for financial transaction mobile applications. It ensures the user's financial security and transaction privacy, improves the user's trust in the application, and enables the application to provide users with stable and reliable services in the fiercely competitive financial field.

[0139] In the embodiment of the present invention, the aforementioned step S205 can be implemented through the following example execution.

[0140] The host application provides a set of proxy interfaces to forward the plug-in's call requests to the Android native API;

[0141] The plug-in indirectly accesses the Android native API through the proxy interface provided by the host to achieve function expansion and integration.

[0142] In the embodiment of the present invention, for example, in a feature-rich social entertainment application, the server is responsible for processing the interaction between the plug-in and the Android native API. This application includes multiple plug-ins such as instant messaging, short video sharing, and live interaction.

[0143] Take the instant messaging plug-in as an example. When a user sends a voice message using the instant messaging function, the plug-in needs to call the Android native audio recording API to obtain the user's voice input. At this time, the host application provides a set of proxy interfaces.

[0144] The server first ensures that the proxy interface in the host application is available and ready to receive and process the plug-in's call request. When the instant messaging plug-in initiates a call to the audio recording API, the request is not sent directly to the Android native system, but first reaches the proxy interface provided by the host application.

[0145] After the proxy interface receives the plug-in's call request, the server will parse and verify the request. It will check the legitimacy of the request, such as whether it has the corresponding permissions, whether the request parameters are complete and correct, etc.

[0146] Assume that in this scenario, after the server confirms that the request is legitimate, it forwards the request to the Android native audio recording API through the host application's proxy interface. After receiving the request, the Android native system starts the audio recording function and returns the recorded voice data to the host application's proxy interface.

[0147] The server then passes the returned data to the instant messaging plug-in through the proxy interface, so that the plug-in can continue subsequent processing, such as compressing, encoding and transmitting the voice data.

[0148] In the short video sharing plug-in, when the user wants to shoot a short video, the plug-in needs to call the Android native camera API to obtain the video screen. Similarly, the plug-in sends a call request through the proxy interface provided by the host.

[0149] When the server processes this request, it will verify and forward it according to the same process, ensuring that the camera API is called correctly and the acquired video images can be smoothly returned to the plug-in for video editing, adding special effects, and other operations.

[0150] For the live interactive plug-in, when it is necessary to obtain the user's geographic location information to implement the nearby live recommendation function, the plug-in initiates a call request to the Android native geographic location API to the proxy interface of the host application.

[0151] After receiving the request, the server will conduct a strict permission check. Only when the user has authorized the application to obtain location information will the request be forwarded to the Android native API. After obtaining the location data, it will be returned to the live interactive plug-in through the proxy interface to achieve accurate nearby live recommendations.

[0152] In this way, the server enables each plug-in to indirectly access the Android native API with the help of the proxy interface provided by the host application, achieving rich functional expansion and integration.

[0153] For example, in an instant messaging plug-in, in addition to the audio recording API, you may also need to call the Android native notification API to implement new message reminders. The server ensures that this series of complex API calls can be carried out stably and securely through the proxy interface of the host application.

[0154] In the short video sharing plug-in, it may be necessary to call the Android native storage API to save the captured video files. The server also ensures the smooth completion of the storage operation through the transfer of the proxy interface, while ensuring the security and privacy of user data.

[0155] In the live interactive plug-in, it may be necessary to call the Android native network connection status API to optimize the transmission quality of the live stream. The server uses the proxy interface of the host application to achieve this functional requirement and provide users with a smooth and stable live experience.

[0156] In short, the server carefully manages and coordinates the call requests of various plug-ins to the Android native API through the proxy interface of the host application, realizing the diversification and powerful functions of social entertainment applications and bringing users a high-quality and convenient user experience.

[0157] In the embodiment of the present invention, the aforementioned step S206 can be implemented through the following example execution.

[0158] Running the at least one plug-in to generate corresponding UI elements and data;

[0159] The host application captures the UI elements and data generated by the plug-in and seamlessly integrates them into the host's UI interface, achieving interface fusion between the plug-in and the host application.

[0160] In an embodiment of the present invention, for example, in a comprehensive e-commerce shopping application, the server is responsible for processing the operation of multiple plug-ins and displaying them on the host UI interface. These plug-ins include product recommendations, shopping cart management, order tracking, etc.

[0161] Take the product recommendation plug-in as an example. The server runs the plug-in. The plug-in generates corresponding UI elements and data based on the user's browsing history, purchase behavior, and current popular products. For example, the plug-in calculates the product categories that the user may be interested in, and generates a series of UI elements such as product images, product names, prices, and short descriptions, and also generates relevant recommendation algorithm data.

[0162] When the server runs the product recommendation plug-in, it performs a lot of data processing and calculations. It obtains detailed user behavior data from the database and uses complex machine learning algorithms to analyze it to determine the most suitable products to recommend to users. Then, these calculation results are converted into specific UI elements and data.

[0163] In terms of the shopping cart management plug-in, when the server runs the plug-in, it will obtain detailed information about the items in the shopping cart, including the quantity, specifications, total price, etc. Generate the UI elements required for the shopping cart page, such as product list items, total price calculation box, edit shopping cart button, etc., as well as the corresponding shopping cart data.

[0164] For the order tracking plug-in, when the server runs it, it will obtain the real-time status information of the order from the logistics system, generate UI elements and related data such as text description of the order status, logistics route display on the map, and estimated arrival time.

[0165] After these plug-ins generate their own UI elements and data, the host application comes into play. The host application captures the content generated by the plug-ins.

[0166] For example, after the UI elements and data generated by the product recommendation plug-in are passed to the host application, the host application will analyze the layout and style requirements of these elements. If the product recommendation area is designed as a horizontally scrolling list, the host application will adjust and arrange the received UI elements according to this requirement.

[0167] The host application also handles data integration. For example, it combines the product price data generated by the product recommendation plug-in with the mall's promotion data to display the final discounted price.

[0168] In terms of UI elements and data generated by the shopping cart management plug-in, the host application will synchronize the list of items in the shopping cart with the mall's inventory system in real time. If a product is out of stock, the host application will display an out of stock prompt on the corresponding item in the shopping cart and may provide relevant alternative product recommendations.

[0169] For the UI elements and data generated by the order tracking plug-in, the host application will integrate the logistics route information with the map control to achieve a visual display on the map. At the same time, the estimated arrival time is combined with the notification function of the system to send reminder notifications to users when the arrival time is approaching.

[0170] Through such fine processing, the UI elements and data generated by the plug-in are seamlessly integrated into the host's UI interface.

[0171] When users open the homepage of an e-commerce application, they will see the personalized recommended products generated by the product recommendation plug-in neatly arranged in the recommendation area, perfectly integrated with the rest of the page, with a consistent style and smooth operation.

[0172] When the user clicks to enter the shopping cart page, the shopping cart details generated by the shopping cart management plug-in are displayed accurately, including product information, price calculation, quantity modification and other functions can be used normally, as if these functions were originally part of the host application.

[0173] When users check the order status, the logistics information generated by the order tracking plug-in is clearly displayed on the order details page. The path, text description and estimated arrival time on the map are all coordinated with the overall style of the page, providing users with a coherent and convenient shopping experience.

[0174] The server continuously monitors the operation of the plug-in and the generation of data to ensure that during the user operation, whether loading a new page or updating data in real time, this seamless integration effect can be maintained.

[0175] For example, when a user continuously scrolls through a product recommendation page, the server can provide new recommended product data in a timely manner, and the host application can quickly display it on the interface without any lag or display anomalies.

[0176] After modifying the quantity of items in the shopping cart, the server immediately recalculates the total price, and the host application quickly updates the display, allowing users to see the changes in the shopping cart in real time.

[0177] In short, through the careful operation of the server and the clever integration of the host application, each plug-in can provide users with a rich and coherent shopping experience, making the interface of the e-commerce application more intelligent, personalized and friendly.

[0178] In order to more clearly describe the solution implemented in this application, a relatively complete implementation scheme is provided below.

[0179] 1. Project componentization java and resources.

[0180] 2. Custom packaging tools.

[0181] 3. The plugins are packaged and compiled into dex and apk.

[0182] 4. Decryption plug-in.

[0183] 5. Each plugin is loaded by an independent ClassLoader.

[0184] 6.Host proxy Android native API.

[0185] 7. Display UI.

[0186] Traditional plug-ins use the apk overall packaging method, which causes problems such as the package size being too large and resources being unable to be distributed separately, mainly due to the apk packaging method. Based on the above problems: Use steps 1, 2, and 3 to separate the project architecture component Java code from image, xml and other resource files. Use the plug-in packaging tool developed by yourself to package the project Java module into dex and the resources into apk (containing only resource files). The specific implementation of the custom packaging tool is as follows:

[0187] The module is packaged into aar;

[0188] When packaging aar, it is not possible to package dependencies and jar packages into aar. A gradle plug-in needs to be developed to merge dependencies.

[0189] Aar to dex gradle plugin tool;

[0190] Custom encryption gradle plugin.

[0191] When integrating multiple SDKs, the integrated SDKs use Android native APIs, class conflicts, and other issues. The implementation of traditional plug-in SDKs is that the pre-compiled project cannot obtain the original Android API or the Hook method calls the Android API, resulting in unreliable performance and conflicts between plug-ins. In view of the above situation, use steps 4, 5, and 6, as follows:

[0192] Each plugin only inherits the host's ClassLoader to avoid conflicts between plugins;

[0193] Each plugin can choose to load with an independent ClassLoader or a dependent ClassLoader;

[0194] Android lower versions use Google's official multidex to merge multiple dex, and higher versions use the official ClassLoader multi-dex loading feature to load;

[0195] The host proxy Android native API allows the plugin to directly access Android native API;

[0196] Plug-in encryption is performed through C++ to make the plug-in more secure.

[0197] Please refer to Figure 2 , Figure 2 A plug-in processing device 110 provided in an embodiment of the present invention includes:

[0198] Acquisition module 1101, used for componentizing Java code and resources of a project so that the Java code and the resources are separated from each other;

[0199] The processing module 1102 is used to call a pre-configured packaging tool, compile the Java code into a dex file, package the resources into an apk file, and after configuring the dex file and the apk file to at least one plug-in, encrypt the at least one plug-in; decrypt the at least one plug-in, and determine the host corresponding to the at least one plug-in; call a preset ClassLoader loading strategy to load the at least one plug-in; proxy the Android native API based on the host, so that the at least one plug-in can access the Android native API;

[0200] The running module 1103 is used to run the at least one plug-in and display it seamlessly on the UI interface of the host.

[0201] It should be noted that the implementation principle of the aforementioned plug-in processing device 110 can refer to the implementation principle of the aforementioned plug-in processing method, and will not be repeated here. It should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the plug-in processing device 110 can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above plug-in processing device 110. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by an integrated logic circuit of hardware in a processor element or instructions in the form of software.

[0202] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0203] The embodiment of the present invention provides a computer device 100, which includes a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device 100 executes the aforementioned plug-in processing device 110. Figure 3 As shown, Figure 3 The computer device 100 provided in the embodiment of the present invention is a structural block diagram. The computer device 100 includes a plug-in processing device 110, a memory 111, a processor 112 and a communication unit 113.

[0204] To achieve data transmission or interaction, the memory 111, the processor 112 and the communication unit 113 are electrically connected to each other directly or indirectly. For example, the electrical connection between these elements can be achieved through one or more communication buses or signal lines. The plug-in processing device 110 includes at least one software function module that can be stored in the memory 111 in the form of software or firmware or fixed in the operating system (OS) of the computer device 100. The processor 112 is used to execute the plug-in processing device 110 stored in the memory 111, such as the software function modules and computer programs included in the plug-in processing device 110.

[0205] An embodiment of the present invention provides a readable storage medium, which includes a computer program. When the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the aforementioned plug-in processing method.

[0206] For illustrative purposes, the foregoing description is made with reference to specific embodiments. However, the above illustrative discussion is not intended to be exhaustive or to limit the present disclosure to the precise form disclosed. Numerous modifications and variations are possible in accordance with the above teachings. These embodiments are selected and described in order to best illustrate the principles of the present disclosure and its practical application, so that those skilled in the art can best utilize the present disclosure and utilize various embodiments with different modifications to suit the intended specific application.

Claims

1. A plug-in processing method, characterized in that: include: The project components the Java code and the resources so that the Java code and the resources are separated from each other; Calling a pre-configured packaging tool, compiling the Java code into a dex file, packaging the resources into an apk file, configuring the dex file and the apk file to at least one plug-in, and then encrypting the at least one plug-in; Decrypting the at least one plug-in and determining a host corresponding to the at least one plug-in; Calling a preset ClassLoader loading strategy to load the at least one plug-in; Based on the host proxy Android native API, so that the at least one plug-in scopes the Android native API; The at least one plug-in is run and displayed seamlessly on the UI interface of the host.

2. The plug-in processing method according to claim 1, characterized in that: The calling of a pre-configured packaging tool, compiling the Java code into a dex file, packaging the resources into an apk file, configuring the dex file and the apk file to at least one plug-in, and then encrypting the at least one plug-in includes: Calling a pre-configured packaging tool to package the Java code into an aar format; Calling a pre-configured conversion Gradle plug-in to convert the aar format into a dex format to obtain the dex file; Based on a pre-configured encryption Gradle plug-in, after the dex file and the apk file are configured to at least one plug-in, the at least one plug-in is encrypted.

3. The plug-in processing method according to claim 1, characterized in that: The preset ClassLoader loading strategy includes: Each plugin only inherits the host's ClassLoader; Each plug-in selects an independent ClassLoader or a non-independent ClassLoader to load; Android's lower version system uses multidex to merge multiple dex, and Android's higher version system uses ClassLoader's multi-dex loading feature to load.

4. The plug-in processing method according to claim 1, characterized in that: The at least one plug-in encryption is implemented by C++.

5. The plug-in processing method according to claim 4, characterized in that: The at least one plug-in encryption is implemented by C++, including: Using C++ to write an encryption algorithm to encrypt the dex file and the apk file in the at least one plug-in; Before the plug-in is loaded, the encrypted plug-in is decrypted through the corresponding C++ decryption algorithm to ensure that the plug-in can be loaded and executed normally.

6. The plug-in processing method according to claim 1, characterized in that: The method of proxying the Android native API based on the host so that the at least one plug-in can access the Android native API includes: The host application provides a set of proxy interfaces to forward the plug-in's call requests to the Android native API; The plug-in indirectly accesses the Android native API through the proxy interface provided by the host to achieve function expansion and integration.

7. The plug-in processing method according to claim 1, characterized in that: The running of the at least one plug-in and seamlessly displaying it on the UI interface of the host includes: Running the at least one plug-in to generate corresponding UI elements and data; The host application captures the UI elements and data generated by the plug-in and seamlessly integrates them into the host's UI interface, achieving interface fusion between the plug-in and the host application.

8. A plug-in processing device, characterized in that: include: An acquisition module is used to componentize Java code and resources in a project so that the Java code and the resources are separated from each other; A processing module, configured to call a pre-configured packaging tool, compile the Java code into a dex file, package the resources into an apk file, and after configuring the dex file and the apk file to at least one plug-in, encrypt the at least one plug-in; decrypt the at least one plug-in, and determine a host corresponding to the at least one plug-in; Calling a preset ClassLoader loading strategy to load the at least one plug-in; proxying the Android native API based on the host, so that the at least one plug-in can access the Android native API; The running module is used to run the at least one plug-in and display it seamlessly on the UI interface of the host.

9. A computer device, characterized in that: The computer device comprises a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device executes the method according to any one of claims 1 to 7.

10. A readable storage medium, characterized in that: The readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.