CN112988561B - Method, device, server and storage medium for detecting display configuration code - Google Patents

Method, device, server and storage medium for detecting display configuration code Download PDF

Info

Publication number
CN112988561B
CN112988561B CN201911307741.3A CN201911307741A CN112988561B CN 112988561 B CN112988561 B CN 112988561B CN 201911307741 A CN201911307741 A CN 201911307741A CN 112988561 B CN112988561 B CN 112988561B
Authority
CN
China
Prior art keywords
code
android
display
display configuration
statement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911307741.3A
Other languages
Chinese (zh)
Other versions
CN112988561A (en
Inventor
张蓓
张通人
周洪斌
严明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911307741.3A priority Critical patent/CN112988561B/en
Publication of CN112988561A publication Critical patent/CN112988561A/en
Application granted granted Critical
Publication of CN112988561B publication Critical patent/CN112988561B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure relates to a method, a device, a server and a storage medium for detecting a display configuration code, and belongs to the technical field of electronics. The method comprises the following steps: acquiring code features corresponding to all to-be-checked questions of the comprehensive screen; determining code characteristics which are consistent with the display configuration codes to be detected in the code characteristics corresponding to the questions to be checked; and if the display configuration code accords with at least one code feature, sending prompt information to a terminal for uploading the display configuration code, wherein the prompt information is used for prompting that the display configuration code has a display adaptation problem. By adopting the method and the device, the server can automatically detect the potential display adaptation problem in the display configuration code to be detected, and compared with the operation that the application program to be distributed is installed in a large number of true machines for testing, the method and the device for detecting the display adaptation problem are faster in processing speed and shorter in time consumption.

Description

Method, device, server and storage medium for detecting display configuration code
Technical Field
The present disclosure relates to the field of electronics, and in particular, to a method, an apparatus, a server, and a storage medium for detecting a display configuration code.
Background
Along with the development of technology, the common screen commonly used on the terminal is gradually replaced by a comprehensive screen, and the comprehensive screen can be further divided into Liu Haibing, a water drop screen, a punching screen and the like.
A developer of an application program writes display configuration codes of a UI (User Interface) for implementing the application program in a display configuration file of the application program. In the process of running the application program, the terminal can actually display the UI of the application program according to the display configuration file.
Before any developed application program is finally released, a technician can install and run the application program to be released on the true machines with different brands and different models so as to test whether the UI of the application program to be released can be successfully matched with the display screens of all the true machines, especially whether the UI can be successfully matched with the comprehensive screens of some true machines, because the probability of the display adaptation problem occurring in the comprehensive screens is generally high.
In carrying out the present disclosure, the inventors found that there are at least the following problems:
in the process of testing whether the UI can be successfully adapted to the comprehensive screens of different true machines, the application programs to be distributed need to be installed into a large number of true machines one by one to be tested, and the whole testing process takes a long time.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides the following technical solutions:
according to a first aspect of embodiments of the present disclosure, there is provided a method of detecting a display configuration code, the method comprising:
acquiring code features corresponding to all to-be-checked questions of the comprehensive screen;
determining code characteristics which are consistent with the display configuration codes to be detected in the code characteristics corresponding to the problems to be checked;
and if the display configuration code accords with at least one code feature, sending prompt information to a terminal uploading the display configuration code, wherein the prompt information is used for prompting that the display configuration code has a display adaptation problem.
Optionally, the code feature includes at least one of:
the display configuration parameters of the preset types in the codes are not set in a preset range;
any section of code in a preset adaptive code set does not exist in the codes;
any code in the preset conflict code set exists in the codes.
Optionally, before determining the code feature to be detected to which the display configuration code corresponds, the method further comprises:
acquiring an operation code of an application program to be detected;
decompiling the running code to obtain java source code of the application program to be detected;
and determining a display configuration code to be detected in the java source code.
Optionally, if the display configuration code meets at least one code feature, sending a prompt message to a terminal that uploads the display configuration code, including:
if the display configuration code accords with at least one code feature, determining target troubleshooting problems respectively corresponding to the at least one code feature;
and sending prompt information carrying the target troubleshooting problem to the terminal which uploads the display configuration code.
Optionally, before acquiring the code features corresponding to each to-be-checked question of the comprehensive screen, the method further includes:
acquiring display adaptation problem information of a comprehensive screen in information published by a preset display adaptation problem publishing website;
and determining code features corresponding to the to-be-checked questions of the comprehensive screen based on the display adaptation question information.
According to a second aspect of embodiments of the present disclosure, there is provided an apparatus for detecting a display configuration code, the apparatus comprising:
the acquisition module is used for acquiring code features corresponding to each to-be-checked question of the comprehensive screen;
the determining module is used for determining code characteristics which are consistent with the display configuration codes to be detected in the code characteristics corresponding to the problems to be checked;
and the sending module is used for sending prompt information to the terminal for uploading the display configuration code when the display configuration code accords with at least one code characteristic, wherein the prompt information is used for prompting that the display configuration code has a display adaptation problem.
Optionally, the code feature includes at least one of:
the display configuration parameters of the preset types in the codes are not set in a preset range;
any section of code in a preset adaptive code set does not exist in the codes;
any code in the preset conflict code set exists in the codes.
Optionally, the acquiring module is further configured to acquire an operation code of the application program to be detected;
the apparatus further comprises:
the decompilation module is used for decompiling the running code to obtain java source code of the application program to be detected;
the determining module is further used for determining a display configuration code to be detected in the java source code.
Optionally, the sending module is configured to:
if the display configuration code accords with at least one code feature, determining target troubleshooting problems respectively corresponding to the at least one code feature;
and sending prompt information carrying the target troubleshooting problem to the terminal which uploads the display configuration code.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring the display adaptation problem information of the comprehensive screen in the information published by the preset display adaptation problem publishing website;
and the determining module is also used for determining code features corresponding to the to-be-checked questions of the comprehensive screen based on the display adaptation question information.
According to a third aspect of embodiments of the present disclosure, there is provided a server comprising a processor, a communication interface, a memory and a communication bus, wherein:
the processor, the communication interface and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to execute the program stored in the memory, so as to implement the method for detecting the display configuration code.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the above-described method of detecting a display configuration code.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
by the method provided by the embodiment of the disclosure, the server can automatically detect possible to-be-checked problems in the to-be-detected display configuration code, and when the to-be-detected display configuration code accords with any code characteristic, the server indicates that the to-be-detected display configuration code has a potential display adaptation problem, and can send prompt information to the terminal of the to-be-detected display configuration code based on the detection result. By adopting the method and the device, the server can automatically detect the potential display adaptation problem in the display configuration code to be detected, and compared with the operation that the application program to be distributed is installed in a large number of true machines for testing, the method and the device for detecting the display adaptation problem are faster in processing speed and shorter in time consumption.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. In the drawings:
FIG. 1 is a flow chart illustrating a method of detecting a display configuration code according to an exemplary embodiment;
FIG. 2 is a schematic diagram of a system for detecting display configuration codes, according to an exemplary embodiment;
FIG. 3 is an interface schematic diagram of an installation package quality inspection platform, according to an example embodiment;
FIG. 4 is a flow chart illustrating a method of detecting a display configuration code according to an exemplary embodiment;
FIG. 5 is a flow chart illustrating a method of detecting a display configuration code according to an exemplary embodiment;
FIG. 6 is a schematic diagram showing a display of an adaptation problem report, according to an example embodiment;
FIG. 7 is a flowchart illustrating a method of detecting a display configuration code, according to an example embodiment;
FIG. 8 is a schematic diagram illustrating an apparatus for detecting a display configuration code according to an exemplary embodiment;
fig. 9 is a schematic diagram illustrating a structure of a server according to an exemplary embodiment.
Specific embodiments of the present disclosure have been shown by way of the above drawings and will be described in more detail below. These drawings and the written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the disclosed concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The embodiment of the disclosure provides a method for detecting a display configuration code, which can be realized by a server.
An exemplary embodiment of the present disclosure provides a method for detecting a display configuration code, as shown in fig. 1, a process flow of the method may include the steps of:
step S101, code features corresponding to all to-be-checked questions of the comprehensive screen are obtained.
In practice, after the developer has programmed the program code of the application to be detected, the terminal may generate an installation package of the application to be detected based on the program code. The application program to be detected may be an application program needing to be displayed and run in full screen, such as a game application program. As shown in fig. 2, a developer may upload an installation package of an application to be detected to an installation package quality detection platform, and a schematic view of a display interface of the installation package quality detection platform is shown in fig. 3. The installation package quality detection platform can run in a server, and the server can run based on Linux (Linux is a set of freely used and freely spread Unix-like operating systems, which is a multi-user, multi-tasking, multi-thread and multi-CPU supporting operating system based on POSIX and Unix). After the installation package quality detection platform obtains the installation package of the application to be detected, some problems that may exist in the installation package of the application to be detected, such as problems regarding display adaptation that may occur when the application to be detected is installed in a terminal equipped with a full screen, may be examined.
After the installation package quality detection platform obtains the installation package of the application program to be detected, code features corresponding to all the to-be-checked questions of the comprehensive screen can be obtained, the code features corresponding to different to-be-checked questions can be collected in advance, and the code features corresponding to all the to-be-checked questions are stored. The problems to be examined may include problems with black edges on top of the full screen, system status bars blocking the UI of the application to be detected, flashing back of the application to be detected, and other types of display adaptations. The presented code characteristics may be different for each type of display adaptation problem, and the same display adaptation problem may correspond to multiple code characteristics, which may result in the occurrence of a corresponding display adaptation problem whenever the code to be detected has any of the code characteristics. Code features corresponding to different to-be-checked questions can be acquired in advance, and the code features corresponding to the to-be-checked questions are stored.
Optionally, before acquiring the code features corresponding to each to-be-checked question of the full screen, the method provided by the embodiment of the disclosure may further include: acquiring display adaptation problem information of a comprehensive screen in information published by a preset display adaptation problem publishing website; and determining code features corresponding to the to-be-checked questions of the comprehensive screen based on the display of the adaptation question information.
In implementation, as shown in fig. 4, a plurality of display adaptation problem issuing websites, for example, each big game website, a official network of each big terminal manufacturer, an official network of android, and the like may be preset. There are a large number of display adaptation problems that have been discovered or may occur, and corresponding solutions, published in each display adaptation problem publication website. The acquisition keywords can be preset, and the display adaptation problem information about the comprehensive screen matched with the acquisition keywords is searched in the information published in each display adaptation problem publishing website based on the acquisition keywords. Extracting code features corresponding to the to-be-checked problem from the displayed adaptation problem information, and storing the code features corresponding to the to-be-checked problem into an adaptation rule database.
Step S102, determining code characteristics which are consistent with the display configuration codes to be detected in the code characteristics corresponding to the problems to be checked.
In implementation, after the installation package quality detection platform obtains the installation package of the application program to be detected, code features corresponding to each to-be-checked problem of the comprehensive screen can be obtained, and the code features can also be conditions for generating the display adaptation problem. When any code to be detected has any code characteristic, or when any code to be detected satisfies a condition that a display adaptation problem occurs, it can be considered that a display adaptation problem exists in the code to be detected.
Alternatively, the code feature may include that a preset type of display configuration parameter in the code is not set within a preset range.
As shown in fig. 5, the installation package quality detection platform may obtain the uploaded installation package, parse the installation package, and obtain the to-be-detected display configuration code of the to-be-detected application program. The display configuration code to be detected may be stored in an android maniflex.xml file, so that the android maniflex.xml file may be obtained and parsed. A plurality of display configuration sentences are stored in the android maniflex.xml file, and the display configuration sentences can be acquired to verify the display configuration sentences. For example, a statement may be obtained in an android maniflex. Xml file stating the ratio of the height to width of the largest display screen supported, such as an android: maxalpectratio or an android: name= "android. Max_aspect" statement. If the statement exists, the supported maximum ratio of the statement can be determined, and whether the maximum ratio is greater than or equal to a preset threshold value, such as 2.4 is judged. If the maximum ratio is greater than or equal to the preset threshold, the verification is passed, and if the maximum ratio is less than the preset threshold, the verification is failed. If the maximum ratio is smaller than the preset threshold, the ratio of the height and the width of the display screen which is only supported by the application program to be detected is smaller than the terminal of the stated supported maximum ratio, and if the application program to be detected is operated on the terminal exceeding the stated supported maximum ratio, black edges are likely to exist in the part of the display area exceeding the stated supported maximum ratio. If the above statement sentence is not present and the application to be detected is run on the terminal whose ratio of height to width exceeds 1.86, it is likely that a black border exists in the portion of the display area exceeding 1.86. It should be noted that before detecting whether the declaration statement exists, whether the declaration statement is validated may be detected, for example, whether the value of android: resemblance is false may be detected, if the value of android: resemblance is false, the declaration statement is validated, otherwise, the verification is passed.
The statement that no android: maxAspectRatio or android: name= "android.max_aspect" exists as the code feature with black edges in the partial display area, and meanwhile, the actual assignment of android: maxAspectRatio or android: name= "android.max_aspect" does not exceed 2.4 as the code feature with black edges in the partial display area, so that a plurality of code features corresponding to the same display adaptation problem can be obtained.
Step S103, if the display configuration code accords with at least one code feature, prompt information for prompting that the display configuration code has a display adaptation problem is sent to the terminal.
In an implementation, if the display configuration code can conform to any code feature corresponding to each challenge to be examined, a prompt message for prompting that the display configuration code has a display adaptation problem may be displayed. In some cases, multiple display adaptation problems may occur at the same time for the same display configuration code, and thus the display configuration code may conform to multiple code features. When the display configuration code accords with at least one code feature, the display configuration code can be determined to have the display adaptation problem, and further prompt information for prompting the display configuration code to have the display adaptation problem can be displayed.
Alternatively, step S103 may include: if the display configuration code accords with at least one code feature, determining target investigation problems corresponding to the at least one code feature respectively, and sending prompt information for prompting that the display configuration code has the target investigation problems to the terminal.
In implementation, the display configuration code can be directly prompted to have a display adaptation problem, and the specific display adaptation problem of the display configuration code can be determined one by one. And determining the target investigation problems corresponding to the at least one code feature respectively, and sending prompt information for prompting the display of the target investigation problems of the configuration code to the terminal. As shown in fig. 6, after receiving the prompt information, the terminal may display the prompt information, may display the potential problem in the display configuration code in the form of a report, and the research and development technician may adjust the display configuration code based on the prompt information.
By the method provided by the embodiment of the disclosure, the server can automatically detect possible to-be-checked problems in the to-be-detected display configuration code, and when the to-be-detected display configuration code accords with any code characteristic, the server indicates that the to-be-detected display configuration code has a potential display adaptation problem, and can send prompt information to the terminal of the to-be-detected display configuration code based on the detection result. By adopting the method and the device, the server can automatically detect the potential display adaptation problem in the display configuration code to be detected, and compared with the operation that the application program to be distributed is installed in a large number of true machines for testing, the method and the device for detecting the display adaptation problem are faster in processing speed and shorter in time consumption.
An exemplary embodiment of the present disclosure provides a method for detecting a display configuration code, as shown in fig. 7, a process flow of which may include the steps of:
step S701, obtaining code features corresponding to each question to be checked of the comprehensive screen.
In implementation, code features corresponding to all the to-be-checked questions of the comprehensive screen can be acquired, code features corresponding to different to-be-checked questions can be acquired in advance, and the code features corresponding to all the to-be-checked questions are stored. The problems to be examined may include problems with black edges on top of the full screen, system status bars blocking the UI of the application to be detected, flashing back of the application to be detected, and other types of display adaptations. The presented code characteristics may be different for each type of display adaptation problem, and the same display adaptation problem may correspond to multiple code characteristics, which may result in the occurrence of a corresponding display adaptation problem whenever the code to be detected has any of the code characteristics. Code features corresponding to different to-be-checked questions can be acquired in advance, and the code features corresponding to the to-be-checked questions are stored.
Step S702, the running code of the application to be detected is obtained.
In implementation, after a developer writes a program code of an application program to be detected, the terminal may generate an installation package of the application program to be detected based on the program code, the developer may upload the installation package of the application program to be detected to an installation package quality detection platform, and the installation package quality detection platform may perform an installation process on the application program to be detected based on the installation package of the application program to be detected, so as to obtain an operation code of the application program to be detected, such as a dex type file.
Step S703, decompiling the running code to obtain the java source code of the application program to be detected.
In an implementation, after the running code of the application program to be detected is obtained, decompilation processing may be performed on the running code to obtain a program source code, such as a java source code, of the application program to be detected. Because some display configuration codes are not in the running codes of the application program to be detected, but in the program source codes of the application program to be detected, decompilation processing can be performed on the running codes to obtain java source codes of the application program to be detected. Or, the research and development technician can directly upload the java source code of the application program to be detected to the installation package quality detection platform. By means of decompiling the running codes to obtain java source codes, the data volume of data transmitted between the terminal and the server can be saved.
Step S704, in the java source code, determining a display configuration code to be detected.
In an implementation, code for performing display configuration may be determined in java source code.
Step S705, determining the code feature which is consistent with the display configuration code to be detected in the code features corresponding to each question to be checked.
In implementation, after the installation package quality detection platform obtains the installation package of the application program to be detected, code features corresponding to each to-be-checked problem of the comprehensive screen can be obtained, and the code features can also be conditions for generating the display adaptation problem. When any code to be detected has any code characteristic, or when any code to be detected satisfies a condition that a display adaptation problem occurs, it can be considered that a display adaptation problem exists in the code to be detected.
Alternatively, the code feature may include any piece of code in which no preset fit code set exists or any group of code in which a preset conflict code set exists.
For example, the installation package quality detection platform can obtain the uploaded installation package, analyze the installation package, decompil the running code to obtain java source code. Detecting whether a sentence calling a getWindow (). AddFlags (Window manager. LayoutParms. FLAG_FULLSCREEN) interface exists in java source code, if so, passing the detection, and if not, blocking the UI of an application program to be detected by a system status bar. The function of the interface is to hide the system status bar, if the interface is not called, the system status bar will not be hidden, especially when the UI of the application to be detected is displayed in full screen, the UI top and the system status bar will overlap. The statement that the interface is called can be stored in a preset adaptation code set, and if any section of code in the preset adaptation code set does not exist in the display configuration code to be detected, verification fails.
For another example, the installation package quality detection platform may obtain the uploaded installation package, parse the installation package, decompil the running code to obtain the java source code. Detecting whether a sentence that the main NATIVE class inherits in the ActionBarAbctity exists in java source code, if the sentence does not exist, verifying to pass, if the sentence does not exist, detecting whether the value of an android: the name is @ android: style/the name. NoTitleBar. Fullscreen in an android Manifex. Xml file, if the sentence does not exist, verifying to pass, if the sentence does not exist, default setting a theme in the ActionBarAbctity, and if the value of the android: the name is @ android: style/the name. NoTitleBar. Fullscreen, canceling the theme, and the two sections of codes conflict, so that flash back of an application program to be detected can occur. The set of codes with the conflict between the two sections can be stored in a preset conflict code set, and if any set of codes in the preset conflict code set exists in the display configuration code to be detected, verification fails.
For another example, the installation package quality detection platform may obtain the uploaded installation package, parse the installation package, decompil the running code to obtain the java source code. Detecting whether sentences for judging the current display screen to be a full screen exist in java source codes, and judging whether display adaptation processing is carried out on terminals manufactured by different manufacturers when the current display screen is judged to be the full screen. For Hua mobile phones, if com.huawei.android.uteil.HwNotchSizeUtil exists, the application program to be detected judges whether the current display screen is a full screen of Hua. For the Vivo mobile phone, if the android.util.ftfeature exists, the application program to be detected judges whether the current display screen is a comprehensive screen of the Vivo. For the Oppo handset, if there is a com. For the millet mobile phone, if android.os.System properties exist, the application program to be detected is indicated to judge whether the current display screen is a full screen of the millet. After judging that the current display screen is the full screen of any brand, the display adaptation processing can be performed according to the characteristics of different brands. For Hua mobile phones, display adaptation processing can be achieved by calling the hasNotchInScreen interface. For the Vivo cell phone, the display adaptation process can be implemented by invoking the getDeclaredMethods interface. For millet mobile phones, display adaptation processing can be achieved by calling a ro.miui.notch interface. For the valley singer, if the version is higher than the version of the building. VERSION_CODES.P, the display adaptation process can be realized by calling the getDisplayCutout interface. The sentences can be stored in a preset adaptation code set, and if any section of code in the preset adaptation code set does not exist in the display configuration code to be detected, verification fails.
Optionally, if the display configuration code accords with at least one code feature, determining the target troubleshooting problem corresponding to the at least one code feature respectively, and displaying prompt information for prompting that the display configuration code has the target troubleshooting problem.
In the implementation, in the example, if the research and development technician does not write in the java source code in the sentence for judging whether the current display screen is the full screen, the application program to be detected may be displayed by the same display method when running in the mobile phones of different brands, in this case, if the current display screen is a common screen, the problem may not be generated yet, if the current display screen is the full screen, the problem of display adaptation may be generated very likely, and further, the problem of display adaptation may be determined to be the full screen of the mobile phones which do not support each large brand, and the report of the problem of display adaptation may be output. Or if the research and development technician does not write in the java source code and call the interface for performing display adaptation on the full screen of each large-brand mobile phone, the display adaptation processing is not performed in the running process of the application program to be detected, so that the mobile phone of the target brand corresponding to the specific non-called interface can be determined, and a list of mobile phones of the target brands which are not supported is output.
Step S706, if the display configuration code accords with at least one code feature, a prompt message for prompting that the display configuration code has a display adaptation problem is sent to the terminal.
In an implementation, if the display configuration code accords with at least one code feature, a display adaptation problem report may be output, a display adaptation problem that is specifically existed in the application program to be detected may be specifically pointed out in the display adaptation problem report, the display adaptation problem report is sent to the terminal, and the terminal may display the display adaptation problem report.
By the method provided by the embodiment of the disclosure, the server can automatically detect possible to-be-checked problems in the to-be-detected display configuration code, and when the to-be-detected display configuration code accords with any code characteristic, the server indicates that the to-be-detected display configuration code has a potential display adaptation problem, and can send prompt information to the terminal of the to-be-detected display configuration code based on the detection result. By adopting the method and the device, the server can automatically detect the potential display adaptation problem in the display configuration code to be detected, and compared with the operation that the application program to be distributed is installed in a large number of true machines for testing, the method and the device for detecting the display adaptation problem are faster in processing speed and shorter in time consumption.
Yet another exemplary embodiment of the present disclosure provides an apparatus for detecting a display configuration code, as shown in fig. 8, the apparatus including:
an obtaining module 801, configured to obtain code features corresponding to each to-be-examined question on the full screen;
a determining module 802, configured to determine, among code features corresponding to the to-be-examined questions, code features that the to-be-detected display configuration code conforms to;
and a sending module 803, configured to send a prompt message to a terminal that uploads the display configuration code when the display configuration code meets at least one code feature, where the prompt message is used to prompt that the display configuration code has a display adaptation problem.
Optionally, the code feature includes at least one of:
the display configuration parameters of the preset types in the codes are not set in a preset range;
any section of code in a preset adaptive code set does not exist in the codes;
any code in the preset conflict code set exists in the codes.
Optionally, the acquiring module 801 is further configured to acquire an operation code of an application to be detected;
the apparatus further comprises:
the decompilation module is used for decompiling the running code to obtain java source code of the application program to be detected;
the determining module 802 is further configured to determine a display configuration code to be detected in the java source code.
Optionally, the sending module 803 is configured to:
if the display configuration code accords with at least one code feature, determining target troubleshooting problems respectively corresponding to the at least one code feature;
and sending prompt information carrying the target troubleshooting problem to the terminal which uploads the display configuration code.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring the display adaptation problem information of the comprehensive screen in the information published by the preset display adaptation problem publishing website;
the determining module 802 is further configured to determine code features corresponding to the to-be-investigated question of the full screen based on the display adaptation question information.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
By the device provided by the embodiment of the disclosure, the server can automatically detect possible to-be-checked problems in the to-be-detected display configuration code, and when the to-be-detected display configuration code accords with any code characteristic, the server indicates that the to-be-detected display configuration code has a potential display adaptation problem, and can send prompt information to the terminal of the to-be-detected display configuration code based on the detection result. By adopting the method and the device, the server can automatically detect the potential display adaptation problem in the display configuration code to be detected, and compared with the operation that the application program to be distributed is installed in a large number of true machines for testing, the method and the device for detecting the display adaptation problem are faster in processing speed and shorter in time consumption.
It should be noted that: the device for detecting the display configuration code provided in the above embodiment only illustrates the division of the above functional modules when detecting the display configuration code, and in practical application, the above functional allocation may be completed by different functional modules according to needs, that is, the internal structure of the server is divided into different functional modules to complete all or part of the functions described above. In addition, the device for detecting the display configuration code provided in the above embodiment belongs to the same concept as the method embodiment for detecting the display configuration code, and the specific implementation process is detailed in the method embodiment, which is not described herein again.
Fig. 9 shows a schematic structural diagram of a server 1900 provided in an exemplary embodiment of the present disclosure. The server 1900 may vary considerably in configuration or performance and may include one or more processors (central processing units, CPU) 1910 and one or more memories 1920. Wherein the memory 1920 stores at least one instruction that is loaded and executed by the processor 1910 to implement the method for detecting display configuration codes described in the above embodiments.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (12)

1. A method of detecting a display configuration code, the method comprising:
acquiring code features corresponding to all to-be-checked questions of a comprehensive screen, wherein the to-be-checked questions comprise that black edges exist in part of a display area, and the code features corresponding to the black edges exist in part of the display area comprise that no android: maxaspasteratio statement exists, no android: name= "android. Max_aspect" statement, an android: maxaspasteratio statement or an android: name= "android. Max_aspect" statement is smaller than a preset threshold, and the android: maxaspasteratio statement and the android: name= "android. Max_aspect" statement are statement that declares the ratio of the height to the width of the supported maximum display screen;
analyzing an installation package of an application program to be detected, obtaining an android management file and analyzing the android management file, wherein a display configuration code is stored in the android management file;
judging whether the android:maxaspectratio statement and the android:name= "android.max_aspect" statement exist in the android manifest;
if the android management statement does not exist in the android xml file and the android name= "android. Max_aspect" statement does not exist, determining that the display configuration code accords with the code feature corresponding to the existence of black edges in a part of display areas;
if the android management statement or the android name= "android. Max_aspect" statement exists in the android xml file, determining whether the ratio of the height and the width of the maximum display screen supported by the android name= "android. Max_aspect" statement or the android name= "android. Max_aspect" statement is greater than or equal to a preset threshold value;
if the ratio is smaller than the preset threshold value, determining that the display configuration code accords with the code characteristics corresponding to the black edges in part of the display area;
and if the display configuration code accords with at least one code feature, sending prompt information to a terminal uploading the display configuration code, wherein the prompt information is used for prompting that the display configuration code has a display adaptation problem.
2. The method of claim 1, wherein the code features include at least one of:
the display configuration parameters of the preset type in the display configuration code are not set in a preset range;
any section of code in a preset adaptation code set does not exist in the display configuration code;
any group of codes in a preset conflict code set exists in the display configuration codes.
3. The method according to claim 1, wherein the method further comprises:
acquiring an operation code of an application program to be detected;
decompiling the running code to obtain java source code of the application program to be detected;
and determining a display configuration code to be detected in the java source code.
4. The method according to claim 1, wherein if the display configuration code meets at least one code feature, the sending a prompt message to the terminal that uploads the display configuration code includes:
if the display configuration code accords with at least one code feature, determining target troubleshooting problems respectively corresponding to the at least one code feature;
and sending prompt information carrying the target troubleshooting problem to the terminal which uploads the display configuration code.
5. The method of claim 1, wherein prior to acquiring the code features corresponding to each challenge question of the full screen, the method further comprises:
acquiring display adaptation problem information of a comprehensive screen in information published by a preset display adaptation problem publishing website;
and determining code features corresponding to the to-be-checked questions of the comprehensive screen based on the display adaptation question information.
6. An apparatus for detecting a display configuration code, the apparatus comprising:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring code characteristics corresponding to each to-be-checked question of a comprehensive screen, the to-be-checked question comprises a part of display area with black edges, the code characteristics corresponding to the part of display area with black edges comprise a statement that no android is present, and no android is present, wherein the statement comprises a name= "android.max_aspect", an android is smaller than a preset threshold, and the value of the name = "android.max_aspect" is smaller than a preset threshold, and the statement of the android is a statement of the ratio of the height to the width of the maximum display screen supported by the statement of the name = "android.max_aspect";
the determining module is used for analyzing an installation package of the application program to be detected, obtaining an android management file and analyzing the android management file, wherein a display configuration code is stored in the android management file; judging whether the android:maxaspectratio statement and the android:name= "android.max_aspect" statement exist in the android manifest; if the android management statement does not exist in the android xml file and the android name= "android. Max_aspect" statement does not exist, determining that the display configuration code accords with the code feature corresponding to the existence of black edges in a part of display areas; if the android management statement or the android name= "android. Max_aspect" statement exists in the android xml file, determining whether the ratio of the height and the width of the maximum display screen supported by the android name= "android. Max_aspect" statement or the android name= "android. Max_aspect" statement is greater than or equal to a preset threshold value; if the ratio is smaller than the preset threshold value, determining that the display configuration code accords with the code characteristics corresponding to the black edges in part of the display area;
and the sending module is used for sending prompt information to the terminal for uploading the display configuration code when the display configuration code accords with at least one code characteristic, wherein the prompt information is used for prompting that the display configuration code has a display adaptation problem.
7. The apparatus of claim 6, wherein the code features comprise at least one of:
the display configuration parameters of the preset type in the display configuration code are not set in a preset range;
any section of code in a preset adaptation code set does not exist in the display configuration code;
any group of codes in a preset conflict code set exists in the display configuration codes.
8. The apparatus of claim 6, wherein the acquisition module is further configured to acquire an operating code of an application to be detected;
the apparatus further comprises:
the decompilation module is used for decompiling the running code to obtain java source code of the application program to be detected;
the determining module is further used for determining a display configuration code to be detected in the java source code.
9. The apparatus of claim 6, wherein the transmitting module is configured to:
if the display configuration code accords with at least one code feature, determining target troubleshooting problems respectively corresponding to the at least one code feature;
and sending prompt information carrying the target troubleshooting problem to the terminal which uploads the display configuration code.
10. The apparatus of claim 6, wherein the apparatus further comprises:
the acquisition module is used for acquiring the display adaptation problem information of the comprehensive screen in the information published by the preset display adaptation problem publishing website;
and the determining module is also used for determining code features corresponding to the to-be-checked questions of the comprehensive screen based on the display adaptation question information.
11. A server comprising a processor, a communication interface, a memory, and a communication bus, wherein:
the processor, the communication interface and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to execute a program stored on the memory to implement the method steps of any one of claims 1-5.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-5.
CN201911307741.3A 2019-12-18 2019-12-18 Method, device, server and storage medium for detecting display configuration code Active CN112988561B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911307741.3A CN112988561B (en) 2019-12-18 2019-12-18 Method, device, server and storage medium for detecting display configuration code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911307741.3A CN112988561B (en) 2019-12-18 2019-12-18 Method, device, server and storage medium for detecting display configuration code

Publications (2)

Publication Number Publication Date
CN112988561A CN112988561A (en) 2021-06-18
CN112988561B true CN112988561B (en) 2023-09-08

Family

ID=76343802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911307741.3A Active CN112988561B (en) 2019-12-18 2019-12-18 Method, device, server and storage medium for detecting display configuration code

Country Status (1)

Country Link
CN (1) CN112988561B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110084693A (en) * 2010-01-18 2011-07-26 (주)쉬프트웍스 Method of examining malicious codes and dangerous files in android terminal platform
CN103118290A (en) * 2013-02-28 2013-05-22 北京奇虎科技有限公司 Detection method, device and system of suitability of program installation
CN104142881A (en) * 2013-05-07 2014-11-12 腾讯科技(深圳)有限公司 Adaptive defect detecting method and device of application program programming interfaces
WO2015058670A1 (en) * 2013-10-21 2015-04-30 中国移动通信集团公司 Display content processing method and device
WO2015078566A1 (en) * 2013-11-27 2015-06-04 Gmc Software Ag System and method for testing data representation for different mobile devices
WO2015156809A1 (en) * 2014-04-10 2015-10-15 Hewlett-Packard Development Company, L.P. Generalized snapshots based on multiple partial snapshots
WO2016206559A1 (en) * 2015-06-23 2016-12-29 阿里巴巴集团控股有限公司 Method and device for full size adaptation of object to be displayed
CN107133165A (en) * 2017-03-22 2017-09-05 腾讯科技(深圳)有限公司 Browser compatibility detection method and device
CN108427546A (en) * 2018-05-03 2018-08-21 深圳Tcl新技术有限公司 Full screen adaptation method, display device and the storage medium of display device
CN108920370A (en) * 2018-07-02 2018-11-30 北京百度网讯科技有限公司 Compatibility issue detection method, device and equipment
CN109408179A (en) * 2018-10-08 2019-03-01 北京金山安全软件有限公司 Method and device for determining comprehensive screen of terminal equipment
CN109725942A (en) * 2018-12-21 2019-05-07 福建天泉教育科技有限公司 Android device generic screen adaptation method, storage medium
CN109783181A (en) * 2019-01-31 2019-05-21 掌阅科技股份有限公司 Screen is adapted to display methods, electronic equipment and computer storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8572571B2 (en) * 2009-07-23 2013-10-29 Shuv Gray Llc Modification of terminal and service provider machines using an update server machine
CN107622135B (en) * 2017-10-17 2021-01-05 百度在线网络技术(北京)有限公司 Method and apparatus for displaying information

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110084693A (en) * 2010-01-18 2011-07-26 (주)쉬프트웍스 Method of examining malicious codes and dangerous files in android terminal platform
CN103118290A (en) * 2013-02-28 2013-05-22 北京奇虎科技有限公司 Detection method, device and system of suitability of program installation
CN104142881A (en) * 2013-05-07 2014-11-12 腾讯科技(深圳)有限公司 Adaptive defect detecting method and device of application program programming interfaces
WO2015058670A1 (en) * 2013-10-21 2015-04-30 中国移动通信集团公司 Display content processing method and device
WO2015078566A1 (en) * 2013-11-27 2015-06-04 Gmc Software Ag System and method for testing data representation for different mobile devices
WO2015156809A1 (en) * 2014-04-10 2015-10-15 Hewlett-Packard Development Company, L.P. Generalized snapshots based on multiple partial snapshots
WO2016206559A1 (en) * 2015-06-23 2016-12-29 阿里巴巴集团控股有限公司 Method and device for full size adaptation of object to be displayed
CN107133165A (en) * 2017-03-22 2017-09-05 腾讯科技(深圳)有限公司 Browser compatibility detection method and device
CN108427546A (en) * 2018-05-03 2018-08-21 深圳Tcl新技术有限公司 Full screen adaptation method, display device and the storage medium of display device
CN108920370A (en) * 2018-07-02 2018-11-30 北京百度网讯科技有限公司 Compatibility issue detection method, device and equipment
CN109408179A (en) * 2018-10-08 2019-03-01 北京金山安全软件有限公司 Method and device for determining comprehensive screen of terminal equipment
CN109725942A (en) * 2018-12-21 2019-05-07 福建天泉教育科技有限公司 Android device generic screen adaptation method, storage medium
CN109783181A (en) * 2019-01-31 2019-05-21 掌阅科技股份有限公司 Screen is adapted to display methods, electronic equipment and computer storage medium

Also Published As

Publication number Publication date
CN112988561A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
US20160378989A1 (en) Apparatus and method for monitoring android platform-based application
US10303490B2 (en) Apparatus and method for optimizing startup of embedded system
CN107145437B (en) Java annotation test method and device
KR20080068385A (en) Program test system, method and computer readable medium on which program for executing the method is recorded
CN109582907A (en) Method of calibration, device, equipment and the readable storage medium storing program for executing of web page resources integrality
CN110851351A (en) Deployment environment testing method and device, computer equipment and storage medium
CN110362488B (en) Page testing method and device, electronic equipment and storage medium
CN110941528A (en) Log buried point setting method, device and system based on fault
CN107632901A (en) A kind of self-repair method and device of application program operation exception
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN113448862A (en) Software version testing method and device and computer equipment
CN113377667A (en) Scene-based testing method and device, computer equipment and storage medium
CN115292163A (en) Application program detection method and device and computer readable storage medium
CN111427771A (en) Code coverage rate analysis method, equipment, server and readable storage medium
CN111309602A (en) Software testing method, device and system
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN112988561B (en) Method, device, server and storage medium for detecting display configuration code
CN109960656B (en) Program detection method and device and electronic equipment
CN112181822A (en) Test method and test method for starting time consumption of application program
CN112527459A (en) Log analysis method and device based on Kubernetes cluster
CN109684205B (en) System testing method, device, electronic equipment and storage medium
CN107861966B (en) Cache detection method, equipment and computer readable storage medium
CN114356346A (en) Application program deployment method, device, storage medium and electronic equipment
CN114238129A (en) Method, device and equipment for generating interface data and storage medium
CN114168108A (en) Code merging method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant