Android system function calling method, Android system template, device and media

By introducing proxy call files and service proxy functions into the Android system's software development toolkit, third-party applications can call application function functions of Android system, solving the security risks of source code leakage in traditional toolkits, improving security and reducing communication costs.

CN118467061BActive Publication Date: 2025-04-04无锡宇宁科技集团股份有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410521971.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2025-04-04
Estimated Expiration
2044-04-28

AI Technical Summary

Technical Problem

In Android system development, traditional software development toolkits have security risks of source code leakage, resulting in third-party application developers being able to obtain source code logic through decompilation tools.

Method used

By introducing proxy call files into the software development toolkit, third-party applications can call application function functions in the Android system through service proxy functions, achieving the required functions without obtaining source code.

Benefits of technology

This method improves the source code security of the software development toolkit, avoids the risk of source code logic leakage, and saves communication costs between the Android system and third-party application developers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118467061B_ABST
    Figure CN118467061B_ABST
Patent Text Reader

Abstract

The present invention discloses an Android system function calling method, an Android system template, a device and a medium, and the present invention relates to the technical field of Android system development. The Android system function calling method comprises: calling a service proxy function in an Android system through a proxy calling file of a third-party application in a software development kit; obtaining an application function corresponding to the proxy calling file in the Android system through the service proxy function; and executing a function corresponding to the application function in the Android system. The present invention solves the technical problem of low source code security in a software development kit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Android system development, and in particular to an Android system function calling method, an Android system template, an electronic device and a computer-readable storage medium. Background Art

[0002] At present, in the field of Android system development technology, when it is necessary to provide SDK (Software Development Kit) to third-party application developers, the source code of the Android system needs to be compiled into software packages such as so (Shared Object) and jar (Java Archive), so that the third-party application developers can implement the functions corresponding to the system permissions that general apps cannot obtain based on these source codes (such as turning off the screen, shutting down the phone, changing the lock screen password, etc.). However, after obtaining software packages such as so and jar, third-party application developers can use certain decompilation tools to obtain the logic of the source code. Therefore, traditional software development kits have the security risk of source code leakage. Summary of the invention

[0003] The main purpose of the present invention is to provide an Android system function calling method, an Android system template, an electronic device and a computer-readable storage medium, aiming to solve the technical problem of low source code security in a software development kit.

[0004] To achieve the above object, the present invention provides an Android system function calling method, the Android system function calling method comprising:

[0005] Call the service proxy function in the Android system through the proxy call file in the software development kit of the third-party application;

[0006] Obtaining the application function corresponding to the proxy call file in the Android system through the service proxy function;

[0007] Execute the function corresponding to the application function in the Android system.

[0008] In one embodiment, the step of obtaining the object corresponding to the proxy call file in the Android system through the service proxy function includes:

[0009] Calling the service application program interface function in the Android system through the service proxy function;

[0010] The corresponding functional service function is called through the service application program interface function, and then the corresponding application program functional function is called through the functional service function.

[0011] In one embodiment, before the step of calling the service proxy function in the Android system through the proxy calling file in the software development kit of the third-party application, the method further includes:

[0012] Generate a source domain name through a service application in the Android system to obtain calling authority for other domain names;

[0013] A target domain name is generated through the service application to obtain the authority for the service application to be called.

[0014] In one embodiment, the method further comprises:

[0015] When the Android system is started, the process of the service application is awakened through a preset system permission file;

[0016] The system permission file is used to provide system permissions for the service application and prevent the process from being terminated by other applications;

[0017] Initialize the service application and add the service application to the system service list of the Android system.

[0018] In one embodiment, the Android system function calling method further includes:

[0019] The system service is registered through a preset system service registration file so that the third-party application can call the service proxy function.

[0020] The present invention also provides an Android system template, the Android system template comprising:

[0021] A service application template, the service application template at least comprising an interface service file and a proxy call file, wherein the interface service file is used to implement the function corresponding to the application function called by the third-party application, and the proxy call file is used to be added to the software development tool provided to the developer of the third-party application, so that the third-party application can call the application function in the Android system;

[0022] A framework template, the framework template at least includes a run calling file and a proxy acquisition file, wherein the run calling file is used for the third-party application to call, run and implement, and the proxy acquisition file is used to obtain a service proxy function.

[0023] In one embodiment, the service application template further includes:

[0024] System permission files are used to provide system permissions to service applications and prevent them from being terminated by other applications.

[0025] The initialization file is used to initialize the service application and add the server to the system service list of the Android system.

[0026] In one embodiment, the framework template further includes:

[0027] A system service registration file, used to register system services so that the third-party application can call service proxy functions;

[0028] Declaration file, used to declare interface names and interface functions.

[0029] The present invention also provides an electronic device, which is a physical device, and includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the steps of the Android system function calling method as described above.

[0030] The present invention also provides a readable storage medium, which is a computer-readable storage medium, and a program for implementing the method for calling an Android system function function is stored on the computer-readable storage medium. The program for implementing the method for calling an Android system function function is executed by a processor to implement the steps of the method for calling an Android system function function as described above.

[0031] The present invention also provides a computer program product, including a computer program, which implements the steps of the above-mentioned Android system function calling method when executed by a processor.

[0032] The present invention provides a method for calling an Android system function. In the method for calling an Android system function, first, a proxy calling file in a software development kit of a third-party application is used to call a service proxy function in the Android system, and then the application function function corresponding to the proxy calling file in the Android system is obtained through the service proxy function, and finally the function corresponding to the application function function is executed in the Android system. The software development kit provided to the third-party application in the technical solution of the present invention includes a proxy calling file, and implements the function of the application function function through the service proxy function and the application function function, so the software development tool does not contain the source code corresponding to the implementation process of the application function function. In essence, the function in the software development kit in the technical solution of the present invention is not implemented, and the idea of ​​implementing the function by calling the application function function in the Android system is adopted. Therefore, the software development kit does not need to be encrypted and packaged, and can be directly provided to the third-party application developer as the source code, which will not bring the risk of source code logic leakage and improve the source code security of the software development kit.

[0033] In addition, since the functions in the software development kit are not specifically implemented but are implemented by the Android system itself by calling application function functions, there is no need for the system signature files corresponding to the execution of certain commands that require system permissions to execute in the traditional solution. No signature is required and the application can be installed directly, saving the communication cost between the Android system and the third-party application developers. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0036] Figure 1 A schematic diagram of a flow chart of a method for calling an Android system function in an embodiment of the present invention;

[0037] Figure 2 A schematic diagram of a function calling sequence between a third-party app and a server app in a feasible interface according to an embodiment of the present invention;

[0038] Figure 3 A schematic diagram of the file composition of a feasible service application template in an embodiment of the present invention;

[0039] Figure 4 A schematic diagram of the structure of an Android system template in an embodiment of the present invention;

[0040] Figure 5 It is a schematic diagram of the device structure of the hardware operating environment involved in the Android system function calling method in an embodiment of the present invention.

[0041] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION

[0042] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical scheme 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 only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0043] The embodiment of the present invention provides an Android system function calling method, which is applied to a synchronous motor control system. Figure 1 , the Android system function calling method includes:

[0044] Step S10, calling the service proxy function in the Android system through the proxy calling file in the software development kit of the third-party application;

[0045] Step S20, obtaining the application function corresponding to the proxy call file in the Android system through the service proxy function;

[0046] Step S30, executing the function corresponding to the application function in the Android system.

[0047] In an embodiment of the present invention, a method for calling an Android system function is provided, which can be used in the process of developing a third-party app on the Android system. Normally, the Android system needs to package its own source code into the form of so and jar and provide it to the third-party app developer. However, in an embodiment of the present invention, there is no need to package the source code. Only an SDK (software development kit) including only the function name (no specific implementation required) needs to be provided to the third-party app developer. The files corresponding to these function names can call the functions that require system permissions to execute in the Android system (such as turning off the screen, shutting down the phone, changing the lock screen password, etc.) through function calls. Moreover, the third-party app can be developed independently based on eclipse or AndroidStudio only, without applying for additional permissions.

[0048] Specifically, in the Android system, the configuration files in various directories of the system files have been pre-modified, such as the app directory of the service application files, the framework directory, the sepolicy permission directory, etc., so that the Android system can respond to third-party applications. The third-party applications can first call the service proxy function in the Android system (expressed as IXxx.Stub proxy.function()) through the relevant content of the proxy call file in the software development kit (expressed as XxxManager.getInstance().function()), and then obtain the application function function (expressed as XxxApplication.function()) corresponding to the proxy call file in the Android system through the service proxy function. The application function function does not need to obtain system permissions, and can directly execute functions that require system permissions in the Android system, thereby providing functional support for third-party apps.

[0049] It should be noted that Xxx is the application name (such as POLICY, Policy, policy), and in the function, the application name is included to indicate that the function is used for the application (app) to call the function function. var function() is the function name, and the "function" can be customized according to the actual function requirements.

[0050] Further, in a feasible embodiment, the step of obtaining the object corresponding to the proxy call file in the Android system through the service proxy function may include:

[0051] Step S21, calling the service application program interface function in the Android system through the service proxy function;

[0052] Step S22, calling the corresponding functional service function through the service application program interface function, and then calling the corresponding application program functional function through the functional service function.

[0053] It can be understood that when a third-party application calls a related function in the Android system to execute a function, multiple functions need to be called in sequence. Specifically, in the step of obtaining the object corresponding to the proxy call file in the Android system through the service proxy function, it is also necessary to use the built-in function of the service application (i.e., the server app) in the Android system to participate in the calling process, including first calling the service application interface function in the Android system (expressed as IXxx.Stub proxy.function() of the server app) through the service proxy function (expressed as IXxx.Stub proxy.function()), then calling its corresponding function service function (expressed as XxxService.function()) through the service application interface function, and finally calling the corresponding application function function (expressed as XxxApplication.function) through the function service function, and the application function function is used to execute the corresponding function function.

[0054] For example, in combination with the contents of the foregoing embodiments, refer to Figure 2 The calling order of functions from the third-party app to the server app is as follows: first Xxx Manager.get Instance().function(), then IXxx.Stub proxy.function(), then IXxx.Stub.function() of the server app, then XxxService.function(), and finally XxxApplication.function().

[0055] In the technical solution of the embodiment of the present invention, by adding a proxy call file with only function names but no actual specific implementation in the SDK provided to the third-party app developer, the app of the third-party app developer can call the system permission function without obtaining system permissions through the pre-configured service applications and various functions in the Android system. Therefore, the SDK does not need to be encrypted and packaged, and the source code can be directly provided to the third-party application developer. This will not bring the risk of source code logic leakage, and improve the source code security of the software development kit. In addition, since the functions in the SDK are not specifically implemented, but are implemented by the Android system itself by calling the application function function, there is no need for the system signature file corresponding to the execution of certain commands that require system permissions to execute in the traditional solution. No signature is required, and the application can be directly installed, which saves the communication cost between the Android system and the third-party application developer, and enables developers to focus on the application logic of the app itself, so that the third-party app can be developed in the form of an independent app, improving the efficiency of software development.

[0056] In a feasible embodiment, before the step of calling the service proxy function in the Android system through the proxy calling file in the software development kit of the third-party application, the method may further include:

[0057] Step A10, generating a source domain name through the service application in the Android system to obtain the calling authority for other domain names;

[0058] Step A20, generating a target domain name through the service application to obtain the authority for the service application to be called.

[0059] Exemplarily, in the technical solution of an embodiment of the present invention, before a third-party application calls a service proxy function in the Android system, it is necessary to first obtain relevant sepolicy (a security-enhanced Linux policy) permissions of the Android system, wherein the sepolicy modification step is completed in the device directory of the Android system, and the last character of the sepolicy related file is a carriage return and line feed.

[0060] Specifically, on the one hand, in step A10, the server app (i.e., the service application) can obtain the calling authority to other domain names according to the source domain name agenew_xxx_app (xxx is the application name), and on the other hand, in step A20, the server app can be used as the target domain name agenew_xxx_service, so that other domain names including other third-party apps can call the authority of the server app. In the embodiment of the present invention, the domain name is generated in advance so that the service application and the third-party application can obtain the relevant calling authority from each other, which is convenient for smooth calling in the subsequent function calling process.

[0061] In a feasible embodiment, the Android system function calling method further includes:

[0062] Step B10, when the Android system is started, waking up the process of the service application through a preset system permission file;

[0063] The system permission file is used to provide system permissions for the service application and prevent the process from being terminated by other applications;

[0064] First, in an embodiment of the present invention, the app directory in the Android system template includes a system permission file, and the system permission file includes corresponding system permission fields, which can enable the service application to have system permissions. In this case, there is no need to declare most of the permission service applications in the system. In addition, the system permission file also includes a field that keeps the process of the service application in the background at all times. As long as the device corresponding to the Android system is turned on, the service application is awakened when the Android system starts. It has the highest priority and will not be killed by other applications.

[0065] Exemplarily, the directory of the system permission file of the server app can be expressed as "app directory / Xxx / AndroidManifest.xml", wherein the field android:shared UserId="android.uid.system" is added to the system permission file, so that the server app has most of the system permissions, and the field android:persistent="true" is added, which can wake up the server app when the computer is turned on, earlier than other third-party apps, and the process will not be killed, and the process will continue to exist in the Android background.

[0066] Step B20, initializing the service application, and adding the service application to the system service list of the Android system.

[0067] Specifically, in the service application template of the Android system, an initialization file can also be included. The file directory is represented as "app directory / Xxx / src / com / agenew / xxx / XxxApplication.java". The initialization function adds an Ibinder server XxxService, which can be used to implement the corresponding function of var function(). It also includes "app directory / Xxx / src / com / agenew / xxx / XxxService.java", which can implement the Ibinder (interface in Android development) server by inheriting IXxx.Stub. During initialization, the server app is added to the system service list through Service Manager.addService(XxxUtils.SERVICE, this).

[0068] In a feasible embodiment, the Android system function calling method may further include:

[0069] Step C10, registering the system service through a preset system service registration file, so that the third-party application can call the service proxy function.

[0070] In an embodiment of the present invention, the framework template of the Android system may also include a system service registration file, which is used to register the system service, which is equivalent to preparing for obtaining a proxy. After successful registration, when a third-party application runs and calls the proxy, the call can be successful; when not registered, if the third-party application runs and calls the proxy at this time, a null value will be returned.

[0071] Exemplarily, the file directory of the system service registration file can be expressed as "frameworks / base / core / java / android / app / SystemServiceRegistry.java", and the system service is registered through registerService.

[0072] In one possible embodiment, referring to Figure 3 In combination with the content of the aforementioned embodiment, in the service application file of the Android system, in addition to the aforementioned "app directory / Xxx / AndroidManifest.xml", "app directory / Xxx / src / com / agenew / xxx / XxxApplication.java", and "app directory / Xxx / src / com / agenew / xxx / XxxService.java", the file "app directory / Xxx / Android.mk" may also be included. In the above files, LOCAL_PACKAGE_NAME needs to be set to Xxx (application name) in advance. The file "app directory / Xxx / res / values / strings.xml" may also be included, in which app_name needs to be set to Xxx in advance. In addition, the service application file can also include the optional file "app directory / Xxx / src_for_user / com / agenew / xxx / XxxManager.java / / ". This file can be added to the SDK provided to third-party application developers. The third-party app developed by the third-party app developer can obtain the object through XxxManager.getInstance, and then execute various functional functions (functional functions that require system permissions) through the obtained object. The SDK file does not participate in system compilation, and all interfaces therein are left blank and do not need to be implemented. Only the function name needs to be included.

[0073] On the other hand, in the framework template of the Android system, the file "frameworks / base / core / java / com / agenew / xxx / IXxx.aidl" can also be included to declare interface IXxx and interface function varfunction(), where Xxx is the application name. In the framework template, the file "frameworks / base / core / java / com / agenew / xxx / XxxManager.java" can also be included. This file is different from the XxxManager.java provided to the third-party app developer. The above file is actually required to be implemented and is also the function function (i.e., the application function function) called when the third-party app is actually running. In the embodiment of the present invention, the server-side proxy can be obtained through IXxx.Stub.asInterface(b) to execute the function var function().

[0074] Optionally, in the framework template of the Android system in an embodiment of the present invention, the file "frameworks / base / config / hiddenapi-greylist.txt" can be included to provide customers with projects in the app directory / Xxx / src_for_user / com / agenew / xxx / XxxManager.java file, for example: Lcom / agenew / xxx / XxxManager; ->getInstance()Lcom / agenew / xxx / XxxManager; Lcom / agenew / xxx / XxxManager; ->function()Lvar.

[0075] An embodiment of the present invention provides an Android system function calling method. In the Android system function calling method, first, a proxy calling file of a third-party application in a software development kit is used to call a service proxy function in the Android system, and then the application function function corresponding to the proxy calling file in the Android system is obtained through the service proxy function, and finally the function corresponding to the application function function is executed in the Android system. The software development kit provided to the third-party application in the technical solution of the embodiment of the present invention includes a proxy calling file, and implements the function of the application function function through the service proxy function and the application function function, so the software development tool does not contain the source code corresponding to the implementation process of the application function function. In essence, the function in the software development kit in the technical solution of the present invention is not implemented, and the idea of ​​calling the application function function in the Android system is adopted to implement it. Therefore, the software development kit does not need to be encrypted and packaged, and can be directly provided to the third-party application developer as the source code, which will not bring the risk of source code logic leakage and improve the source code security of the software development kit. In addition, since the functions in the software development kit are not specifically implemented but are implemented by the Android system itself by calling application function functions, there is no need for the system signature files corresponding to the execution of certain commands that require system permissions to execute in the traditional solution. No signature is required and the application can be installed directly, saving the communication cost between the Android system and the third-party application developers.

[0076] The embodiment of the present invention also provides an Android system template, please refer to Figure 4 , the Android system template includes:

[0077] A service application template 10, the service application template at least comprising an interface service file 11 and a proxy call file 12, wherein the interface service file 11 is used to implement the function corresponding to the application function called by the third-party application, and the proxy call file 12 is used to be added to the software development tool provided to the developer of the third-party application, so that the third-party application can call the application function in the Android system;

[0078] The framework template 20 at least includes a run calling file 21 and a proxy acquisition file 22, wherein the run calling file 21 is used for the third-party application to call, run and implement, and the proxy acquisition file 22 is used to obtain a service proxy function.

[0079] In one embodiment, the service application template 10 further includes:

[0080] System permission file 13, used to provide system permissions for service applications and prevent the process from being terminated by other applications;

[0081] The initialization file 14 is used to initialize the service application and add the server to the system service list of the Android system.

[0082] In one embodiment, the frame template 20 further includes:

[0083] The system service registration file 23 is used to register the system service so that the third-party application can call the service proxy function;

[0084] The declaration file 24 is used to declare the interface name and interface function.

[0085] It should be noted that the above content does not constitute a specific limitation of the Android system template provided by the embodiment of the present invention. Those skilled in the art can also add other functional files (such as various types of files mentioned in the Android system function calling method) to the Android system template according to needs, which are all within the scope of the embodiment of the present invention. The Android system template is applied to the Android system function calling method in the above embodiment, which can solve the technical problem of low source code security in the software development kit. Compared with the prior art, the beneficial effects of the Android system template provided by the embodiment of the present invention are the same as the beneficial effects of the Android system function calling method provided by the above embodiment, and other technical features in the Android system template are the same as the features disclosed in the Android system function calling method in the previous embodiment, which will not be repeated here.

[0086] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the Android system function calling method in the above-mentioned embodiment one.

[0087] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0088] like Figure 5 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0089] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0090] The electronic device provided by the present invention adopts the method for calling the function of the Android system in the above embodiment, which can solve the technical problem of low source code security in the software development kit. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the present invention are the same as the beneficial effects of the method for calling the function of the Android system provided by the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0091] It should be understood that the various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0092] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0093] An embodiment of the present invention also provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the Android system function calling method in the above-mentioned embodiment 1.

[0094] The computer-readable storage medium provided in the embodiment of the present invention may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0095] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0096] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device: calls the service proxy function in the Android system through the proxy call file of the third-party application in the software development kit; obtains the application function corresponding to the proxy call file in the Android system through the service proxy function; and executes the function corresponding to the application function function in the Android system.

[0097] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0098] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0099] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.

[0100] The readable storage medium provided by the present invention is a computer-readable storage medium, which stores computer-readable program instructions for executing the above-mentioned method for calling the function of the Android system, and can solve the technical problem of low source code security in the software development kit. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the embodiment of the present invention are the same as the beneficial effects of the method for calling the function of the Android system provided in the above-mentioned embodiment 1, and will not be repeated here.

[0101] An embodiment of the present invention also provides a computer program product, including a computer program, which implements the steps of the above-mentioned Android system function calling method when executed by a processor.

[0102] The computer program product provided by the present invention can solve the technical problem of low source code security in the software development kit. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present invention are the same as the beneficial effects of the Android system function calling method provided by the above-mentioned embodiment 1, and will not be repeated here.

[0103] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent scope of the present invention.

Claims

1. A method for calling an Android system function, characterized in that: The Android system function calling method includes: Calling a service proxy function in the Android system through a proxy calling file of a third-party application in a software development kit, wherein the proxy calling file only includes a function name to call an application function in the Android system; Obtaining the application function corresponding to the proxy call file in the Android system through the service proxy function; Execute the function corresponding to the application function in the Android system; The step of obtaining the application function corresponding to the proxy call file in the Android system through the service proxy function includes: Calling a service application program interface function in the Android system through the service proxy function; The corresponding functional service function is called through the service application program interface function, and then the application program functional function corresponding to the proxy calling file is called through the functional service function.

2. The method for calling an Android system function as claimed in claim 1, wherein: Before the step of calling the service proxy function in the Android system through the proxy calling file in the software development kit of the third-party application, the method further includes: Generate a source domain name through a service application in the Android system to obtain calling authority for other domain names; A target domain name is generated through the service application to obtain the authority for the service application to be called.

3. The method for calling an Android system function as claimed in claim 1, wherein: The method further comprises: When the Android system is started, the process of the service application is awakened through a preset system permission file; The system permission file is used to provide system permissions for the service application and prevent the process from being terminated by other applications; Initialize the service application and add the service application to the system service list of the Android system.

4. The method for calling an Android system function as claimed in claim 1, wherein: The Android system function calling method also includes: The system service is registered through a preset system service registration file so that the third-party application can call the service proxy function.

5. An Android system function call template, characterized in that: The Android system function call template includes: A service application template, the service application template at least comprising an interface service file and a proxy call file, wherein the interface service file is used to implement the function corresponding to the application function called by the third-party application, the proxy call file is used to be added to the software development tool provided to the developer of the third-party application, and the proxy call file only comprises a function name for the third-party application to call the application function in the Android system; A framework template, the framework template at least includes a run calling file and a proxy acquisition file, wherein the run calling file is used for the third-party application to call, run and implement, the proxy acquisition file is used to obtain a service proxy function, the service proxy function is used to call a service application interface function in the Android system, the service application interface function is used to call a corresponding functional service function, and the functional service function is used to call an application functional function corresponding to the proxy calling file.

6. The Android system function calling template as claimed in claim 5, characterized in that: The service application template also includes: System permission files are used to provide system permissions to service applications and prevent them from being terminated by other applications. The initialization file is used to initialize the service application and add the server to the system service list of the Android system.

7. The Android system function calling template as claimed in claim 5, characterized in that: The framework template also includes: A system service registration file, used to register system services so that the third-party application can call service proxy functions; Declaration file, used to declare interface names and interface functions.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the Android system function calling method as described in any one of claims 1 to 4.

9. A readable storage medium, characterized in that: The readable storage medium is a computer-readable storage medium, on which is stored a program for implementing the method for calling an Android system function function. The program for implementing the method for calling an Android system function function is executed by a processor to implement the steps of the method for calling an Android system function function as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and device for implementing unauthorized android application to obtain system privilege

    CN109033802A