WO2019135425A1 - Open source software license verification method and system - Google Patents

Open source software license verification method and system Download PDF

Info

Publication number
WO2019135425A1
WO2019135425A1 PCT/KR2018/000162 KR2018000162W WO2019135425A1 WO 2019135425 A1 WO2019135425 A1 WO 2019135425A1 KR 2018000162 W KR2018000162 W KR 2018000162W WO 2019135425 A1 WO2019135425 A1 WO 2019135425A1
Authority
WO
WIPO (PCT)
Prior art keywords
tree structure
open source
source software
data
code
Prior art date
Application number
PCT/KR2018/000162
Other languages
French (fr)
Korean (ko)
Inventor
김태우
정명주
전상훈
Original Assignee
라인플러스 주식회사
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 라인플러스 주식회사 filed Critical 라인플러스 주식회사
Priority to KR1020207015830A priority Critical patent/KR102462541B1/en
Priority to JP2020536852A priority patent/JP7119096B2/en
Priority to PCT/KR2018/000162 priority patent/WO2019135425A1/en
Publication of WO2019135425A1 publication Critical patent/WO2019135425A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/105Arrangements for software license management or administration, e.g. for managing licenses at corporate level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/03Indexing scheme relating to G06F21/50, monitoring users, programs or devices to maintain the integrity of platforms
    • G06F2221/034Test or assess a computer or a system

Definitions

  • the following description relates to a method and system for validating licenses for open source software, and more particularly to a method of validating licenses for examining licenses for open source software, computing devices that perform the above license verification methods, And a computer program stored in a computer-readable recording medium for causing the computer to execute the license verification method and a recording medium therefor.
  • Open source software is freely used in software development, but if used for commercial purposes, you must adhere to the license terms. Depending on the organization and nature of the open source software, different licenses are followed. Typically, there are licenses such as Berkeley Software Distribution (BSD), General Public License (GPL), and Apache, licensed for use, reproduction, adaptation, There is also.
  • BSD Berkeley Software Distribution
  • GPL General Public License
  • Apache licensed for use, reproduction, adaptation
  • open source software increases, the number of cyber attacks exploiting open source security vulnerabilities is increasing every year. Even with security vulnerabilities already found in poor open source security management, the situation has been left untouched and the damage is occurring. Because open source, including vulnerabilities, can be included in the software and distributed, it requires management of the open source used.
  • the open source license inspection system receives the developer's source code as input, and compares the developer's code with the code of the open source software to determine the open source software used.
  • the developer must deliver the source code to the system for the open source license inspection, and leakage of the source code, which is the developer's property, may cause inconvenience and disfavor .
  • a computer program for performing the license verification method and a computer program stored in a computer-readable recording medium for causing the computer to execute the license verification method in combination with the computer, Thereby providing a recording medium.
  • a license verification method that can validate the license of open source software through a binary code that is built without a developer's source code by utilizing predetermined code form such as smali code in an Android environment, a computer device performing the license verification method, And a computer program stored in a computer-readable recording medium for causing the computer to execute the license verification method in combination with the computer.
  • a license verification method capable of verifying license of open source software for a code obfuscated through a type comparison according to the structure of a package file, a computer device performing the license verification method, and a computer verification device
  • a computer program stored in a computer-readable recording medium for causing the computer to execute the program, and a recording medium therefor.
  • a method for validating a license comprising: downloading open source software; Extracting method call information from the downloaded open source software; Generating a pattern of a predetermined code type using the extracted method call information; And storing the generated pattern in a database in association with the identifier of the downloaded open source software.
  • the license verification method includes: receiving a package file to be inspected; Extracting an executable file of the package file; Converting the extracted executable file into the predetermined code form; Extracting method call information from an executable file converted into the predetermined code form; And comparing the extracted method call information with a pattern stored in the database.
  • a method for validating a license comprising: downloading open source software; Generating data of a first tree structure corresponding to a directory structure of the downloaded open source software; And storing the data of the first tree structure in association with an identifier of the corresponding open source software in a database.
  • the license verification method includes: receiving a package file to be inspected; Generating data of a second tree structure corresponding to a directory structure of the input package file; And comparing the data of the second tree structure with the data of the first tree structure stored in the database.
  • a computer readable recording medium having recorded thereon a program for causing a computer to execute the license verification method.
  • a computer device comprising: at least one processor configured to execute computer readable instructions, the at least one processor downloading open source software, extracting method call information from the downloaded open source software, Generates a pattern of a predetermined code type using the extracted method call information, and stores the generated pattern in a database in association with the identifier of the downloaded open source software.
  • a computer device comprising: at least one processor configured to execute computer readable instructions, the at least one processor downloading open source software, 1 tree structure, and stores the data of the first tree structure in association with the identifier of the corresponding open source software in the database.
  • a computer program for performing the license verification method, and a computer program stored in a computer-readable recording medium for causing the computer to execute the license verification method in combination with the computer, A recording medium can be provided.
  • FIG. 1 is a diagram illustrating an example of a network environment according to an embodiment of the present invention.
  • FIG. 2 is a block diagram illustrating an example of a computing device in accordance with an embodiment of the present invention.
  • Figure 3 is a flow chart illustrating an example of a method for collecting patterns of open source software in one embodiment of the present invention.
  • FIG. 4 is a flowchart illustrating an example of a method for checking whether open source software is used using a pattern in an embodiment of the present invention.
  • FIG. 5 is a diagram showing an example of generating a pattern of the smali code form from the source code of open source software in an embodiment of the present invention.
  • 6 and 7 are diagrams illustrating an example of converting a Dex file into an smali code in an embodiment of the present invention.
  • FIG. 8 is a diagram showing an example of a smali code corresponding to a Java code and a Java code in an embodiment of the present invention.
  • FIG. 9 is a flowchart illustrating an example of a method of collecting the structure of a package file as a pattern of open source software, according to an embodiment of the present invention.
  • FIG. 10 is a flowchart illustrating an example of a method for checking whether open source software is used through a type comparison according to the structure of a package file, according to an embodiment of the present invention.
  • FIG. 11 is a diagram showing an example of a directory structure of a package file according to an embodiment of the present invention.
  • FIG. 12 is a diagram showing an example of a tree structure corresponding to a directory structure in an embodiment of the present invention.
  • FIG. 13 is a diagram showing an example of an aligned tree structure in an embodiment of the present invention.
  • FIG. 14 is a diagram showing an example of serialized and stored data in an embodiment of the present invention.
  • 15 and 16 are views showing a comparative example of a tree structure in an embodiment of the present invention.
  • the license verification system can be implemented through a computer device such as a server to be described later.
  • a computer program according to an embodiment of the present invention can be installed and driven in the computer apparatus, and the computer apparatus can perform the license verification method according to the embodiments of the present invention under the control of the computer program that is driven .
  • the above-described computer program may be stored in a computer-readable recording medium in combination with a computer apparatus for executing a license verification method on the computer.
  • 1 is a diagram illustrating an example of a network environment according to an embodiment of the present invention. 1 shows an example in which a plurality of electronic devices 110, 120, 130, 140, a plurality of servers 150, 160, and a network 170 are included. 1, the number of electronic devices and the number of servers are not limited to those shown in FIG.
  • the plurality of electronic devices 110, 120, 130, 140 may be a fixed terminal implemented as a computer device or a mobile terminal.
  • Examples of the plurality of electronic devices 110, 120, 130 and 140 include a smart phone, a mobile phone, a navigation device, a computer, a notebook, a digital broadcast terminal, a PDA (Personal Digital Assistants) ), And tablet PCs.
  • FIG. 1 illustrates the shape of a smartphone as an example of the first electronic device 110, but in the embodiments of the present invention, the first electronic device 110 transmits the network 170 using a wireless or wired communication method.
  • any of a variety of physical computer devices capable of communicating with other electronic devices 120, 130, 140 and / or servers 150 any of a variety of physical computer devices capable of communicating with other electronic devices 120, 130, 140 and / or servers 150,
  • the communication method is not limited, and may include a communication method using a communication network (for example, a mobile communication network, a wired Internet, a wireless Internet, a broadcasting network) that the network 170 may include, as well as a short-range wireless communication between the devices.
  • the network 170 may be a personal area network (LAN), a local area network (LAN), a campus area network (CAN), a metropolitan area network (MAN), a wide area network (WAN) , A network such as the Internet, and the like.
  • the network 170 may also include any one or more of a network topology including a bus network, a star network, a ring network, a mesh network, a star-bus network, a tree or a hierarchical network, It is not limited.
  • Each of the servers 150 and 160 is a computer device or a plurality of computers that communicate with a plurality of electronic devices 110, 120, 130 and 140 through a network 170 to provide commands, codes, files, Lt; / RTI > devices.
  • the server 150 may be a system that provides a first service to a plurality of electronic devices 110, 120, 130, 140 connected through a network 170, 170, and 140 to the first and second electronic devices 110, 120, 130, and 140, respectively.
  • the server 150 transmits a file for installing and operating an application to a plurality of electronic apparatuses 110, 120, 130, 140 as a first service, ).
  • the server 160 can provide a service desired by the application to the plurality of electronic devices 110, 120, 130, and 140 as the second service through the application.
  • a license verification system may be implemented in the server 150.
  • the license verification system can detect the use of the open source software for the file for installing and running the application registered in the server 150 from the developer and can provide the license information of the detected open source software to the administrator.
  • the license verification system may be implemented as a separate computer device that is separate from the server 150 and may be linked to the server 150 through the network 170.
  • FIG. 2 is a block diagram illustrating an example of a computing device in accordance with an embodiment of the present invention.
  • Each of the plurality of electronic devices 110, 120, 130, 140 described above or the servers 150, 160 and the license verification system according to the embodiments of the present invention are connected to the computer device 200 shown in FIG. 2
  • a license verification method according to an embodiment may be performed by a license verification system implemented by such a computer device 200.
  • a license verification system is implemented in the server 150
  • another license verification method may be performed in embodiments of the present invention by the computer device 200 implementing the server 150.
  • a computer program according to one embodiment may be installed and operated in the computer device 200, and the computer device 200 may be provided with a license verification method according to embodiments of the present invention Can be performed.
  • the license verification system may be implemented through a combination of a plurality of computer devices.
  • the computer device 200 may include a memory 210, a processor 220, a communication interface 230, and an input / output interface 240, as shown in FIG.
  • the memory 210 may be a computer-readable recording medium and may include a permanent mass storage device such as a random access memory (RAM), a read only memory (ROM), and a disk drive.
  • the non-decaying mass storage device such as a ROM and a disk drive, may be included in the computer device 200 as a separate persistent storage device separate from the memory 210.
  • the memory 210 may store an operating system and at least one program code. These software components may be loaded into the memory 210 from a computer readable recording medium separate from the memory 210.
  • Such a computer-readable recording medium may include a computer-readable recording medium such as a floppy drive, a disk, a tape, a DVD / CD-ROM drive, and a memory card.
  • the software components may be loaded into the memory 210 via the communication interface 230 rather than from a computer readable recording medium.
  • the software components may be loaded into the memory 210 of the computer device 200 based on a computer program installed by files received via the network 170.
  • the processor 220 may be configured to process instructions of a computer program by performing basic arithmetic, logic, and input / output operations.
  • the instructions may be provided to the processor 220 by the memory 210 or the communication interface 230.
  • the processor 220 may be configured to execute a command received in accordance with a program code stored in a recording device, such as the memory 210.
  • the communication interface 230 may provide functionality for the computer device 200 to communicate with another device (e. G., The storage devices described above) via the network 170. For example, a request, command, data, file, or the like, generated by the processor 220 of the computer device 200 according to the program code stored in the recording device such as the memory 210, 170 to other devices. Conversely, signals, commands, data, files, etc., from other devices may be received by the computer device 200 via the communication interface 230 of the computer device 200 via the network 170. Data or the like received via the communication interface 230 may be transferred to the processor 220 or the memory 210 and the file or the like may be transferred to a storage medium Permanent storage).
  • the input / output interface 240 may be a means for interfacing with the input / output device 250.
  • the input device may include a device such as a microphone, a keyboard or a mouse, and an output device may include a device such as a display, a speaker, and the like.
  • the input / output interface 240 may be a means for interfacing with a device having integrated functions for input and output, such as a touch screen.
  • the input / output device 250 may be composed of the computer device 200 and one device.
  • the computer device 200 may include fewer or more components than the components of FIG. However, there is no need to clearly illustrate most prior art components.
  • the computer device 200 may be implemented to include at least some of the input / output devices 250 described above, or may further include other components such as a transceiver, database, and the like.
  • Figure 3 is a flow chart illustrating an example of a method for collecting patterns of open source software in one embodiment of the present invention.
  • the method according to the present embodiment may be included in the license verification method according to an embodiment, and may be performed by the computer device 200 described above.
  • the processor 220 of the computer device 200 may be implemented to execute control instructions in accordance with the code of the operating system or the code of at least one program that the memory 210 includes.
  • the processor 220 is configured to cause the computer device 200 to perform the steps 310 to 340 included in the method of FIG. 3 in accordance with the control command provided by the code stored in the computer device 200. [ Can be controlled.
  • the computer device 200 may download open source software.
  • the computer device 200 may download a plurality of open source software from at least one of a plurality of sites that share the source code of the open source software, (320) to (340) below.
  • the computer device 200 may extract the method call information from the downloaded open source software.
  • the method call information is information required to call a specific method.
  • it may include a class path name, a class name, a method name, a number of method arguments, and a type of each argument.
  • the computer device 200 can extract at least the class path name, the class name, and the method name as the method calling information.
  • at least one of the number of method arguments and the type of each argument may be further extracted as method call information.
  • the computer device 200 may generate a pattern of a predetermined code type using the extracted method call information.
  • the computer device 200 can generate a pattern of a smali code form used in an APK (Android application package) file, which is a package file for an Android application, using the extracted method call information.
  • the pattern of the smali code form may include a class path name, a class name, and a method name.
  • the computer device 200 may store the generated pattern in a database in association with the identifier of the corresponding open source software.
  • the identifier of the open source software may be the name of the corresponding open source software.
  • at least one pattern may be generated for each of the plurality of downloaded open source software, and the generated patterns may be stored in the database in association with the identifiers of each of the plurality of open source software.
  • FIG. 4 is a flowchart illustrating an example of a method for checking whether open source software is used using a pattern in an embodiment of the present invention.
  • the method according to the present embodiment can also be included in the license verification method according to the embodiment.
  • an open source software check is performed for a particular application via the method according to the embodiment of FIG. .
  • the method according to the present embodiment can also be performed by the computer apparatus 200 described above.
  • the processor 220 of the computer device 200 may be implemented to execute control instructions in accordance with the code of the operating system or the code of at least one program that the memory 210 includes.
  • the processor 220 is configured to cause the computer device 200 to perform the steps 410 to 440 of the method of FIG. 4 in accordance with the control command provided by the code stored in the computer device 200, Can be controlled.
  • the computer device 200 can receive a package file to be inspected.
  • the computer device 200 can receive an APK file for installing and running the corresponding Android application.
  • the computer device 200 may extract an executable file of the package file.
  • the computer device 200 can decompress the inputted APK file and extract a DAX file such as 'classes.dex' as an executable file. After decompression, the file is located in the root directory of the decompressed directory.
  • the computer device 200 may convert the extracted executable file into a predetermined code format.
  • the computer device 200 can convert the executable file into the smali code using the baksmali library. If the baksmali library is embedded in the apktool, which is a tool for decompressing the APK file in step 420, the compression of the APK file and the conversion of the dex file into the smali code may be performed at the same time.
  • the computer device 200 may extract the method call information from the executable file converted into a predetermined code form.
  • the extracted method call information may have the same or similar form as the pattern generated in step 330 of FIG. 3 because the executable file has been converted into the predetermined code form, and at least the class path name, the class name, . ≪ / RTI > At least one of the number of method arguments and the type of each argument may be further included in the method call information extracted in step 440 according to an embodiment.
  • the computer device 200 may compare the extracted method call information with the pattern stored in the database. At this time, if there is a pattern matching the extracted method call information (or including the extracted method call information) in the database, it is determined in step 410 whether or not the pattern is inputted in accordance with the identifier of the open- You can see that the package file uses the corresponding open source software.
  • the computer device 200 may then provide the identifier of the searched open source software and the license information matched to the corresponding open source software.
  • the administrator can know which open source software the package file to search for is using and which license is being applied.
  • FIG. 5 is a diagram showing an example of generating a pattern of the smali code form from the source code of open source software in an embodiment of the present invention.
  • FIG. 5 shows an example of Java code 520 included in the Java code file 'Square.java' 510 and 'Square.java' 510 for the corresponding open source software.
  • the 'Square' class shown in the second dotted line box 522 is defined in the package path of 'com.sample.math' shown in the first dotted line box 521,
  • the class includes the method 'getWidth ()' shown in the third dashed line box 523.
  • the computer device 200 extracts the package path name 'com.sample.math', the class name 'Square', and the method name 'getWidth ()' as the method calling information from the Java code 520 at step 320 .
  • the computer device 200 may generate the information 530 in the form of a corresponding smali code, as shown in FIG. 5, using the information extracted in step 330.
  • the 'invoke-virtual' command in the smali code-type information (530) is a command to call a virtual method in the smali code form.
  • the called method should not be a static method, a private method, a final method, or a constructor method.
  • 'v0' is an instance of the class, 'L' before the class path name 'com.sample.math' may mean that the class is an object type, and 'V' after the method name 'getWidth () It can mean void.
  • the invoke-super command invokes the virtual method of the superclass
  • the invoke-direct command invokes the direct method B
  • the invoke-static command invokes the static method
  • the invoke- interface 'command can be used.
  • the method invoked through the 'invoke-super' command must not be a static method, a private method, a final method, or a constructor method.
  • the method invoked via the 'invoke-direct' command must not be a static method, and the 'invoke-direct' command can be used to invoke methods that can not be overridden, such as private methods and constructor methods. .
  • the package name which is a path of a class, generally includes a unique name such as a company name and a software name, the risk of redundancy is low. In the case of generating a pattern for two or more classes and methods, Is close to zero.
  • the computer device 200 may store 'Lcom / sample / math / square; -> getWidth () V' shown in the fourth dotted line box 540 as a pattern in the database.
  • FIG. 6 and 7 are diagrams illustrating an example of converting a Dex file into an smali code in an embodiment of the present invention.
  • the first box 610 in FIG. 6 shows a part of the code of the Dex file 'classes.dex'
  • the second box 620 in FIG. 7 converts the Dex file 'classes.dex' using the baksmali library It shows some of the code of the smali file 'class.smali'.
  • the computer device 200 converts a dex file 'classes.dex' to a smali file 'class.smali' through a command such as '$ java -jar baksmali.jar -o ⁇ output directory> classes.dex' can do.
  • the computer device 200 can identify a code for calling a method through the 'invoke-virtual' command in the converted smali file 'class.smali', and extract the method call information from the code.
  • FIG. 8 is a diagram showing an example of a smali code corresponding to a Java code and a Java code in an embodiment of the present invention.
  • the first box 710 shows an example of a Java code for outputting a simple message "Toast Hello" using Android 'Toast'
  • the second box 720 includes a first box 710 ) Is converted into the form of smali code.
  • it is required to convert the Java code into the code form of the Dex file, and then convert the Dex file to the smali file form as shown in FIG.
  • the computer device 200 is able to extract the method call information from the executable code converted into the smali code form, and preferably, for comparison with the pattern stored in the database in FIG. 3, "Landroid / widget / Toast; -> show () V "to retrieve method call information.
  • the computer device 200 can compare the extracted method call information and the pattern read from the database to determine whether they match or not. If they match, the computer device 200 searches the target of the inspection through the identifier of the open source software stored in the database It can be determined that the package file is using the open source software. Since the package name (class path name), class name, and method name represent the company name and the function name, respectively, the risk of duplication is small. However, if there is a risk of duplication, the probability of false positives can be reduced by comparing two or more patterns.
  • the computer device 200 may determine that the identifier of the corresponding open source software (e.g., open source software name) and the license used by the corresponding open source software An identifier (e.g., a license name) may be provided.
  • the identifier of the corresponding open source software e.g., open source software name
  • the license used by the corresponding open source software An identifier (e.g., a license name) may be provided.
  • FIG. 9 is a flowchart illustrating an example of a method of collecting the structure of a package file as a pattern of open source software, according to an embodiment of the present invention.
  • the method according to the present embodiment may be included in the license verification method according to an embodiment, and may be performed by the computer device 200 described above.
  • the processor 220 of the computer device 200 may be implemented to execute control instructions in accordance with the code of the operating system or the code of at least one program that the memory 210 includes.
  • the processor 220 may cause the computer device 200 to perform steps 910 through 940, including the method of Figure 9, in accordance with a control command provided by a code stored in the computer device 200. [ Can be controlled.
  • the computer device 200 may download open source software.
  • the computer device 200 may download a plurality of open source software from various sites that share the source code of the open source software, and perform the following steps 920 (Step 940).
  • This step 910 may correspond to the step 310 described with reference to FIG. 3, and if the license verification method includes both the method of FIG. 3 and the method of FIG. 9, steps 310 and 910 are the same Step.
  • the computer device 200 may generate the tree structure data corresponding to the directory structure of the downloaded open source software.
  • the Java source code collects Java classes of similar nature and creates and classifies directories.
  • This type of directory structure can be a feature of open source software and can be expressed in a tree structure.
  • a directory may be a branch node, and Java code files stored in a directory may be represented by a leaf node.
  • the computing device 200 may sort the nodes of the generated tree structure. Alignment of nodes in the tree structure may be performed to compare the correspondence with other tree structures, and may be omitted according to the embodiment. Detailed alignment methods are described in more detail below.
  • the computer device 200 may store the data of the aligned tree structure in association with the identifier of the corresponding open source software in the database.
  • the data of the tree structure may be stored in the database as it is in a tree structure, but it may be serialized and stored in consideration of the complexity of database structure of the tree structure. The serialization of data of such a tree structure will be described in more detail later.
  • data of this tree structure can be generated for each of a plurality of open source software to be downloaded, and data of the generated tree structure can be stored in a database in association with an identifier of each of a plurality of open source software.
  • FIG. 10 is a flowchart illustrating an example of a method for checking whether open source software is used through a type comparison according to the structure of a package file, according to an embodiment of the present invention.
  • the method according to the present embodiment can also be included in the license verification method according to the embodiment.
  • a method according to the embodiment of FIG. A software check can be performed.
  • the method according to the present embodiment can also be performed by the computer apparatus 200 described above.
  • the processor 220 of the computer device 200 may be implemented to execute control instructions in accordance with the code of the operating system or the code of at least one program that the memory 210 includes.
  • the processor 220 may be configured to cause the computer device 200 to perform steps 1010 through 1040, including the method of Figure 10, in accordance with a control command provided by a code stored in the computer device 200. [ Can be controlled.
  • the computer device 200 may receive a package file to be inspected.
  • the computer device 200 can receive an APK file for installing and running the corresponding Android application.
  • step 1020 the computer device 200 may generate data of a tree structure corresponding to the directory structure of the input package file. This step 1020 may be the same as the process of generating the data of the tree structure in the step 920.
  • the computing device 200 may arrange the nodes of the generated tree structure. This step 1030 may be the same as the process of sorting the data of the tree structure in step 930.
  • the computer device 200 may compare the data of the ordered tree structure with the data of the tree structure stored in the database. At this time, if the data of the tree structure extracted from the database matches the data of the tree structure aligned in the step 1030, the computer device 200 displays the data of the tree structure inputted in the step 1010 through the identifier of the open- You can see that the package file uses the corresponding open source software.
  • the computer device 200 may then provide the identifier of the searched open source software and the license information matched to the corresponding open source software.
  • the administrator can know which open source software the package file to search for is using and which license is being applied.
  • the classpath name, class name, method name, etc. may be changed.
  • the use of the open source software is checked based on the structure of the package file such as the directory code and the Java code file stored in the directory, so that the obfuscation is applied to the package file Can be used.
  • FIG. 11 is a diagram showing an example of a directory structure of a package file in an embodiment of the present invention.
  • FIG. 12 is a diagram showing an example of a tree structure corresponding to a directory structure in an embodiment of the present invention to be.
  • FIG. 11 shows nine directory and eight Java code files as an example of the directory structure of the package file.
  • FIG. 12 represents a directory with a circle-shaped branch node
  • a Java code file is represented by a rectangular leaf node.
  • the first number in the circle can denote the degree that is the number of the child nodes
  • the second number can denote the difference, which is the number of all the nodes at the bottom.
  • the first directory 'com' in FIG. 11 is represented as a root node with degree 1 and number 16 in FIG.
  • the second directory 'sample' in FIG. 11 is represented as a branch node having degree 1 and degree 15 in FIG.
  • the first Java code file 'Internet.java' in FIG. 11 is represented by the first leaf node having a depth of 5 when the depth of the root node is 0 in FIG.
  • a branch node may mean a directory, and may have a branch node or a leaf node as a child node (child node). Each node can have degree and degree sum information. Also, a leaf node can mean a Java code file and can not have a child node.
  • Information about the class may be included, and information about the included class includes information such as the number of member variables, the number of member functions, the signature of each member function, the method return type, the number of arguments, and the corresponding information .
  • the sorting criterion can be that a branch node has a higher priority than a leaf node, and branch nodes having the same parent can be sorted in descending order or ascending order. Branch nodes having the same order among the sorted branch nodes using order can be sorted in descending order or ascending order by using the sort order. Leaf nodes having the same parent can be sorted in descending order or ascending order based on the number of methods (the number of member functions).
  • the sorting method is not limited to the above-described embodiment as long as the sorting method can be applied in the same manner to the tree structure created for the directory structure of open source software and the tree structure created for the directory structure of the package file.
  • FIG. 13 is a diagram showing an example of an aligned tree structure in an embodiment of the present invention. 12 and 13, when the first branch node 1210 has a degree of 1 and the second branch node 1220 has a degree of 2, the second branch node 1220 is connected to the first branch node 1210 In the left-hand side of Fig. It can be seen that all the nodes of the tree structure are arranged according to the above-described sorting method in accordance with the arrangement change between the first branch node 1210 and the second branch node 1220.
  • the computer device 200 may serialize the data of the tree structure using Java object serialization, and then store the serialized data in a database. More specifically, the computer device 200 traverses a directory, makes each directory a Java object, and stores objects sorted in descending order or ascending order according to orders. In order to store the non-linear data structure of the tree structure in the relational database, the implementation becomes complicated because the parent-child relation for each node must be checked and stored in the database. Accordingly, in order to easily store this, the computer device 200 can serialize data of the tree structure using Java object serialize based on the root node, and then store the data in the database.
  • the member variable should be filled with information necessary for saving.
  • the number of member variables, the number of member functions, the signature of each member function (the method return type , The number of arguments, the type of each argument), and parent node information can be defined as member variables.
  • Table 1 shows an example of information defining the relationship between a parent and a child
  • Table 2 shows an example of information defining a branch node
  • Table 3 shows an example of information that defines a leaf node.
  • public class Node ⁇ T> implements Serializable ⁇ private T data; private Node ⁇ T> parent; private List ⁇ Node ⁇ T >> children;
  • the Java serialization process can be a process of transforming data into continuous data to write an object to a heap region of memory created in the form of a class.
  • the serialized and stored data can be stored in a form that is difficult for human to recognize as shown in FIG.
  • the computer device 200 may first generate and arrange the tree structure data by traversing the root directory of the package file through the subdirectories .
  • the computer device 200 may deserialize the data stored in the database and read it into the memory 210.
  • the deserialization process may be the reverse of the serialization process.
  • an object can be created and loaded into the heap area of the memory before serialization. The computer device 200 can use this object to compare two tree structures.
  • FIG. 15 and 16 are views showing a comparative example of a tree structure in an embodiment of the present invention.
  • a dotted box 1510 in FIG. 15 shows an example of a tree structure (hereinafter, referred to as 'open source tree structure') corresponding to a directory structure of open source software.
  • 16 shows an example of a tree structure (hereinafter referred to as a "package file tree structure") corresponding to the directory structure of the package file.
  • the second dashed box 1620 in Fig. 16 shows a subtree structure coinciding with the tree structure indicated by the dashed box 1510 in Fig.
  • the computer device 200 traverses the nodes of the package file tree structure and finds a node that matches the information (degree, order) of the root node of the open source tree structure. If a matching node is found, it can be compared while traversing the open-source tree structure with the subtree containing the found node. The comparison of the branch nodes can compare whether the node information (degree, difference) is matched. The leaf node comparison compares the number of member variables, the number of member functions, and the signature of each member function . However, the type of the argument in the function signature comparison may not be included in the comparison object because only the Java primitive type is compared and the non-primitive type is likely to be obfuscated.
  • the above-described two embodiments may be used individually or in combination .
  • an embodiment using a pattern may be applied, and in a case where obfuscation is applied to a package file, an embodiment using a tree structure may be applied.
  • the embodiments of the present invention it is possible to verify the license of the open source software through the binary code that is built without the developer's source code by utilizing the predetermined code form such as the smali code in the Android environment .
  • the predetermined code form such as the smali code in the Android environment.
  • the system or apparatus described above may be implemented as a hardware component, a software component or a combination of hardware components and software components.
  • the apparatus and components described in the embodiments may be implemented within a computer system, such as, for example, a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA) , A programmable logic unit (PLU), a microprocessor, or any other device capable of executing and responding to instructions.
  • the processing device may execute an operating system (OS) and one or more software applications running on the operating system.
  • the processing device may also access, store, manipulate, process, and generate data in response to execution of the software.
  • OS operating system
  • the processing device may also access, store, manipulate, process, and generate data in response to execution of the software.
  • the processing apparatus may be described as being used singly, but those skilled in the art will recognize that the processing apparatus may have a plurality of processing elements and / As shown in FIG.
  • the processing unit may comprise a plurality of processors or one processor and one controller.
  • Other processing configurations are also possible, such as a parallel processor.
  • the software may include a computer program, code, instructions, or a combination of one or more of the foregoing, and may be configured to configure the processing device to operate as desired or to process it collectively or collectively Device can be commanded.
  • the software and / or data may be in the form of any type of machine, component, physical device, virtual equipment, computer storage media, or device As shown in FIG.
  • the software may be distributed over a networked computer system and stored or executed in a distributed manner.
  • the software and data may be stored on one or more computer readable recording media.
  • the method according to an embodiment may be implemented in the form of a program command that can be executed through various computer means and recorded in a computer-readable medium.
  • the computer-readable medium may include program instructions, data files, data structures, and the like, alone or in combination.
  • the program instructions to be recorded on the medium may be those specially designed and configured for the embodiments, or may be available to those skilled in the art of computer software.
  • Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape; optical media such as CD-ROMs and DVDs; magnetic media such as floppy disks; Magneto-optical media, and hardware devices specifically configured to store and execute program instructions such as ROM, RAM, flash memory, and the like.
  • Such a recording medium may be a variety of recording means or storage means in the form of a single or a plurality of hardware combined and is not limited to a medium directly connected to any computer system but may be dispersed on a network.
  • Examples of program instructions include machine language code such as those produced by a compiler, as well as high-level language code that can be executed by a computer using an interpreter or the like.

Abstract

Disclosed are an open source software license verification method and system. The license verification method, according to embodiments of the present invention, may enable the testing of an open source software license. The license verification method, according to one embodiment, may enable the verification of an open source software license through a binary code built without the source code of the developer by using a predetermined code form such as a smali code in an android environment. The license verification method, according to another embodiment, may enable the verification of an open source software license, even for a code having an obfuscated character string, by comparing forms according to package file structure.

Description

오픈소스 소프트웨어의 라이선스를 검증하는 방법 및 시스템Methods and systems for validating licenses for open source software
아래의 설명은 오픈소스 소프트웨어의 라이선스를 검증하는 방법 및 시스템에 관한 것으로, 보다 자세하게는 오픈소스 소프트웨어의 라이선스를 검사할 수 있는 라이선스 검증 방법, 상기 라이선스 검증 방법을 수행하는 컴퓨터 장치, 그리고 컴퓨터와 결합되어 상기 라이선스 검증 방법을 컴퓨터에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램과 그 기록매체에 관한 것이다.The following description relates to a method and system for validating licenses for open source software, and more particularly to a method of validating licenses for examining licenses for open source software, computing devices that perform the above license verification methods, And a computer program stored in a computer-readable recording medium for causing the computer to execute the license verification method and a recording medium therefor.
오픈소스 소프트웨어는 소프트웨어 개발에 있어 자유롭게 사용되고 있지만, 상업적 목적으로 사용되는 경우에는 라이선스 규약을 지켜야 한다. 오픈소스 소프트웨어를 만든 단체나 성격에 따라 서로 다른 라이선스를 따른다. 대표적으로 BSD(Berkeley Software Distribution), GPL(General Public License), 아파치(Apache) 등이 있는데, 사용, 복제, 개작, 개작 후 재배포가 자유롭게 허용되는 라이선스가 있는 반면 수정한 소스코드를 공개해야 하는 라이선스도 있다.Open source software is freely used in software development, but if used for commercial purposes, you must adhere to the license terms. Depending on the organization and nature of the open source software, different licenses are followed. Typically, there are licenses such as Berkeley Software Distribution (BSD), General Public License (GPL), and Apache, licensed for use, reproduction, adaptation, There is also.
또한 오픈소스 소프트웨어의 사용이 늘어나는 만큼 이에 따른 오픈소스 보안취약점을 악용하는 사이버공격도 해마다 증가하는 추세다.  부실한 오픈소스 보안관리로 이미 발견된 보안 취약점 조차 패치되지 않은 채 방치되고 있는 상황이 이어지면서 피해가 발생하고 있는 상황이다.  취약점을 포함한 오픈소스가 소프트웨어에 포함되어 배포될 수 있기 때문에 사용한 오픈소스의 관리가 필요하다.In addition, as the use of open source software increases, the number of cyber attacks exploiting open source security vulnerabilities is increasing every year. Even with security vulnerabilities already found in poor open source security management, the situation has been left untouched and the damage is occurring. Because open source, including vulnerabilities, can be included in the software and distributed, it requires management of the open source used.
종래기술에서는 오픈소스 라이선스 검사 시스템에서 개발자의 소스코드를 입력으로 받아 개발자의 코드와 오픈소스 소프트웨어의 코드를 비교하여 사용된 오픈소스 소프트웨어를 판별하였다. 이 경우 개발사의 입장에서는 오픈소스 라이선스 검사를 위해 시스템으로 소스코드를 전달해야 하며, 개발사의 자산인 소스코드의 유출은 개발사의 관점에서 보안상 위험요소가 될 수 있기 때문에 불편함과 거부감이 발생할 수 있다는 문제점이 있다.In the prior art, the open source license inspection system receives the developer's source code as input, and compares the developer's code with the code of the open source software to determine the open source software used. In this case, the developer must deliver the source code to the system for the open source license inspection, and leakage of the source code, which is the developer's property, may cause inconvenience and disfavor .
오픈소스 소프트웨어의 라이선스를 검사할 수 있는 라이선스 검증 방법, 상기 라이선스 검증 방법을 수행하는 컴퓨터 장치, 그리고 컴퓨터와 결합되어 상기 라이선스 검증 방법을 컴퓨터에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램과 그 기록매체를 제공한다.A computer program for performing the license verification method, and a computer program stored in a computer-readable recording medium for causing the computer to execute the license verification method in combination with the computer, Thereby providing a recording medium.
안드로이드 환경에서의 smali 코드와 같은 기설정된 코드 형태를 활용하여 개발자의 소스코드 없이 빌드된 상태의 바이너리 코드를 통해서도 오픈소스 소프트웨어의 라이선스 검증이 가능한 라이선스 검증 방법, 상기 라이선스 검증 방법을 수행하는 컴퓨터 장치, 그리고 컴퓨터와 결합되어 상기 라이선스 검증 방법을 컴퓨터에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램과 그 기록매체를 제공한다.A license verification method that can validate the license of open source software through a binary code that is built without a developer's source code by utilizing predetermined code form such as smali code in an Android environment, a computer device performing the license verification method, And a computer program stored in a computer-readable recording medium for causing the computer to execute the license verification method in combination with the computer.
패키지 파일의 구조에 따른 형태 비교를 통해 문자열이 난독화된 코드에 대해서도 오픈소스 소프트웨어의 라이선스 검증이 가능한 라이선스 검증 방법, 상기 라이선스 검증 방법을 수행하는 컴퓨터 장치, 그리고 컴퓨터와 결합되어 상기 라이선스 검증 방법을 컴퓨터에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램과 그 기록매체를 제공한다.A license verification method capable of verifying license of open source software for a code obfuscated through a type comparison according to the structure of a package file, a computer device performing the license verification method, and a computer verification device A computer program stored in a computer-readable recording medium for causing the computer to execute the program, and a recording medium therefor.
라이선스 검증 방법에 있어서, 오픈소스 소프트웨어를 다운로드하는 단계; 상기 다운로드된 오픈소스 소프트웨어에서 메소드 호출 정보를 추출하는 단계; 상기 추출된 메소드 호출 정보를 이용하여 기설정된 코드 형태의 패턴을 생성하는 단계; 및 상기 생성된 패턴을 상기 다운로드된 오픈소스 소프트웨어의 식별자와 연계하여 데이터베이스에 저장하는 단계를 포함하는 것을 특징으로 하는 라이선스 검증 방법을 제공한다.A method for validating a license, comprising: downloading open source software; Extracting method call information from the downloaded open source software; Generating a pattern of a predetermined code type using the extracted method call information; And storing the generated pattern in a database in association with the identifier of the downloaded open source software.
일측에 따르면, 상기 라이선스 검증 방법은 검사의 대상이 되는 패키지 파일을 입력받는 단계; 상기 패키지 파일의 실행파일을 추출하는 단계; 상기 추출한 실행파일을 상기 기설정된 코드 형태로 변환하는 단계; 상기 기설정된 코드 형태로 변환된 실행파일에서 메소드 호출 정보를 추출하는 단계; 및 상기 추출된 메소드 호출 정보를 상기 데이터베이스에 저장된 패턴과 비교하는 단계를 더 포함하는 것을 특징으로 할 수 있다.According to one aspect, the license verification method includes: receiving a package file to be inspected; Extracting an executable file of the package file; Converting the extracted executable file into the predetermined code form; Extracting method call information from an executable file converted into the predetermined code form; And comparing the extracted method call information with a pattern stored in the database.
라이선스 검증 방법에 있어서, 오픈소스 소프트웨어를 다운로드하는 단계; 상기 다운로드된 오픈소스 소프트웨어의 디렉토리 구조에 대응하는 제1 트리 구조의 데이터를 생성하는 단계; 및 상기 제1 트리 구조의 데이터를 해당 오픈소스 소프트웨어의 식별자와 연계하여 데이터베이스에 저장하는 단계를 포함하는 것을 특징으로 하는 라이선스 검증 방법을 제공한다.A method for validating a license, comprising: downloading open source software; Generating data of a first tree structure corresponding to a directory structure of the downloaded open source software; And storing the data of the first tree structure in association with an identifier of the corresponding open source software in a database.
일측에 따르면, 상기 라이선스 검증 방법은, 검사의 대상이 되는 패키지 파일을 입력받는 단계; 상기 입력된 패키지 파일의 디렉토리 구조에 대응하는 제2 트리 구조의 데이터를 생성하는 단계; 및 상기 제2 트리 구조의 데이터와 상기 데이터베이스에 저장된 상기 제1 트리 구조의 데이터를 비교하는 단계를 더 포함하는 것을 특징으로 할 수 있다.According to one aspect of the present invention, the license verification method includes: receiving a package file to be inspected; Generating data of a second tree structure corresponding to a directory structure of the input package file; And comparing the data of the second tree structure with the data of the first tree structure stored in the database.
컴퓨터와 결합되어 상기 라이선스 검증 방법을 컴퓨터에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램을 제공한다.There is provided a computer program stored in a computer-readable medium for causing a computer to execute the license verification method in combination with a computer.
상기 라이선스 검증 방법을 컴퓨터에 실행시키기 위한 프로그램이 기록되어 있는 것을 특징으로 하는 컴퓨터에서 판독 가능한 기록매체를 제공한다.There is provided a computer readable recording medium having recorded thereon a program for causing a computer to execute the license verification method.
컴퓨터 장치에 있어서, 컴퓨터에서 판독 가능한 명령을 실행하도록 구현되는 적어도 하나의 프로세서를 포함하고, 상기 적어도 하나의 프로세서는, 오픈소스 소프트웨어를 다운로드하고, 상기 다운로드된 오픈소스 소프트웨어에서 메소드 호출 정보를 추출하고, 상기 추출된 메소드 호출 정보를 이용하여 기설정된 코드 형태의 패턴을 생성하고, 상기 생성된 패턴을 상기 다운로드된 오픈소스 소프트웨어의 식별자와 연계하여 데이터베이스에 저장하는 것을 특징으로 하는 컴퓨터 장치를 제공한다.A computer device comprising: at least one processor configured to execute computer readable instructions, the at least one processor downloading open source software, extracting method call information from the downloaded open source software, Generates a pattern of a predetermined code type using the extracted method call information, and stores the generated pattern in a database in association with the identifier of the downloaded open source software.
컴퓨터 장치에 있어서, 컴퓨터에서 판독 가능한 명령을 실행하도록 구현되는 적어도 하나의 프로세서를 포함하고, 상기 적어도 하나의 프로세서는, 오픈소스 소프트웨어를 다운로드하고, 상기 다운로드된 오픈소스 소프트웨어의 디렉토리 구조에 대응하는 제1 트리 구조의 데이터를 생성하고, 상기 제1 트리 구조의 데이터를 해당 오픈소스 소프트웨어의 식별자와 연계하여 데이터베이스에 저장하는 것을 특징으로 하는 컴퓨터 장치를 제공한다.A computer device, comprising: at least one processor configured to execute computer readable instructions, the at least one processor downloading open source software, 1 tree structure, and stores the data of the first tree structure in association with the identifier of the corresponding open source software in the database.
오픈소스 소프트웨어의 라이선스를 검사할 수 있는 라이선스 검증 방법, 상기 라이선스 검증 방법을 수행하는 컴퓨터 장치, 그리고 컴퓨터와 결합되어 상기 라이선스 검증 방법을 컴퓨터에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램과 그 기록매체를 제공할 수 있다.A computer program for performing the license verification method, and a computer program stored in a computer-readable recording medium for causing the computer to execute the license verification method in combination with the computer, A recording medium can be provided.
안드로이드 환경에서의 smali 코드와 같은 기설정된 코드 형태를 활용하여 개발자의 소스코드 없이 빌드된 상태의 바이너리 코드를 통해서도 오픈소스 소프트웨어의 라이선스를 검증할 수 있다.You can also validate open source software licenses through binary code that is built without the developer's source code, using preconfigured code types such as the smali code in the Android environment.
패키지 파일의 구조에 따른 형태 비교를 통해 문자열이 난독화된 코드에 대해서도 오픈소스 소프트웨어의 라이선스를 검증할 수 있다.You can verify the license of open source software for code obfuscated by string through the type comparison according to the structure of the package file.
도 1은 본 발명의 일실시예에 따른 네트워크 환경의 예를 도시한 도면이다.1 is a diagram illustrating an example of a network environment according to an embodiment of the present invention.
도 2는 본 발명의 일실시예에 따른 컴퓨터 장치의 예를 도시한 블록도이다.2 is a block diagram illustrating an example of a computing device in accordance with an embodiment of the present invention.
도 3은 본 발명의 일실시예에 있어서, 오픈소스 소프트웨어의 패턴을 수집하는 방법의 예를 도시한 흐름도이다.Figure 3 is a flow chart illustrating an example of a method for collecting patterns of open source software in one embodiment of the present invention.
도 4는 본 발명의 일실시예에 있어서, 패턴을 이용한 오픈소스 소프트웨어의 사용 여부를 검사하는 방법의 예를 도시한 흐름도이다.4 is a flowchart illustrating an example of a method for checking whether open source software is used using a pattern in an embodiment of the present invention.
도 5는 본 발명의 일실시예에 있어서, 오픈소스 소프트웨어의 소스코드로부터 smali 코드 형태의 패턴을 생성하는 예를 도시한 도면이다.5 is a diagram showing an example of generating a pattern of the smali code form from the source code of open source software in an embodiment of the present invention.
도 6 및 도 7은 본 발명의 일실시예에 있어서, 덱스 파일을 smali 코드로 변환한 예를 도시한 도면들이다.6 and 7 are diagrams illustrating an example of converting a Dex file into an smali code in an embodiment of the present invention.
도 8은 본 발명의 일실시예에 있어서, 자바 코드와 자바 코드에 대응하는 smali 코드의 예를 도시한 도면이다.8 is a diagram showing an example of a smali code corresponding to a Java code and a Java code in an embodiment of the present invention.
도 9는 본 발명의 일실시예에 있어서, 패키지 파일의 구조를 오픈소스 소프트웨어의 패턴으로서 수집하는 방법의 예를 도시한 흐름도이다.9 is a flowchart illustrating an example of a method of collecting the structure of a package file as a pattern of open source software, according to an embodiment of the present invention.
도 10은 본 발명의 일실시예에 있어서, 패키지 파일의 구조에 따른 형태 비교를 통해 오픈소스 소프트웨어의 사용 여부를 검사하는 방법의 예를 도시한 흐름도이다.FIG. 10 is a flowchart illustrating an example of a method for checking whether open source software is used through a type comparison according to the structure of a package file, according to an embodiment of the present invention.
도 11은 본 발명의 일실시예에 있어서, 패키지 파일의 디렉토리 구조의 예를 도시한 도면이다.11 is a diagram showing an example of a directory structure of a package file according to an embodiment of the present invention.
도 12는 본 발명의 일실시예에 있어서, 디렉토리 구조에 대응하는 트리 구조의 예를 도시한 도면이다.12 is a diagram showing an example of a tree structure corresponding to a directory structure in an embodiment of the present invention.
도 13은 본 발명의 일실시예에 있어서, 정렬된 트리 구조의 예를 도시한 도면이다.13 is a diagram showing an example of an aligned tree structure in an embodiment of the present invention.
도 14는 본 발명의 일실시예에 있어서, 직렬화되어 저장된 데이터의 예를 도시한 도면이다.14 is a diagram showing an example of serialized and stored data in an embodiment of the present invention.
도 15 및 도 16은 본 발명의 일실시예에 있어서, 트리 구조의 비교 예를 도시한 도면들이다. 15 and 16 are views showing a comparative example of a tree structure in an embodiment of the present invention.
이하, 실시예를 첨부한 도면을 참조하여 상세히 설명한다.Hereinafter, embodiments will be described in detail with reference to the accompanying drawings.
본 발명의 실시예들에 따른 라이선스 검증 시스템은 이후 설명될 서버와 같은 컴퓨터 장치를 통해 구현될 수 있다. 이때, 컴퓨터 장치에는 본 발명의 일실시예에 따른 컴퓨터 프로그램이 설치 및 구동될 수 있고, 컴퓨터 장치는 구동된 컴퓨터 프로그램의 제어에 따라 본 발명의 실시예들에 따른 라이선스 검증 방법을 수행할 수 있다. 상술한 컴퓨터 프로그램은 컴퓨터 장치와 결합되어 라이선스 검증 방법을 컴퓨터에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장될 수 있다.The license verification system according to embodiments of the present invention can be implemented through a computer device such as a server to be described later. At this time, a computer program according to an embodiment of the present invention can be installed and driven in the computer apparatus, and the computer apparatus can perform the license verification method according to the embodiments of the present invention under the control of the computer program that is driven . The above-described computer program may be stored in a computer-readable recording medium in combination with a computer apparatus for executing a license verification method on the computer.
도 1은 본 발명의 일실시예에 따른 네트워크 환경의 예를 도시한 도면이다. 도 1의 네트워크 환경은 복수의 전자 기기들(110, 120, 130, 140), 복수의 서버들(150, 160) 및 네트워크(170)를 포함하는 예를 나타내고 있다. 이러한 도 1은 발명의 설명을 위한 일례로 전자 기기의 수나 서버의 수가 도 1과 같이 한정되는 것은 아니다.1 is a diagram illustrating an example of a network environment according to an embodiment of the present invention. 1 shows an example in which a plurality of electronic devices 110, 120, 130, 140, a plurality of servers 150, 160, and a network 170 are included. 1, the number of electronic devices and the number of servers are not limited to those shown in FIG.
복수의 전자 기기들(110, 120, 130, 140)은 컴퓨터 장치로 구현되는 고정형 단말이거나 이동형 단말일 수 있다. 복수의 전자 기기들(110, 120, 130, 140)의 예를 들면, 스마트폰(smart phone), 휴대폰, 네비게이션, 컴퓨터, 노트북, 디지털방송용 단말, PDA(Personal Digital Assistants), PMP(Portable Multimedia Player), 태블릿 PC 등이 있다. 일례로 도 1에서는 전자 기기 1(110)의 예로 스마트폰의 형상을 나타내고 있으나, 본 발명의 실시예들에서 전자 기기 1(110)은 실질적으로 무선 또는 유선 통신 방식을 이용하여 네트워크(170)를 통해 다른 전자 기기들(120, 130, 140) 및/또는 서버(150, 160)와 통신할 수 있는 다양한 물리적인 컴퓨터 장치들 중 하나를 의미할 수 있다.The plurality of electronic devices 110, 120, 130, 140 may be a fixed terminal implemented as a computer device or a mobile terminal. Examples of the plurality of electronic devices 110, 120, 130 and 140 include a smart phone, a mobile phone, a navigation device, a computer, a notebook, a digital broadcast terminal, a PDA (Personal Digital Assistants) ), And tablet PCs. For example, FIG. 1 illustrates the shape of a smartphone as an example of the first electronic device 110, but in the embodiments of the present invention, the first electronic device 110 transmits the network 170 using a wireless or wired communication method. Or any of a variety of physical computer devices capable of communicating with other electronic devices 120, 130, 140 and / or servers 150,
통신 방식은 제한되지 않으며, 네트워크(170)가 포함할 수 있는 통신망(일례로, 이동통신망, 유선 인터넷, 무선 인터넷, 방송망)을 활용하는 통신 방식뿐만 아니라 기기들간의 근거리 무선 통신 역시 포함될 수 있다. 예를 들어, 네트워크(170)는, PAN(personal area network), LAN(local area network), CAN(campus area network), MAN(metropolitan area network), WAN(wide area network), BBN(broadband network), 인터넷 등의 네트워크 중 하나 이상의 임의의 네트워크를 포함할 수 있다. 또한, 네트워크(170)는 버스 네트워크, 스타 네트워크, 링 네트워크, 메쉬 네트워크, 스타-버스 네트워크, 트리 또는 계층적(hierarchical) 네트워크 등을 포함하는 네트워크 토폴로지 중 임의의 하나 이상을 포함할 수 있으나, 이에 제한되지 않는다.The communication method is not limited, and may include a communication method using a communication network (for example, a mobile communication network, a wired Internet, a wireless Internet, a broadcasting network) that the network 170 may include, as well as a short-range wireless communication between the devices. For example, the network 170 may be a personal area network (LAN), a local area network (LAN), a campus area network (CAN), a metropolitan area network (MAN), a wide area network (WAN) , A network such as the Internet, and the like. The network 170 may also include any one or more of a network topology including a bus network, a star network, a ring network, a mesh network, a star-bus network, a tree or a hierarchical network, It is not limited.
서버(150, 160) 각각은 복수의 전자 기기들(110, 120, 130, 140)과 네트워크(170)를 통해 통신하여 명령, 코드, 파일, 컨텐츠, 서비스 등을 제공하는 컴퓨터 장치 또는 복수의 컴퓨터 장치들로 구현될 수 있다. 예를 들어, 서버(150)는 네트워크(170)를 통해 접속한 복수의 전자 기기들(110, 120, 130, 140)로 제1 서비스를 제공하는 시스템일 수 있으며, 서버(160) 역시 네트워크(170)를 통해 접속한 복수의 전자 기기들(110, 120, 130, 140)로 제2 서비스를 제공하는 시스템일 수 있다. 보다 구체적인 예로, 서버(150)는 제1 서비스로서 복수의 전자 기기들(110, 120, 130, 140)에 어플리케이션을 설치 및 구동시키기 위한 파일을 복수의 전자 기기들(110, 120, 130, 140)로 배포할 수 있다. 또한, 서버(160)는 상술한 어플리케이션을 통해, 해당 어플리케이션이 목적하는 서비스를 제2 서비스로서 복수의 전자 기기들(110, 120, 130, 140)로 제공할 수 있다.Each of the servers 150 and 160 is a computer device or a plurality of computers that communicate with a plurality of electronic devices 110, 120, 130 and 140 through a network 170 to provide commands, codes, files, Lt; / RTI > devices. For example, the server 150 may be a system that provides a first service to a plurality of electronic devices 110, 120, 130, 140 connected through a network 170, 170, and 140 to the first and second electronic devices 110, 120, 130, and 140, respectively. As a more specific example, the server 150 transmits a file for installing and operating an application to a plurality of electronic apparatuses 110, 120, 130, 140 as a first service, ). In addition, the server 160 can provide a service desired by the application to the plurality of electronic devices 110, 120, 130, and 140 as the second service through the application.
이때, 서버(150)에는 본 발명의 실시예들에 따른 라이선스 검증 시스템이 구현될 수 있다. 라이선스 검증 시스템은 개발자로부터 서버(150)에 등록되는 어플리케이션을 설치 및 구동시키기 위한 파일에 대해 오픈소스 소프트웨어의 사용을 감지할 수 있으며, 감지된 오픈소스 소프트웨어의 라이선스 정보를 관리자에게 제공할 수 있다. 실시예에 따라 라이선스 검증 시스템은 서버(150)와 구별되는 별도의 컴퓨터 장치로 구현되어 서버(150)와 네트워크(170)를 통해 연계될 수도 있다.At this time, a license verification system according to embodiments of the present invention may be implemented in the server 150. [ The license verification system can detect the use of the open source software for the file for installing and running the application registered in the server 150 from the developer and can provide the license information of the detected open source software to the administrator. The license verification system may be implemented as a separate computer device that is separate from the server 150 and may be linked to the server 150 through the network 170. [
도 2는 본 발명의 일실시예에 따른 컴퓨터 장치의 예를 도시한 블록도이다. 앞서 설명한 복수의 전자 기기들(110, 120, 130, 140) 각각이나 서버들(150, 160) 그리고 본 발명의 실시예들에 따른 라이선스 검증 시스템은 도 2를 통해 도시된 컴퓨터 장치(200)에 의해 구현될 수 있으며, 일실시예에 따른 라이선스 검증 방법은 이러한 컴퓨터 장치(200)에 의해 구현되는 라이선스 검증 시스템에 의해 수행될 수 있다. 만약, 라이선스 검증 시스템이 서버(150)에 구현되는 경우, 서버(150)를 구현하는 컴퓨터 장치(200)에 의해 본 발명의 실시예들에 다른 라이선스 검증 방법이 수행될 수 있다. 예를 들어, 컴퓨터 장치(200)에는 일실시예에 따른 컴퓨터 프로그램이 설치 및 구동될 수 있고, 컴퓨터 장치(200)는 구동된 컴퓨터 프로그램의 제어에 따라 본 발명의 실시예들에 따른 라이선스 검증 방법을 수행할 수 있다. 실시예에 따라 라이선스 검증 시스템은 복수의 컴퓨터 장치들의 결합을 통해 구현될 수도 있다.2 is a block diagram illustrating an example of a computing device in accordance with an embodiment of the present invention. Each of the plurality of electronic devices 110, 120, 130, 140 described above or the servers 150, 160 and the license verification system according to the embodiments of the present invention are connected to the computer device 200 shown in FIG. 2 And a license verification method according to an embodiment may be performed by a license verification system implemented by such a computer device 200. [ If a license verification system is implemented in the server 150, another license verification method may be performed in embodiments of the present invention by the computer device 200 implementing the server 150. [ For example, a computer program according to one embodiment may be installed and operated in the computer device 200, and the computer device 200 may be provided with a license verification method according to embodiments of the present invention Can be performed. According to an embodiment, the license verification system may be implemented through a combination of a plurality of computer devices.
이러한 컴퓨터 장치(200)는 도 2에 도시된 바와 같이, 메모리(210), 프로세서(220), 통신 인터페이스(230) 그리고 입출력 인터페이스(240)를 포함할 수 있다. 메모리(210)는 컴퓨터에서 판독 가능한 기록매체로서, RAM(random access memory), ROM(read only memory) 및 디스크 드라이브와 같은 비소멸성 대용량 기록장치(permanent mass storage device)를 포함할 수 있다. 여기서 ROM과 디스크 드라이브와 같은 비소멸성 대용량 기록장치는 메모리(210)와는 구분되는 별도의 영구 저장 장치로서 컴퓨터 장치(200)에 포함될 수도 있다. 또한, 메모리(210)에는 운영체제와 적어도 하나의 프로그램 코드가 저장될 수 있다. 이러한 소프트웨어 구성요소들은 메모리(210)와는 별도의 컴퓨터에서 판독 가능한 기록매체로부터 메모리(210)로 로딩될 수 있다. 이러한 별도의 컴퓨터에서 판독 가능한 기록매체는 플로피 드라이브, 디스크, 테이프, DVD/CD-ROM 드라이브, 메모리 카드 등의 컴퓨터에서 판독 가능한 기록매체를 포함할 수 있다. 다른 실시예에서 소프트웨어 구성요소들은 컴퓨터에서 판독 가능한 기록매체가 아닌 통신 인터페이스(230)를 통해 메모리(210)에 로딩될 수도 있다. 예를 들어, 소프트웨어 구성요소들은 네트워크(170)를 통해 수신되는 파일들에 의해 설치되는 컴퓨터 프로그램에 기반하여 컴퓨터 장치(200)의 메모리(210)에 로딩될 수 있다.The computer device 200 may include a memory 210, a processor 220, a communication interface 230, and an input / output interface 240, as shown in FIG. The memory 210 may be a computer-readable recording medium and may include a permanent mass storage device such as a random access memory (RAM), a read only memory (ROM), and a disk drive. The non-decaying mass storage device, such as a ROM and a disk drive, may be included in the computer device 200 as a separate persistent storage device separate from the memory 210. Also, the memory 210 may store an operating system and at least one program code. These software components may be loaded into the memory 210 from a computer readable recording medium separate from the memory 210. [ Such a computer-readable recording medium may include a computer-readable recording medium such as a floppy drive, a disk, a tape, a DVD / CD-ROM drive, and a memory card. In other embodiments, the software components may be loaded into the memory 210 via the communication interface 230 rather than from a computer readable recording medium. For example, the software components may be loaded into the memory 210 of the computer device 200 based on a computer program installed by files received via the network 170.
프로세서(220)는 기본적인 산술, 로직 및 입출력 연산을 수행함으로써, 컴퓨터 프로그램의 명령을 처리하도록 구성될 수 있다. 명령은 메모리(210) 또는 통신 인터페이스(230)에 의해 프로세서(220)로 제공될 수 있다. 예를 들어 프로세서(220)는 메모리(210)와 같은 기록 장치에 저장된 프로그램 코드에 따라 수신되는 명령을 실행하도록 구성될 수 있다.The processor 220 may be configured to process instructions of a computer program by performing basic arithmetic, logic, and input / output operations. The instructions may be provided to the processor 220 by the memory 210 or the communication interface 230. For example, the processor 220 may be configured to execute a command received in accordance with a program code stored in a recording device, such as the memory 210. [
통신 인터페이스(230)은 네트워크(170)를 통해 컴퓨터 장치(200)가 다른 장치(일례로, 앞서 설명한 저장 장치들)와 서로 통신하기 위한 기능을 제공할 수 있다. 일례로, 컴퓨터 장치(200)의 프로세서(220)가 메모리(210)와 같은 기록 장치에 저장된 프로그램 코드에 따라 생성한 요청이나 명령, 데이터, 파일 등이 통신 인터페이스(230)의 제어에 따라 네트워크(170)를 통해 다른 장치들로 전달될 수 있다. 역으로, 다른 장치로부터의 신호나 명령, 데이터, 파일 등이 네트워크(170)를 거쳐 컴퓨터 장치(200)의 통신 인터페이스(230)를 통해 컴퓨터 장치(200)로 수신될 수 있다. 통신 인터페이스(230)를 통해 수신된 신호나 명령, 데이터 등은 프로세서(220)나 메모리(210)로 전달될 수 있고, 파일 등은 컴퓨터 장치(200)가 더 포함할 수 있는 저장 매체(상술한 영구 저장 장치)로 저장될 수 있다.The communication interface 230 may provide functionality for the computer device 200 to communicate with another device (e. G., The storage devices described above) via the network 170. For example, a request, command, data, file, or the like, generated by the processor 220 of the computer device 200 according to the program code stored in the recording device such as the memory 210, 170 to other devices. Conversely, signals, commands, data, files, etc., from other devices may be received by the computer device 200 via the communication interface 230 of the computer device 200 via the network 170. Data or the like received via the communication interface 230 may be transferred to the processor 220 or the memory 210 and the file or the like may be transferred to a storage medium Permanent storage).
입출력 인터페이스(240)는 입출력 장치(250)와의 인터페이스를 위한 수단일 수 있다. 예를 들어, 입력 장치는 마이크, 키보드 또는 마우스 등의 장치를, 그리고 출력 장치는 디스플레이, 스피커와 같은 장치를 포함할 수 있다. 다른 예로 입출력 인터페이스(240)는 터치스크린과 같이 입력과 출력을 위한 기능이 하나로 통합된 장치와의 인터페이스를 위한 수단일 수도 있다. 입출력 장치(250)는 컴퓨터 장치(200)와 하나의 장치로 구성될 수도 있다.The input / output interface 240 may be a means for interfacing with the input / output device 250. For example, the input device may include a device such as a microphone, a keyboard or a mouse, and an output device may include a device such as a display, a speaker, and the like. As another example, the input / output interface 240 may be a means for interfacing with a device having integrated functions for input and output, such as a touch screen. The input / output device 250 may be composed of the computer device 200 and one device.
또한, 다른 실시예들에서 컴퓨터 장치(200)는 도 2의 구성요소들보다 더 적은 혹은 더 많은 구성요소들을 포함할 수도 있다. 그러나, 대부분의 종래기술적 구성요소들을 명확하게 도시할 필요성은 없다. 예를 들어, 컴퓨터 장치(200)는 상술한 입출력 장치(250) 중 적어도 일부를 포함하도록 구현되거나 또는 트랜시버(transceiver), 데이터베이스 등과 같은 다른 구성요소들을 더 포함할 수도 있다.Also, in other embodiments, the computer device 200 may include fewer or more components than the components of FIG. However, there is no need to clearly illustrate most prior art components. For example, the computer device 200 may be implemented to include at least some of the input / output devices 250 described above, or may further include other components such as a transceiver, database, and the like.
도 3은 본 발명의 일실시예에 있어서, 오픈소스 소프트웨어의 패턴을 수집하는 방법의 예를 도시한 흐름도이다. 본 실시예에 따른 방법은 일실시예에 따른 라이선스 검증 방법에 포함될 수 있으며, 앞서 설명한 컴퓨터 장치(200)에 의해 수행될 수 있다. 예를 들어, 컴퓨터 장치(200)의 프로세서(220)는 메모리(210)가 포함하는 운영체제의 코드나 적어도 하나의 프로그램의 코드에 따른 제어 명령(instruction)을 실행하도록 구현될 수 있다. 여기서, 프로세서(220)는 컴퓨터 장치(200)에 저장된 코드가 제공하는 제어 명령에 따라 컴퓨터 장치(200)가 도 3의 방법이 포함하는 단계들(310 내지 340)을 수행하도록 컴퓨터 장치(200)를 제어할 수 있다.Figure 3 is a flow chart illustrating an example of a method for collecting patterns of open source software in one embodiment of the present invention. The method according to the present embodiment may be included in the license verification method according to an embodiment, and may be performed by the computer device 200 described above. For example, the processor 220 of the computer device 200 may be implemented to execute control instructions in accordance with the code of the operating system or the code of at least one program that the memory 210 includes. Here, the processor 220 is configured to cause the computer device 200 to perform the steps 310 to 340 included in the method of FIG. 3 in accordance with the control command provided by the code stored in the computer device 200. [ Can be controlled.
단계(310)에서 컴퓨터 장치(200)는 오픈소스 소프트웨어를 다운로드할 수 있다. 예를 들어, 컴퓨터 장치(200)는 오픈소스 소프트웨어의 소스코드를 공유하는 복수의 사이트들 중 적어도 하나의 사이트로부터 복수의 오픈소스 소프트웨어들을 다운로드 할 수 있으며, 다운로드된 복수의 오픈소스 소프트웨어들 각각에 대해 아래의 단계(320) 내지 단계(340)을 수행할 수 있다.At step 310, the computer device 200 may download open source software. For example, the computer device 200 may download a plurality of open source software from at least one of a plurality of sites that share the source code of the open source software, (320) to (340) below.
단계(320)에서 컴퓨터 장치(200)는 다운로드된 오픈소스 소프트웨어에서 메소드 호출 정보를 추출할 수 있다. 일례로, 메소드 호출 정보는 특정 메소드를 호출하기 위해 요구되는 정보로서, 자바(Java) 코드에서는 클래스 경로명, 클래스명, 메소드명, 메소드 인자의 개수, 각 인자의 타입을 포함할 수 있다. 이때, 컴퓨터 장치(200)는 적어도 클래스 경로명, 클래스명 및 메소드명을 상기 메소드 호출 정보로서 추출할 수 있다. 실시예에 따라 메소드 인자의 개수 및 각 인자의 타입 중 적어도 하나가 메소드 호출 정보로서 더 추출될 수도 있다.In step 320, the computer device 200 may extract the method call information from the downloaded open source software. For example, the method call information is information required to call a specific method. In Java code, it may include a class path name, a class name, a method name, a number of method arguments, and a type of each argument. At this time, the computer device 200 can extract at least the class path name, the class name, and the method name as the method calling information. Depending on the embodiment, at least one of the number of method arguments and the type of each argument may be further extracted as method call information.
단계(330)에서 컴퓨터 장치(200)는 추출된 메소드 호출 정보를 이용하여 기설정된 코드 형태의 패턴을 생성할 수 있다. 예를 들어, 컴퓨터 장치(200)는 추출된 메소드 호출 정보를 이용하여 안드로이드 어플리케이션을 위한 패키지 파일인 APK(Android application package) 파일에서 사용되는 smali 코드 형태의 패턴을 생성할 수 있다. 이후 보다 자세히 설명하는 바와 같이, smali 코드 형태의 패턴은 클래스 경로명, 클래스명 및 메소드명을 포함할 수 있다.In step 330, the computer device 200 may generate a pattern of a predetermined code type using the extracted method call information. For example, the computer device 200 can generate a pattern of a smali code form used in an APK (Android application package) file, which is a package file for an Android application, using the extracted method call information. As will be described in more detail later, the pattern of the smali code form may include a class path name, a class name, and a method name.
단계(340)에서 컴퓨터 장치(200)는 생성된 패턴을 해당 오픈소스 소프트웨어의 식별자와 연계하여 데이터베이스에 저장할 수 있다. 일례로, 오픈소스 소프트웨어의 식별자는 해당 오픈소스 소프트웨어의 이름일 수 있다. 또한, 다운로드된 복수의 오픈소스 소프트웨어들 각각에 대해 적어도 하나의 패턴이 생성될 수 있으며, 생성된 패턴들은 복수의 오픈소스 소프트웨어들 각각의 식별자와 연계되어 데이터베이스에 저장될 수 있다. In step 340, the computer device 200 may store the generated pattern in a database in association with the identifier of the corresponding open source software. For example, the identifier of the open source software may be the name of the corresponding open source software. In addition, at least one pattern may be generated for each of the plurality of downloaded open source software, and the generated patterns may be stored in the database in association with the identifiers of each of the plurality of open source software.
도 4는 본 발명의 일실시예에 있어서, 패턴을 이용한 오픈소스 소프트웨어의 사용 여부를 검사하는 방법의 예를 도시한 흐름도이다. 본 실시예에 따른 방법 역시 일실시예에 따른 라이선스 검증 방법에 포함될 수 있다. 예를 들어, 도 3의 실시예에 따른 방법을 통해 다양한 오픈소스 소프트웨어들 각각에 대한 패턴들이 생성되어 데이터베이스화된 이후, 도 4의 실시예에 따른 방법을 통해 특정 어플리케이션에 대해 오픈소스 소프트웨어 검사가 수행될 수 있다. 본 실시예에 따른 방법 역시 앞서 설명한 컴퓨터 장치(200)에 의해 수행될 수 있다. 예를 들어, 컴퓨터 장치(200)의 프로세서(220)는 메모리(210)가 포함하는 운영체제의 코드나 적어도 하나의 프로그램의 코드에 따른 제어 명령(instruction)을 실행하도록 구현될 수 있다. 여기서, 프로세서(220)는 컴퓨터 장치(200)에 저장된 코드가 제공하는 제어 명령에 따라 컴퓨터 장치(200)가 도 4의 방법이 포함하는 단계들(410 내지 440)을 수행하도록 컴퓨터 장치(200)를 제어할 수 있다.4 is a flowchart illustrating an example of a method for checking whether open source software is used using a pattern in an embodiment of the present invention. The method according to the present embodiment can also be included in the license verification method according to the embodiment. For example, after patterns for each of the various open source software are generated and databaseized through the method according to the embodiment of FIG. 3, an open source software check is performed for a particular application via the method according to the embodiment of FIG. . The method according to the present embodiment can also be performed by the computer apparatus 200 described above. For example, the processor 220 of the computer device 200 may be implemented to execute control instructions in accordance with the code of the operating system or the code of at least one program that the memory 210 includes. Here, the processor 220 is configured to cause the computer device 200 to perform the steps 410 to 440 of the method of FIG. 4 in accordance with the control command provided by the code stored in the computer device 200, Can be controlled.
단계(410)에서 컴퓨터 장치(200)는 검사의 대상이 되는 패키지 파일을 입력받을 수 있다. 예를 들어, 안드로이드 어플리케이션이 검사의 대상이 되는 경우, 컴퓨터 장치(200)는 해당 안드로이드 어플리케이션의 설치 및 구동을 위한 APK 파일을 입력받을 수 있다.In step 410, the computer device 200 can receive a package file to be inspected. For example, when the Android application is to be inspected, the computer device 200 can receive an APK file for installing and running the corresponding Android application.
단계(420)에서 컴퓨터 장치(200)는 패키지 파일의 실행파일을 추출할 수 있다. 상술한 안드로이드 어플리케이션의 예에서 컴퓨터 장치(200)는 입력된 APK 파일에서 압축을 해제하여 'classes.dex'와 같은 덱스(Dalvik Executable, DEX) 파일을 실행파일로서 추출할 수 있다. 압축의 해제 후 덱스 파일은 압축이 해제된 디렉토리의 루트 경로에 존재하게 된다.At step 420, the computer device 200 may extract an executable file of the package file. In the above-described example of the Android application, the computer device 200 can decompress the inputted APK file and extract a DAX file such as 'classes.dex' as an executable file. After decompression, the file is located in the root directory of the decompressed directory.
단계(430)에서 컴퓨터 장치(200)는 추출한 실행파일을 기설정된 코드 형태로 변환할 수 있다. 예를 들어, 도 3에서 설명한 smali 코드 형태를 이용하는 경우, 컴퓨터 장치(200)는 baksmali 라이브러리를 이용하여 실행파일을 smali 코드로 변환할 수 있다. 만약, 단계(420)에서 APK 파일의 압축을 해제하기 위한 툴인 apktool에서 baksmali 라이브러리를 내장하고 있는 경우에는 APK 파일의 압축과 덱스 파일의 smali 코드로의 변환이 동시에 이루어질 수도 있다.In step 430, the computer device 200 may convert the extracted executable file into a predetermined code format. For example, in the case of using the smali code form described in FIG. 3, the computer device 200 can convert the executable file into the smali code using the baksmali library. If the baksmali library is embedded in the apktool, which is a tool for decompressing the APK file in step 420, the compression of the APK file and the conversion of the dex file into the smali code may be performed at the same time.
단계(440)에서 컴퓨터 장치(200)는 기설정된 코드 형태로 변환된 실행파일에서 메소드 호출 정보를 추출할 수 있다. 이때, 추출되는 메소드 호출 정보는 실행파일이 이미 기설정된 코드 형태로 변환되었기 때문에 도 3의 단계(330)에서 생성된 패턴과 동일 또는 유사한 형태를 가질 수 있으며, 적어도 클래스 경로명, 클래스명 및 메소드명을 포함할 수 있다. 실시예에 따라 메소드 인자의 개수 및 각 인자의 타입 중 적어도 하나가 단계(440)에서 추출된 메소드 호출 정보에 더 포함될 수도 있다.In step 440, the computer device 200 may extract the method call information from the executable file converted into a predetermined code form. At this time, the extracted method call information may have the same or similar form as the pattern generated in step 330 of FIG. 3 because the executable file has been converted into the predetermined code form, and at least the class path name, the class name, . ≪ / RTI > At least one of the number of method arguments and the type of each argument may be further included in the method call information extracted in step 440 according to an embodiment.
단계(450)에서 컴퓨터 장치(200)는 추출된 메소드 호출 정보를 데이터베이스에 저장된 패턴과 비교할 수 있다. 이때, 데이터베이스에 추출된 메소드 호출 정보와 일치(혹은 추출된 메소드 호출 정보를 포함)하는 패턴이 존재하는 경우, 해당 패턴에 대응하여 데이터베이스에 저장된 오픈소스 소프트웨어의 식별자에 따라 단계(410)에서 입력된 패키지 파일이 해당 오픈소스 소프트웨어를 사용하고 있음을 알 수 있다.At step 450, the computer device 200 may compare the extracted method call information with the pattern stored in the database. At this time, if there is a pattern matching the extracted method call information (or including the extracted method call information) in the database, it is determined in step 410 whether or not the pattern is inputted in accordance with the identifier of the open- You can see that the package file uses the corresponding open source software.
이후, 컴퓨터 장치(200)는 검색된 오픈소스 소프트웨어의 식별자와 해당 오픈소스 소프트웨어에 매칭된 라이선스 정보를 제공할 수 있다. 이 경우, 관리자는 검색의 대상이 되는 패키지 파일이 어떠한 오픈소스 소프트웨어를 사용하고 있으며, 어떠한 라이선스가 적용되고 있는가를 파악할 수 있게 된다.The computer device 200 may then provide the identifier of the searched open source software and the license information matched to the corresponding open source software. In this case, the administrator can know which open source software the package file to search for is using and which license is being applied.
도 5는 본 발명의 일실시예에 있어서, 오픈소스 소프트웨어의 소스코드로부터 smali 코드 형태의 패턴을 생성하는 예를 도시한 도면이다. 도 5는 오픈소스 소프트웨어의 예로서, 해당 오픈소스 소프트웨어를 위한 자바 코드 파일 'Square.java'(510)과 'Square.java'(510)에 포함된 자바 코드(520)의 예를 나타내고 있다. 이러한 자바 코드(520)에 따르면, 제1 점선박스(521)에 나타난 'com.sample.math'의 패키지 경로에 제2 점선박스(522)에 나타난 'Square' 클래스가 정의되어 있으며, 'Square' 클래스에는 제3 점선박스(523)에 나타난 'getWidth()' 메소드가 포함되어 있음을 알 수 있다.5 is a diagram showing an example of generating a pattern of the smali code form from the source code of open source software in an embodiment of the present invention. FIG. 5 shows an example of Java code 520 included in the Java code file 'Square.java' 510 and 'Square.java' 510 for the corresponding open source software. According to the Java code 520, the 'Square' class shown in the second dotted line box 522 is defined in the package path of 'com.sample.math' shown in the first dotted line box 521, The class includes the method 'getWidth ()' shown in the third dashed line box 523.
컴퓨터 장치(200)는 단계(320)에서 이러한 자바 코드(520)로부터 메소드 호출 정보로서 패키지 경로명 'com.sample.math', 클래스명 'Square', 그리고 메소드명 'getWidth()'을 각각 추출할 수 있다. The computer device 200 extracts the package path name 'com.sample.math', the class name 'Square', and the method name 'getWidth ()' as the method calling information from the Java code 520 at step 320 .
이 경우, 컴퓨터 장치(200)는 단계(330)에서 추출된 정보를 이용하여 도 5에 도시된 바와 같이 대응하는 smali 코드 형태의 정보(530)를 생성할 수 있다. smali 코드 형태의 정보(530)에서 'invoke-virtual' 명령어는 smali 코드 형태에서 virtual 메소드를 호출하는 명령어이며, 이때, 호출되는 메소드는 static 메소드, private 메소드, final 메소드, constructor 메소드가 아니어야 한다. 'v0'는 클래스의 인스턴스를, 클래스 경로명 'com.sample.math' 앞의 'L'은 클래스가 객체 타입임을 의미할 수 있고, 메소드명 'getWidth()' 뒤의 'V'는 리턴 타입이 보이드(void)임을 의미할 수 있다. 그 외에 상위 클래스의 virtual 메소드를 호출하는 'invoke-super' 명령어, direct 메소드 B를 호출하는 'invoke-direct' 명령어, static 메소드를 호출하는 'invoke-static' 명령어, interface 메소드를 호출하는 'invoke-interface' 명령어 등이 사용될 수 있다. 이때, 'invoke-super' 명령어를 통해 호출되는 메소드는 static 메소드, private 메소드, final 메소드, constructor 메소드가 아니어야 한다. 또한, 'invoke-direct' 명령어를 통해 호출되는 메소드는 static 메소드가 아니어야 하며, 'invoke-direct' 명령어는 private 메소드, constructor 메소드와 같이 오버라이드(override) 할 수 없는 메소드를 호출할 때 사용될 수 있다. In this case, the computer device 200 may generate the information 530 in the form of a corresponding smali code, as shown in FIG. 5, using the information extracted in step 330. The 'invoke-virtual' command in the smali code-type information (530) is a command to call a virtual method in the smali code form. In this case, the called method should not be a static method, a private method, a final method, or a constructor method. 'v0' is an instance of the class, 'L' before the class path name 'com.sample.math' may mean that the class is an object type, and 'V' after the method name 'getWidth () It can mean void. The invoke-super command invokes the virtual method of the superclass, the invoke-direct command invokes the direct method B, the invoke-static command invokes the static method, the invoke- interface 'command can be used. At this time, the method invoked through the 'invoke-super' command must not be a static method, a private method, a final method, or a constructor method. Also, the method invoked via the 'invoke-direct' command must not be a static method, and the 'invoke-direct' command can be used to invoke methods that can not be overridden, such as private methods and constructor methods. .
이 경우, 특정 패키지 파일의 실행파일에서 'com.sample.math' 클래스 경로를 통해 'Square' 클래스의 'getWidth()'를 호출하는 경우, 자바 코드 파일 'Square.java'(510)를 포함하는 오픈소스 소프트웨어를 사용함을 알 수 있게 된다.In this case, if you call 'getWidth ()' of the 'Square' class through the class path 'com.sample.math' in the executable file of a particular package file, You will notice that you are using open source software.
클래스의 경로인 패키지명에는 일반적으로 회사명, 소프트웨어명과 같이 고유한 이름이 포함되어 있기 때문에, 중복의 위험이 낮으며, 두 개 이상의 클래스와 메소드에 대해 패턴을 생성하여 검사하는 경우, 오탐의 확률은 제로에 가깝다.Since the package name, which is a path of a class, generally includes a unique name such as a company name and a software name, the risk of redundancy is low. In the case of generating a pattern for two or more classes and methods, Is close to zero.
이때, 컴퓨터 장치(200)는 일례로, 제4 점선박스(540)에 나타난 'Lcom/sample/math/Square;->getWidth()V'를 패턴으로서 데이터베이스에 저장할 수 있다.At this time, the computer device 200 may store 'Lcom / sample / math / square; -> getWidth () V' shown in the fourth dotted line box 540 as a pattern in the database.
도 6 및 도 7은 본 발명의 일실시예에 있어서, 덱스 파일을 smali 코드로 변환한 예를 도시한 도면들이다. 도 6의 제1 박스(610)는 덱스 파일 'classes.dex'의 코드 중 일부를 나타내고 있으며, 도 7의 제2 박스(620)는 덱스 파일 'classes.dex'를 baksmali 라이브러리를 이용하여 변환한 smali 파일 'class.smali'의 코드 중 일부를 나타내고 있다. 예를 들어, 컴퓨터 장치(200)는 '$ java -jar baksmali.jar -o <output directory> classes.dex'와 같은 명령을 통해 덱스 파일 'classes.dex'을 smali 파일 'class.smali'로 변환할 수 있다. 6 and 7 are diagrams illustrating an example of converting a Dex file into an smali code in an embodiment of the present invention. The first box 610 in FIG. 6 shows a part of the code of the Dex file 'classes.dex', and the second box 620 in FIG. 7 converts the Dex file 'classes.dex' using the baksmali library It shows some of the code of the smali file 'class.smali'. For example, the computer device 200 converts a dex file 'classes.dex' to a smali file 'class.smali' through a command such as '$ java -jar baksmali.jar -o <output directory> classes.dex' can do.
이때, 컴퓨터 장치(200)는 변환된 smali 파일 'class.smali'에서 'invoke-virtual' 명령어를 통해 메소드를 호출하는 코드를 식별할 수 있으며, 이러한 코드로부터 메소드 호출 정보를 추출할 수 있다.At this time, the computer device 200 can identify a code for calling a method through the 'invoke-virtual' command in the converted smali file 'class.smali', and extract the method call information from the code.
도 8은 본 발명의 일실시예에 있어서, 자바 코드와 자바 코드에 대응하는 smali 코드의 예를 도시한 도면이다. 도 7에서 제1 박스(710)는 안드로이드의 'Toast'를 이용하여 "Toast Hello"라는 간단한 메시지를 화면에 출력하는 자바 코드의 예를 나타내고 있으며, 제2 박스(720)는 제1 박스(710)의 자바 코드를 smali 코드의 형태로 변환한 예를 나타내고 있다. 실질적으로는 자바 코드를 덱스 파일의 코드 형태로 변환한 후 도 6에서와 같이 덱스 파일을 다시 smali 파일의 형태로 변환하는 과정이 요구된다.8 is a diagram showing an example of a smali code corresponding to a Java code and a Java code in an embodiment of the present invention. 7, the first box 710 shows an example of a Java code for outputting a simple message "Toast Hello" using Android 'Toast', and the second box 720 includes a first box 710 ) Is converted into the form of smali code. Actually, it is required to convert the Java code into the code form of the Dex file, and then convert the Dex file to the smali file form as shown in FIG.
이때, 점선박스(830)에 나타난 바와 같이, 클래스 'Toast'의 메소드 'show()'를 호출하는 코드를 살펴보면, 'v1'은 클래스 'Toast'의 인스턴스를, 'android/widget/Toast'는 클래스 경로와 클래스를, 'show()'는 메소드를, 'V'는 리턴 타입 보이드(void)를 각각 나타내고 있다. 이처럼, 컴퓨터 장치(200)는 smali 코드 형태로 변환된 실행 코드로부터 메소드 호출 정보를 추출할 수 있게 되며, 바람직하게는 도 3에서 데이터베이스에 저장되는 패턴과의 비교를 위해 "Landroid/widget/Toast;->show()V"와 같은 형태로 메소드 호출 정보를 추출할 수 있다.At this time, as shown in the dotted box 830, if we look at the code that calls the method 'show ()' of class 'Toast', 'v1' is an instance of class 'Toast', and 'android / widget / Toast' The class path and class, 'show ()' the method, and 'V' the return type void. Thus, the computer device 200 is able to extract the method call information from the executable code converted into the smali code form, and preferably, for comparison with the pattern stored in the database in FIG. 3, "Landroid / widget / Toast; -> show () V "to retrieve method call information.
컴퓨터 장치(200)는 추출된 메소드 호출 정보와 데이터베이스에서 읽어온 패턴을 비교하여 일치 여부를 판단할 수 있으며, 일치하는 경우 해당 패턴과 연계하여 데이터베이스에 저장된 오픈소스 소프트웨어의 식별자를 통해 검사의 대상이 되는 패키지 파일이 해당 오픈소스 소프트웨어를 사용하고 있다고 판단할 수 있게 된다. 패키지명(클래스 경로명), 클래스명, 메소드명은 각각 회사명, 기능명을 의미하기 때문에 중복의 위험은 적으나, 중복의 위험이 있다면, 두 개 이상의 패턴을 비교하여 오탐의 확률을 줄일 수 있다.The computer device 200 can compare the extracted method call information and the pattern read from the database to determine whether they match or not. If they match, the computer device 200 searches the target of the inspection through the identifier of the open source software stored in the database It can be determined that the package file is using the open source software. Since the package name (class path name), class name, and method name represent the company name and the function name, respectively, the risk of duplication is small. However, if there is a risk of duplication, the probability of false positives can be reduced by comparing two or more patterns.
또한, 컴퓨터 장치(200)는 패키지 파일이 해당 오픈소스 소프트웨어를 사용하고 있다고 결정되는 경우, 해당하는 오픈소스 소프트웨어의 식별자(일례로, 오픈소스 소프트웨어명)과 해당하는 오픈소스 소프트웨어에서 사용하는 라이선스의 식별자(일례로, 라이선스명)를 제공할 수 있다.In addition, if it is determined that the package file is using the corresponding open source software, the computer device 200 may determine that the identifier of the corresponding open source software (e.g., open source software name) and the license used by the corresponding open source software An identifier (e.g., a license name) may be provided.
이하에서는 패키지 파일의 구조에 따른 형태 비교를 통해 라이선스를 검증하는 실시예를 설명한다.Hereinafter, an embodiment of verifying the license through the type comparison according to the structure of the package file will be described.
도 9는 본 발명의 일실시예에 있어서, 패키지 파일의 구조를 오픈소스 소프트웨어의 패턴으로서 수집하는 방법의 예를 도시한 흐름도이다. 본 실시예에 따른 방법은 일실시예에 따른 라이선스 검증 방법에 포함될 수 있으며, 앞서 설명한 컴퓨터 장치(200)에 의해 수행될 수 있다. 예를 들어, 컴퓨터 장치(200)의 프로세서(220)는 메모리(210)가 포함하는 운영체제의 코드나 적어도 하나의 프로그램의 코드에 따른 제어 명령(instruction)을 실행하도록 구현될 수 있다. 여기서, 프로세서(220)는 컴퓨터 장치(200)에 저장된 코드가 제공하는 제어 명령에 따라 컴퓨터 장치(200)가 도 9의 방법이 포함하는 단계들(910 내지 940)을 수행하도록 컴퓨터 장치(200)를 제어할 수 있다.9 is a flowchart illustrating an example of a method of collecting the structure of a package file as a pattern of open source software, according to an embodiment of the present invention. The method according to the present embodiment may be included in the license verification method according to an embodiment, and may be performed by the computer device 200 described above. For example, the processor 220 of the computer device 200 may be implemented to execute control instructions in accordance with the code of the operating system or the code of at least one program that the memory 210 includes. Here, the processor 220 may cause the computer device 200 to perform steps 910 through 940, including the method of Figure 9, in accordance with a control command provided by a code stored in the computer device 200. [ Can be controlled.
단계(910)에서 컴퓨터 장치(200)는 오픈소스 소프트웨어를 다운로드할 수 있다. 예를 들어, 컴퓨터 장치(200)는 오픈소스 소프트웨어의 소스코드를 공유하는 다양한 사이트들로부터 복수의 오픈소스 소프트웨어들을 다운로드 할 수 있으며, 다운로드된 복수의 오픈소스 소프트웨어들 각각에 대해 아래의 단계(920) 내지 단계(940)을 수행할 수 있다. 이러한 단계(910)은 도 3을 통해 설명한 단계(310)에 대응할 수 있으며, 라이선스 검증 방법이 도 3의 방법과 도 9의 방법을 모두 포함하는 경우에는 단계(310) 및 단계(910)가 동일한 단계일 수 있다.At step 910, the computer device 200 may download open source software. For example, the computer device 200 may download a plurality of open source software from various sites that share the source code of the open source software, and perform the following steps 920 (Step 940). This step 910 may correspond to the step 310 described with reference to FIG. 3, and if the license verification method includes both the method of FIG. 3 and the method of FIG. 9, steps 310 and 910 are the same Step.
단계(920)에서 컴퓨터 장치(200)는 다운로드된 오픈소스 소프트웨어의 디렉토리 구조에 대응하는 트리 구조의 데이터를 생성할 수 있다. 자바 소스코드는 비슷한 성격의 자바 클래스를 모아 디렉토리를 만들어 분류해 놓는다. 이러한 디렉토리 구조의 형태는 오픈소스 소프트웨어의 하나의 특징이 될 수 있으며, 트리 구조로 표현될 수 있다. 예를 들어, 디렉토리는 브랜치 노드(branch node)가 될 수 있으며, 디렉토리에 저장된 자바 코드 파일들은 리프 노드(leaf node)로 표현될 수 있다. 이러한 디렉토리 구조와 트리 구조에 대해서는 이후 더욱 자세히 설명한다.At step 920, the computer device 200 may generate the tree structure data corresponding to the directory structure of the downloaded open source software. The Java source code collects Java classes of similar nature and creates and classifies directories. This type of directory structure can be a feature of open source software and can be expressed in a tree structure. For example, a directory may be a branch node, and Java code files stored in a directory may be represented by a leaf node. These directory and tree structures are described in more detail below.
단계(930)에서 컴퓨터 장치(200)는 생성된 트리 구조의 노드들을 정렬할 수 있다. 트리 구조에서 노드들의 정렬은 추후 다른 트리 구조와의 일치 여부를 비교하기 위해 수행될 수 있으며, 실시예에 따라 생략될 수도 있다. 자세한 정렬 방법은 이후 더욱 자세히 설명한다.At step 930, the computing device 200 may sort the nodes of the generated tree structure. Alignment of nodes in the tree structure may be performed to compare the correspondence with other tree structures, and may be omitted according to the embodiment. Detailed alignment methods are described in more detail below.
단계(940)에서 컴퓨터 장치(200)는 정렬된 트리 구조의 데이터를 해당 오픈소스 소프트웨어의 식별자와 연계하여 데이터베이스에 저장할 수 있다. 트리 구조의 데이터는 트리 구조 그대로 데이터베이스에 저장될 수도 있으나, 트리 구조의 데이터베이스화의 복잡성을 고려할 때, 직렬화(serialize)되어 저장될 수도 있다. 이러한 트리 구조의 데이터의 직렬화에 대해서는 이후 더욱 자세히 설명한다.In step 940, the computer device 200 may store the data of the aligned tree structure in association with the identifier of the corresponding open source software in the database. The data of the tree structure may be stored in the database as it is in a tree structure, but it may be serialized and stored in consideration of the complexity of database structure of the tree structure. The serialization of data of such a tree structure will be described in more detail later.
또한, 다운로드되는 복수의 오픈소스 소프트웨어들 각각에 대해 이러한 트리 구조의 데이터가 생성될 수 있으며, 생성된 트리 구조의 데이터는 복수의 오픈소스 소프트웨어들 각각의 식별자와 연계되어 데이터베이스에 저장될 수 있다.In addition, data of this tree structure can be generated for each of a plurality of open source software to be downloaded, and data of the generated tree structure can be stored in a database in association with an identifier of each of a plurality of open source software.
도 10은 본 발명의 일실시예에 있어서, 패키지 파일의 구조에 따른 형태 비교를 통해 오픈소스 소프트웨어의 사용 여부를 검사하는 방법의 예를 도시한 흐름도이다. 본 실시예에 따른 방법 역시 일실시예에 따른 라이선스 검증 방법에 포함될 수 있다. 예를 들어, 도 9의 실시예에 따른 방법을 통해 다양한 오픈소스 소프트웨어들 각각에 대해 트리 구조의 데이터들이 생성되어 데이터베이스화된 이후, 도 10의 실시예에 따른 방법을 통해 특정 어플리케이션에 대해 오픈소스 소프트웨어 검사가 수행될 수 있다. 본 실시예에 따른 방법 역시 앞서 설명한 컴퓨터 장치(200)에 의해 수행될 수 있다. 예를 들어, 컴퓨터 장치(200)의 프로세서(220)는 메모리(210)가 포함하는 운영체제의 코드나 적어도 하나의 프로그램의 코드에 따른 제어 명령(instruction)을 실행하도록 구현될 수 있다. 여기서, 프로세서(220)는 컴퓨터 장치(200)에 저장된 코드가 제공하는 제어 명령에 따라 컴퓨터 장치(200)가 도 10의 방법이 포함하는 단계들(1010 내지 1040)을 수행하도록 컴퓨터 장치(200)를 제어할 수 있다. FIG. 10 is a flowchart illustrating an example of a method for checking whether open source software is used through a type comparison according to the structure of a package file, according to an embodiment of the present invention. The method according to the present embodiment can also be included in the license verification method according to the embodiment. For example, after the data of the tree structure is generated for each of the various open source software through the method according to the embodiment of FIG. 9 and then converted into a database, a method according to the embodiment of FIG. A software check can be performed. The method according to the present embodiment can also be performed by the computer apparatus 200 described above. For example, the processor 220 of the computer device 200 may be implemented to execute control instructions in accordance with the code of the operating system or the code of at least one program that the memory 210 includes. Here, the processor 220 may be configured to cause the computer device 200 to perform steps 1010 through 1040, including the method of Figure 10, in accordance with a control command provided by a code stored in the computer device 200. [ Can be controlled.
단계(1010)에서 컴퓨터 장치(200)는 검사의 대상이 되는 패키지 파일을 입력받을 수 있다. 예를 들어, 안드로이드 어플리케이션이 검사의 대상이 되는 경우, 컴퓨터 장치(200)는 해당 안드로이드 어플리케이션의 설치 및 구동을 위한 APK 파일을 입력받을 수 있다.In step 1010, the computer device 200 may receive a package file to be inspected. For example, when the Android application is to be inspected, the computer device 200 can receive an APK file for installing and running the corresponding Android application.
단계(1020)에서 컴퓨터 장치(200)는 입력된 패키지 파일의 디렉토리 구조에 대응하는 트리 구조의 데이터를 생성할 수 있다. 이러한 단계(1020)은 단계(920)에서 트리 구조의 데이터를 생성하는 과정과 동일할 수 있다.In step 1020, the computer device 200 may generate data of a tree structure corresponding to the directory structure of the input package file. This step 1020 may be the same as the process of generating the data of the tree structure in the step 920.
단계(1030)에서 컴퓨터 장치(200)는 생성된 트리 구조의 노드들을 정렬할 수 있다. 이러한 단계(1030)은 단계(930)에서 트리 구조의 데이터를 정렬하는 과정과 동일할 수 있다.At step 1030, the computing device 200 may arrange the nodes of the generated tree structure. This step 1030 may be the same as the process of sorting the data of the tree structure in step 930.
단계(1040)에서 컴퓨터 장치(200)는 정렬된 트리 구조의 데이터와 데이터베이스에 저장된 트리 구조의 데이터를 비교할 수 있다. 이때, 컴퓨터 장치(200)는 데이터베이스에서 추출된 트리 구조의 데이터와 단계(1030)에서 정렬된 트리 구조의 데이터가 일치하는 경우, 데이터베이스에 저장된 오픈소스 소프트웨어의 식별자를 통해 단계(1010)에서 입력된 패키지 파일이 해당 오픈소스 소프트웨어를 사용하고 있음을 알 수 있다.In step 1040, the computer device 200 may compare the data of the ordered tree structure with the data of the tree structure stored in the database. At this time, if the data of the tree structure extracted from the database matches the data of the tree structure aligned in the step 1030, the computer device 200 displays the data of the tree structure inputted in the step 1010 through the identifier of the open- You can see that the package file uses the corresponding open source software.
이후, 컴퓨터 장치(200)는 검색된 오픈소스 소프트웨어의 식별자와 해당 오픈소스 소프트웨어에 매칭된 라이선스 정보를 제공할 수 있다. 이 경우, 관리자는 검색의 대상이 되는 패키지 파일이 어떠한 오픈소스 소프트웨어를 사용하고 있으며, 어떠한 라이선스가 적용되고 있는가를 파악할 수 있게 된다.The computer device 200 may then provide the identifier of the searched open source software and the license information matched to the corresponding open source software. In this case, the administrator can know which open source software the package file to search for is using and which license is being applied.
만약 패키지 파일의 문자열에 대한 난독화가 적용된 경우에는 클래스 경로명, 클래스명, 메소드명 등이 변경될 수 있다. 그러나, 본 실시예에서는 소스코드의 내용을 비교하는 것이 아니라 디렉토리와 디렉토리에 저장된 자바 코드 파일과 같은 패키지 파일의 구조에 기반하여 오픈소스 소프트웨어의 사용 여부를 검사하기 때문에 패키지 파일에 난독화가 적용된 경우에도 사용될 수 있다.If obfuscation is applied to a string in the package file, the classpath name, class name, method name, etc. may be changed. However, in the present embodiment, the use of the open source software is checked based on the structure of the package file such as the directory code and the Java code file stored in the directory, so that the obfuscation is applied to the package file Can be used.
도 11은 본 발명의 일실시예에 있어서, 패키지 파일의 디렉토리 구조의 예를 도시한 도면이고, 도 12는 본 발명의 일실시예에 있어서, 디렉토리 구조에 대응하는 트리 구조의 예를 도시한 도면이다.FIG. 11 is a diagram showing an example of a directory structure of a package file in an embodiment of the present invention. FIG. 12 is a diagram showing an example of a tree structure corresponding to a directory structure in an embodiment of the present invention to be.
우선, 도 11은 패키지 파일의 디렉토리 구조의 예로서, 9 개의 디렉토리와 8개의 자바 코드 파일을 나타내고 있다. 이때, 도 12는 디렉토리를 원 모양의 브랜치 노드로 표현하고 있으며, 자바 코드 파일을 사각형 모양의 리프 노드로 표현하고 있다. 이때, 원 안의 첫 번째 숫자는 자식노드의 수인 차수를, 두 번째 숫자는 하위의 모든 노드들의 수인 차수합을 각각 의미할 수 있다. 예를 들어, 도 11의 첫 번째 디렉토리 'com'은 도 12에서 차수 1과 차수합 16을 갖는 루트 노드로서 표현되어 있다. 도 11의 두 번째 디렉토리 'sample'은 도 12에서 차수 1과 차수합 15를 갖는 브랜치 노드로서 표현되어 있다. 또한, 도 11의 첫 번째 자바 코드 파일인 'Internet.java'는 도 12에서 루트 노드의 깊이를 0이라 할 때, 깊이 5의 사각형 모양의 첫 번째 리프 노드로 표현되어 있다.11 shows nine directory and eight Java code files as an example of the directory structure of the package file. In this case, FIG. 12 represents a directory with a circle-shaped branch node, and a Java code file is represented by a rectangular leaf node. In this case, the first number in the circle can denote the degree that is the number of the child nodes, and the second number can denote the difference, which is the number of all the nodes at the bottom. For example, the first directory 'com' in FIG. 11 is represented as a root node with degree 1 and number 16 in FIG. The second directory 'sample' in FIG. 11 is represented as a branch node having degree 1 and degree 15 in FIG. Also, the first Java code file 'Internet.java' in FIG. 11 is represented by the first leaf node having a depth of 5 when the depth of the root node is 0 in FIG.
이처럼 컴퓨터 장치(200)는 도 11의 패키지 파일의 디렉토리 구조를 왼쪽에서부터 오른쪽으로, 그리고 위에서부터 아래로 순회하면서 트리 구조의 데이터를 생성할 수 있다. 이미 설명한 바와 같이 브랜치 노드는 디렉토리를 의미할 수 있으며, 하위 노드(자식 노드)로서 브랜치 노드 또는 리프 노드를 가질 수 있다. 각 노드는 차수와 차수합의 정보를 가질 수 있다. 또한, 리프 노드는 자바 코드 파일을 의미할 수 있으며 하위 노드를 가질 수 없다. 클래스에 대한 정보를 포함할 수 있고, 포함된 클래스에 대한 정보로는 멤버 변수의 개수, 멤버 함수의 개수, 각 멤버 함수의 시그니처, 메소드 리턴타입, 인자의 개수 및 각 인자의 타입 중 대응하는 정보를 포함할 수 있다. 예를 들어, 코드 'public static void main(String[] args)에서 리턴 타입은 'void'이고, 인자 개수는 2 이며, 인자 타입은 'String[]'과 'args'임을 알 수 있다.Thus, the computer device 200 can generate the tree structure data while circulating the directory structure of the package file of FIG. 11 from left to right and from top to bottom. As described above, a branch node may mean a directory, and may have a branch node or a leaf node as a child node (child node). Each node can have degree and degree sum information. Also, a leaf node can mean a Java code file and can not have a child node. Information about the class may be included, and information about the included class includes information such as the number of member variables, the number of member functions, the signature of each member function, the method return type, the number of arguments, and the corresponding information . &Lt; / RTI &gt; For example, in code 'public static void main (String [] args), the return type is' void', the number of arguments is 2, and the argument types are 'String []' and 'args'.
이미 설명한 바와 같이 트리 구조의 정렬은 추후 다른 트리 구조와의 일치 여부를 비교하기 위해 수행될 수 있다. 정렬의 기준은 브랜치 노드가 리프 노드보다 높은 우선순위를 가질 수 있으며, 동일한 부모를 가진 브랜치 노드들은 차수를 이용하여 내림차순 또는 오름차순으로 정렬될 수 있다. 차수를 이용하여 정렬된 브랜치 노드들 중 동일한 차수를 가진 브랜치 노드들은 차수합을 이용하여 내림차순 또는 오름차순으로 정렬될 수 있다. 동일한 부모를 가진 리프 노드들은 메소드의 개수(멤버 함수의 개수)를 기준으로 하는 내림차순 또는 오름차순으로 정렬될 수 있다. 정렬 방식은 오픈소스 소프트웨어의 디렉토리 구조에 대해 생성된 트리 구조와 패키지 파일의 디렉토리 구조에 대해 생성된 트리 구조에 대해 동일한 방식으로 적용될 수 있는 정렬 방식이라면 앞서 설명한 실시예로 제한되지 않는다.As described above, the arrangement of the tree structure can be performed in order to compare the correspondence with other tree structures in the future. The sorting criterion can be that a branch node has a higher priority than a leaf node, and branch nodes having the same parent can be sorted in descending order or ascending order. Branch nodes having the same order among the sorted branch nodes using order can be sorted in descending order or ascending order by using the sort order. Leaf nodes having the same parent can be sorted in descending order or ascending order based on the number of methods (the number of member functions). The sorting method is not limited to the above-described embodiment as long as the sorting method can be applied in the same manner to the tree structure created for the directory structure of open source software and the tree structure created for the directory structure of the package file.
도 13은 본 발명의 일실시예에 있어서, 정렬된 트리 구조의 예를 도시한 도면이다. 도 12와 도 13을 비교해보면, 제1 브랜치 노드(1210)의 차수가 1이고, 제2 브랜치 노드(1220)의 차수가 2인 관계로 제2 브랜치 노드(1220)가 제1 브랜치 노드(1210)의 왼쪽에 배치되도록 정렬된 예를 나타내고 있다. 이러한 제1 브랜치 노드(1210)와 제2 브랜치 노드(1220)간의 배치 변경에 따라 앞서 설명한 정렬 방식에 따라 트리 구조의 모든 노드들이 배치되었음을 알 수 있다.13 is a diagram showing an example of an aligned tree structure in an embodiment of the present invention. 12 and 13, when the first branch node 1210 has a degree of 1 and the second branch node 1220 has a degree of 2, the second branch node 1220 is connected to the first branch node 1210 In the left-hand side of Fig. It can be seen that all the nodes of the tree structure are arranged according to the above-described sorting method in accordance with the arrangement change between the first branch node 1210 and the second branch node 1220.
또한, 컴퓨터 장치(200)는 자바 객체 직렬화를 이용하여 트리 구조의 데이터를 직렬화한 후 데이터베이스에 저장할 수 있다. 보다 구체적으로 컴퓨터 장치(200)는 디렉토리를 순회하며 각 디렉토리를 자바 객체로 만들고, 차수에 따라 내림차순 또는 오름차순 정렬 한 객체들을 저장할 수 있다. 트리구조의 비선형 자료구조를 관계형 데이터베이스에 저장하기 위해서는 각 노드별로 부모와 자식관계를 따져본 뒤 데이터베이스에 저장해야 하기에 구현이 복잡해 진다. 따라서, 이를 쉽게 저장하기 위해, 컴퓨터 장치(200)는 루트노드를 기준으로 자바 객체 직렬화(Serialize)를 사용하여 트리 구조의 데이터를 직렬화한 후 데이터베이스에 저장할 수 있다. 이때 저장에 필요한 객체들은 'java.io.Serializable'을 구현(implements)해야 하고, 멤버 변수로 저장에 필요한 정보를 넣어야 한다. 브랜치 노드의 객체인 경우 차수, 차수합, 부모노드 정보, 자식노드 정보가 멤버 변수로 정의될 수 있고, 리프 노드의 경우 멤버 변수의 개수, 멤버 함수의 개수, 각 멤버 함수의 시그니처(메소드 리턴 타입, 인자의 개수, 각 인자의 타입), 부모 노드의 정보가 멤버 변수로 정의될 수 있다.In addition, the computer device 200 may serialize the data of the tree structure using Java object serialization, and then store the serialized data in a database. More specifically, the computer device 200 traverses a directory, makes each directory a Java object, and stores objects sorted in descending order or ascending order according to orders. In order to store the non-linear data structure of the tree structure in the relational database, the implementation becomes complicated because the parent-child relation for each node must be checked and stored in the database. Accordingly, in order to easily store this, the computer device 200 can serialize data of the tree structure using Java object serialize based on the root node, and then store the data in the database. At this time, objects required for storage should implement 'java.io.Serializable', and the member variable should be filled with information necessary for saving. In the case of a leaf node, the number of member variables, the number of member functions, the signature of each member function (the method return type , The number of arguments, the type of each argument), and parent node information can be defined as member variables.
아래 표 1은 부모와 자식의 관계를 정의한 정보의 예를, 표 2는 브랜치 노드를 정의한 정보의 예를, 표 3은 리프 노드를 정의한 정보의 예를 각각 나타내고 있다.Table 1 shows an example of information defining the relationship between a parent and a child, Table 2 shows an example of information defining a branch node, and Table 3 shows an example of information that defines a leaf node.
public class Node<T> implements Serializable { private T data; private Node<T> parent; private List<Node<T>> children;public class Node <T> implements Serializable {private T data; private Node <T> parent; private List <Node <T >> children;
public class Branch { private int degree; //차수 private int degreeSum; //차수합public class Branch {private int degree; // order private int degreeSum; // Tea collection
public class Leaf { private int cntField; //멤버변수의 개수 private int cntMethod; //메소드의 개수 private List<MethodSignature> methodList; //각 멤버 함수의 시그니처 public class Leaf {private int cntField; // number of member variables private int cntMethod; // the number of methods private List <MethodSignature> methodList; // Signatures for each member function
도 14는 본 발명의 일실시예에 있어서, 직렬화되어 저장된 데이터의 예를 도시한 도면이다. 자바 직렬화 과정은 클래스의 형태로 만든 메모리의 힙(Heap) 영역에 객체를 쓰기(write)위해 연속적인 데이터로 변형하는 과정일 수 있으며, 예를 들어, 트리 구조의 데이터를 연속적인 자바 객체의 데이터로 변형하는 과정일 수 있다. 직렬화되어 저장된 데이터는 도 14에 나타난 바와 같이 사람이 알아보기 어려운 형태로 저장될 수 있다.14 is a diagram showing an example of serialized and stored data in an embodiment of the present invention. The Java serialization process can be a process of transforming data into continuous data to write an object to a heap region of memory created in the form of a class. For example, As shown in FIG. The serialized and stored data can be stored in a form that is difficult for human to recognize as shown in FIG.
검사의 대상이 되는 패키지 파일에 오픈소스 소프트웨어가 사용되었는지 여부를 결정하기 위해, 컴퓨터 장치(200)는 우선, 패키지 파일의 루트 디렉토리부터 하위 디렉토리를 순회하여 트리 구조의 데이터를 생성 및 정렬할 수 있다. 또한, 컴퓨터 장치(200)는 직렬화되어 데이터베이스에 저장된 데이터를 역직렬화(deserialize)하여 메모리(210)로 읽어올 수 있다. 역직렬화 과정은 직렬화 과정의 반대일 수 있다. 역직렬화 과정을 완료하면 직렬화하기 전의 형태로 객체가 생성되어 메모리의 힙(Heap) 영역에 로드될 수 있다. 컴퓨터 장치(200)는 이 객체를 사용하여 두 개의 트리 구조를 비교할 수 있다.In order to determine whether open source software has been used in the package file to be inspected, the computer device 200 may first generate and arrange the tree structure data by traversing the root directory of the package file through the subdirectories . In addition, the computer device 200 may deserialize the data stored in the database and read it into the memory 210. The deserialization process may be the reverse of the serialization process. When the deserialization process is completed, an object can be created and loaded into the heap area of the memory before serialization. The computer device 200 can use this object to compare two tree structures.
도 15 및 도 16은 본 발명의 일실시예에 있어서, 트리 구조의 비교 예를 도시한 도면들이다. 도 15의 점선박스(1510)는 오픈소스 소프트웨어의 디렉토리 구조에 대응하는 트리 구조(이하, '오픈소스 트리 구조'라 함)의 예를 나타내고 있다. 또한, 도 16의 제1 점선박스(1610)는 패키지 파일의 디렉토리 구조에 대응하는 트리 구조(이하, '패키지 파일 트리 구조'라 함)의 예를 나타내고 있다. 이때, 도 16의 제2 점선박스(1620)는 도 15의 점선박스(1510)가 나타내는 트리 구조와 일치하는 서브트리 구조를 나타내고 있다.15 and 16 are views showing a comparative example of a tree structure in an embodiment of the present invention. A dotted box 1510 in FIG. 15 shows an example of a tree structure (hereinafter, referred to as 'open source tree structure') corresponding to a directory structure of open source software. 16 shows an example of a tree structure (hereinafter referred to as a "package file tree structure") corresponding to the directory structure of the package file. At this time, the second dashed box 1620 in Fig. 16 shows a subtree structure coinciding with the tree structure indicated by the dashed box 1510 in Fig.
예를 들어, 컴퓨터 장치(200)는 패키지 파일 트리 구조의 노드들을 순회하며 오픈소스 트리 구조의 루트 노드의 정보(차수, 차수합)와 일치하는 노드를 찾을 수 있다. 일치하는 노드를 찾는 경우, 찾은 노드를 포함하는 서브트리와 오픈소스 트리 구조를 순회하면서 비교할 수 있다. 브랜치 노드의 비교는 노드의 정보(차수, 차수합)의 일치 여부를 비교할 수 있으며, 리프 노드의 비교는 멤버 변수의 개수, 멤버 함수의 개수, 각 멤버 함수의 시그니처를 비교하여 일치 여부를 판단할 수 있다. 단, 함수의 시그니처 비교에서 인자의 타입은 자바 프리미티브(primitive) 타입만 비교하고 넌-프리미티브(non-primitive) 타입의 경우 난독화될 가능성이 있기 때문에 비교대상에 포함하지 않을 수 있다.For example, the computer device 200 traverses the nodes of the package file tree structure and finds a node that matches the information (degree, order) of the root node of the open source tree structure. If a matching node is found, it can be compared while traversing the open-source tree structure with the subtree containing the found node. The comparison of the branch nodes can compare whether the node information (degree, difference) is matched. The leaf node comparison compares the number of member variables, the number of member functions, and the signature of each member function . However, the type of the argument in the function signature comparison may not be included in the comparison object because only the Java primitive type is compared and the non-primitive type is likely to be obfuscated.
앞서 설명한 두 가지 실시예들(도 3 내지 8을 통해 설명한 패턴을 이용하는 실시예 및 도 9 내지 도 16을 통해 설명한 트리 구조를 이용하는 실시예)은 각각 개별적으로 이용될 수도 있고, 결합되어 사용될 수도 있다. 예를 들어, 검사의 대상이 되는 패키지 파일에 난독화가 적용되지 않은 경우에는 패턴을 이용하는 실시예를 적용하고, 패키지 파일에 난독화가 적용된 경우에는 트리 구조를 이용하는 실시예를 적용할 수 있다.The above-described two embodiments (the embodiment using the patterns described with reference to Figs. 3 to 8 and the embodiment using the tree structure described with reference to Figs. 9 to 16) may be used individually or in combination . For example, when obfuscation is not applied to a package file to be inspected, an embodiment using a pattern may be applied, and in a case where obfuscation is applied to a package file, an embodiment using a tree structure may be applied.
이상에서와 같이, 본 발명의 실시예들에 따르면, 안드로이드 환경에서의 smali 코드와 같은 기설정된 코드 형태를 활용하여 개발자의 소스코드 없이 빌드된 상태의 바이너리 코드를 통해서도 오픈소스 소프트웨어의 라이선스를 검증할 수 있다. 또한, 패키지 파일의 구조에 따른 형태 비교를 통해 문자열이 난독화된 코드에 대해서도 오픈소스 소프트웨어의 라이선스를 검증할 수 있다.As described above, according to the embodiments of the present invention, it is possible to verify the license of the open source software through the binary code that is built without the developer's source code by utilizing the predetermined code form such as the smali code in the Android environment . In addition, it is possible to verify the license of open source software for code obfuscated by string through type comparison according to the structure of package file.
이상에서 설명된 시스템 또는 장치는 하드웨어 구성요소, 소프트웨어 구성요소 또는 하드웨어 구성요소 및 소프트웨어 구성요소의 조합으로 구현될 수 있다. 예를 들어, 실시예들에서 설명된 장치 및 구성요소는, 예를 들어, 프로세서, 콘트롤러, ALU(arithmetic logic unit), 디지털 신호 프로세서(digital signal processor), 마이크로컴퓨터, FPGA(field programmable gate array), PLU(programmable logic unit), 마이크로프로세서, 또는 명령(instruction)을 실행하고 응답할 수 있는 다른 어떠한 장치와 같이, 하나 이상의 범용 컴퓨터 또는 특수 목적 컴퓨터를 이용하여 구현될 수 있다. 처리 장치는 운영 체제(OS) 및 상기 운영 체제 상에서 수행되는 하나 이상의 소프트웨어 어플리케이션을 수행할 수 있다. 또한, 처리 장치는 소프트웨어의 실행에 응답하여, 데이터를 접근, 저장, 조작, 처리 및 생성할 수도 있다. 이해의 편의를 위하여, 처리 장치는 하나가 사용되는 것으로 설명된 경우도 있지만, 해당 기술분야에서 통상의 지식을 가진 자는, 처리 장치가 복수 개의 처리 요소(processing element) 및/또는 복수 유형의 처리 요소를 포함할 수 있음을 알 수 있다. 예를 들어, 처리 장치는 복수 개의 프로세서 또는 하나의 프로세서 및 하나의 콘트롤러를 포함할 수 있다. 또한, 병렬 프로세서(parallel processor)와 같은, 다른 처리 구성(processing configuration)도 가능하다.The system or apparatus described above may be implemented as a hardware component, a software component or a combination of hardware components and software components. For example, the apparatus and components described in the embodiments may be implemented within a computer system, such as, for example, a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA) , A programmable logic unit (PLU), a microprocessor, or any other device capable of executing and responding to instructions. The processing device may execute an operating system (OS) and one or more software applications running on the operating system. The processing device may also access, store, manipulate, process, and generate data in response to execution of the software. For ease of understanding, the processing apparatus may be described as being used singly, but those skilled in the art will recognize that the processing apparatus may have a plurality of processing elements and / As shown in FIG. For example, the processing unit may comprise a plurality of processors or one processor and one controller. Other processing configurations are also possible, such as a parallel processor.
소프트웨어는 컴퓨터 프로그램(computer program), 코드(code), 명령(instruction), 또는 이들 중 하나 이상의 조합을 포함할 수 있으며, 원하는 대로 동작하도록 처리 장치를 구성하거나 독립적으로 또는 결합적으로(collectively) 처리 장치를 명령할 수 있다. 소프트웨어 및/또는 데이터는, 처리 장치에 의하여 해석되거나 처리 장치에 명령 또는 데이터를 제공하기 위하여, 어떤 유형의 기계, 구성요소(component), 물리적 장치, 가상 장치(virtual equipment), 컴퓨터 저장 매체 또는 장치에 구체화(embody)될 수 있다. 소프트웨어는 네트워크로 연결된 컴퓨터 시스템 상에 분산되어서, 분산된 방법으로 저장되거나 실행될 수도 있다. 소프트웨어 및 데이터는 하나 이상의 컴퓨터 판독 가능 기록매체에 저장될 수 있다.The software may include a computer program, code, instructions, or a combination of one or more of the foregoing, and may be configured to configure the processing device to operate as desired or to process it collectively or collectively Device can be commanded. The software and / or data may be in the form of any type of machine, component, physical device, virtual equipment, computer storage media, or device As shown in FIG. The software may be distributed over a networked computer system and stored or executed in a distributed manner. The software and data may be stored on one or more computer readable recording media.
실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 통상의 기술자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 이러한 기록매체는 단일 또는 수개 하드웨어가 결합된 형태의 다양한 기록수단 또는 저장수단일 수 있으며, 어떤 컴퓨터 시스템에 직접 접속되는 매체에 한정되지 않고, 네트워크 상에 분산 존재하는 것일 수도 있다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다.The method according to an embodiment may be implemented in the form of a program command that can be executed through various computer means and recorded in a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, and the like, alone or in combination. The program instructions to be recorded on the medium may be those specially designed and configured for the embodiments, or may be available to those skilled in the art of computer software. Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape; optical media such as CD-ROMs and DVDs; magnetic media such as floppy disks; Magneto-optical media, and hardware devices specifically configured to store and execute program instructions such as ROM, RAM, flash memory, and the like. Such a recording medium may be a variety of recording means or storage means in the form of a single or a plurality of hardware combined and is not limited to a medium directly connected to any computer system but may be dispersed on a network. Examples of program instructions include machine language code such as those produced by a compiler, as well as high-level language code that can be executed by a computer using an interpreter or the like.
이상과 같이 실시예들이 비록 한정된 실시예와 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 상기의 기재로부터 다양한 수정 및 변형이 가능하다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. For example, it is to be understood that the techniques described may be performed in a different order than the described methods, and / or that components of the described systems, structures, devices, circuits, Lt; / RTI &gt; or equivalents, even if it is replaced or replaced.
그러므로, 다른 구현들, 다른 실시예들 및 청구범위와 균등한 것들도 후술하는 청구범위의 범위에 속한다.Therefore, other implementations, other embodiments, and equivalents to the claims are also within the scope of the following claims.

Claims (18)

  1. 라이선스 검증 방법에 있어서,In the license verification method,
    오픈소스 소프트웨어를 다운로드하는 단계;Downloading open source software;
    상기 다운로드된 오픈소스 소프트웨어에서 메소드 호출 정보를 추출하는 단계;Extracting method call information from the downloaded open source software;
    상기 추출된 메소드 호출 정보를 이용하여 기설정된 코드 형태의 패턴을 생성하는 단계; 및Generating a pattern of a predetermined code type using the extracted method call information; And
    상기 생성된 패턴을 상기 다운로드된 오픈소스 소프트웨어의 식별자와 연계하여 데이터베이스에 저장하는 단계Storing the generated pattern in association with an identifier of the downloaded open source software in a database
    를 포함하는 것을 특징으로 하는 라이선스 검증 방법.The license verification method comprising:
  2. 제1항에 있어서,The method according to claim 1,
    상기 메소드 호출 정보는 특정 메소드를 호출하기 위해 요구되는 정보로서, 자바(Java) 코드에서의 클래스 경로명, 클래스명 및 메소드명을 포함하는 것을 특징으로 하는 라이선스 검증 방법.Wherein the method call information is information required for calling a specific method, and includes a class path name, a class name, and a method name in Java code.
  3. 제1항에 있어서,The method according to claim 1,
    상기 기설정된 코드 형태는 안드로이드 어플리케이션을 위한 패키지 파일인 APK(Android application package) 파일에서 사용되는 smali 코드 형태를 포함하고,The predetermined code type includes a smali code form used in an APK (Android application package) file, which is a package file for an Android application,
    상기 패턴은 상기 smali 코드 형태에서 메소드를 추출하기 위해 요구되는 상기 메소드 호출 정보를 포함하는 형태로 생성되는 것을 특징으로 하는 라이선스 검증 방법.Wherein the pattern is generated in a form including the method call information required to extract a method in the smali code form.
  4. 제1항에 있어서,The method according to claim 1,
    검사의 대상이 되는 패키지 파일을 입력받는 단계;Receiving a package file to be inspected;
    상기 패키지 파일의 실행파일을 추출하는 단계;Extracting an executable file of the package file;
    상기 추출한 실행파일을 상기 기설정된 코드 형태로 변환하는 단계;Converting the extracted executable file into the predetermined code form;
    상기 기설정된 코드 형태로 변환된 실행파일에서 메소드 호출 정보를 추출하는 단계; 및Extracting method call information from an executable file converted into the predetermined code form; And
    상기 추출된 메소드 호출 정보를 상기 데이터베이스에 저장된 패턴과 비교하는 단계Comparing the extracted method call information with a pattern stored in the database
    를 더 포함하는 것을 특징으로 하는 라이선스 검증 방법.Further comprising the step of verifying the license.
  5. 제4항에 있어서,5. The method of claim 4,
    상기 비교하는 단계는,Wherein the comparing comprises:
    상기 기설정된 코드 형태로 변환된 실행파일에서 추출된 메소드 호출 정보를 포함하는 패턴을 상기 데이터베이스에서 검색하는 것을 특징으로 하는 라이선스 검증 방법.And searching the database for a pattern including the method call information extracted from the executable file converted into the predetermined code form.
  6. 제4항에 있어서,5. The method of claim 4,
    상기 데이터베이스에 상기 기설정된 코드 형태로 변환된 실행파일에서 추출된 메소드 호출 정보를 포함하는 패턴이 존재하는 경우, 상기 패턴과 연계하여 상기 데이터베이스에 저장된 오픈소스 소프트웨어의 식별자 및 상기 오픈소스 소프트웨어에서 사용하는 라이선스의 식별자를 제공하는 단계And an identifier of the open-source software stored in the database in association with the pattern, and an identifier of the open-source software stored in the database, if the pattern includes the method call information extracted from the executable file converted into the pre- Provide an identifier for the license
    를 더 포함하는 것을 특징으로 하는 라이선스 검증 방법.Further comprising the step of verifying the license.
  7. 제4항에 있어서,5. The method of claim 4,
    상기 기설정된 코드 형태의 패턴을 생성하는 단계는,Wherein the step of generating the pattern of the pre-
    하나의 오픈소스 소프트웨어에 대해 둘 이상의 패턴을 생성하고,Generate more than one pattern for one open source software,
    상기 비교하는 단계는,Wherein the comparing comprises:
    상기 기설정된 코드 형태로 변환된 실행파일에서 추출되는 둘 이상의 메소드 호출 정보가 상기 둘 이상의 패턴과 각각 비교하는 것을 특징으로 하는 라이선스 검증 방법.And comparing two or more method call information extracted from the executable file converted into the predetermined code form with each of the two or more patterns.
  8. 라이선스 검증 방법에 있어서,In the license verification method,
    오픈소스 소프트웨어를 다운로드하는 단계;Downloading open source software;
    상기 다운로드된 오픈소스 소프트웨어의 디렉토리 구조에 대응하는 제1 트리 구조의 데이터를 생성하는 단계; 및Generating data of a first tree structure corresponding to a directory structure of the downloaded open source software; And
    상기 제1 트리 구조의 데이터를 해당 오픈소스 소프트웨어의 식별자와 연계하여 데이터베이스에 저장하는 단계Storing the data of the first tree structure in association with an identifier of the corresponding open source software in a database
    를 포함하는 것을 특징으로 하는 라이선스 검증 방법.The license verification method comprising:
  9. 제8항에 있어서,9. The method of claim 8,
    상기 생성하는 단계는,Wherein the generating comprises:
    상기 디렉토리 구조의 디렉토리를 브랜치 노드(branch node)로서 포함하고, 상기 디렉토리 구조의 자바 코드 파일을 리프 노드(leaf node)로서 포함하는 트리 구조의 데이터를 생성하는 것을 특징으로 하는 라이선스 검증 방법.Wherein the tree structure data including the directory structure of the directory structure as a branch node and the Java code file of the directory structure as a leaf node is generated.
  10. 제9항에 있어서,10. The method of claim 9,
    상기 브랜치 노드는 자식노드의 수에 대응하는 차수 및 하위 모든 노드의 수에 대응하는 차수합을 포함하고,Wherein the branch node includes a differential sum corresponding to a degree corresponding to the number of child nodes and a number of all lower nodes,
    상기 리프 노드는 대응하는 자바 코드 파일의 멤버 변수의 개수, 멤버 함수의 개수 및 각 멤버 함수의 시그니처를 포함하는 것을 특징으로 하는 라이선스 검증 방법.Wherein the leaf node includes a number of member variables of a corresponding Java code file, a number of member functions, and a signature of each member function.
  11. 제8항에 있어서,9. The method of claim 8,
    생성된 트리 구조의 노드들을 정렬하는 단계And arranging the nodes of the generated tree structure
    를 더 포함하는 것을 특징으로 하는 라이선스 검증 방법.Further comprising the step of verifying the license.
  12. 제11항에 있어서,12. The method of claim 11,
    상기 정렬하는 단계는,Wherein the aligning comprises:
    상기 생성된 트리 구조가 포함하는 동일한 부모를 갖는 브랜치 노드들을 상기 브랜치 노드들 각각이 포함하는 차수 및 차수합에 기초하여 정렬하고, 상기 생성된 트리 구조가 포함하는 동일한 부모를 갖는 리프 노드들을 상기 리프 노드들 각각에 대응하는 자바 코드 파일의 멤버 함수의 개수에 기초하여 정렬하는 것을 특징으로 하는 라이선스 검증 방법.And arranging the leaf nodes having the same parent included in the generated tree structure on the basis of the degree and the difference included in each of the branch nodes, Based on the number of member functions of the Java code file corresponding to each of the nodes.
  13. 제8항에 있어서,9. The method of claim 8,
    상기 저장하는 단계는,Wherein the storing step comprises:
    상기 제1 트리 구조의 데이터를 자바 객체 직렬화를 이용하여 직렬화시켜 상기 데이터베이스에 저장하는 것을 특징으로 하는 라이선스 검증 방법.Wherein the data of the first tree structure is serialized using Java object serialization and stored in the database.
  14. 제13항에 있어서,14. The method of claim 13,
    상기 자바 객체 직렬화는 상기 제1 트리 구조의 노드들 각각을 자바 객체로 정의하여 상기 제1 트리 구조의 데이터를 연속적인 자바 객체의 데이터로 변형하는 것을 특징으로 하는 라이선스 검증 방법.Wherein the Java object serialization defines each of the nodes of the first tree structure as a Java object and transforms the data of the first tree structure into data of successive Java objects.
  15. 제8항에 있어서,9. The method of claim 8,
    검사의 대상이 되는 패키지 파일을 입력받는 단계;Receiving a package file to be inspected;
    상기 입력된 패키지 파일의 디렉토리 구조에 대응하는 제2 트리 구조의 데이터를 생성하는 단계; 및Generating data of a second tree structure corresponding to a directory structure of the input package file; And
    상기 제2 트리 구조의 데이터와 상기 데이터베이스에 저장된 상기 제1 트리 구조의 데이터를 비교하는 단계Comparing data of the second tree structure with data of the first tree structure stored in the database
    를 더 포함하는 것을 특징으로 하는 라이선스 검증 방법.Further comprising the step of verifying the license.
  16. 제15항에 있어서,16. The method of claim 15,
    상기 비교하는 단계는,Wherein the comparing comprises:
    상기 제1 트리 구조의 데이터를 상기 제2 트리 구조의 서브트리 구조의 데이터로서 포함하는지 여부를 확인하는 것을 특징으로 하는 라이선스 검증 방법.Whether or not the data of the first tree structure is included as data of the subtree structure of the second tree structure.
  17. 제16항에 있어서,17. The method of claim 16,
    상기 비교하는 단계는,Wherein the comparing comprises:
    상기 제1 트리 구조 및 상기 제2 트리 구조의 브랜치 노드가 포함하는 차수 및 차수합간의 비교 및 상기 제1 트리 구조 및 상기 제2 트리 구조의 리프 노드가 포함하는 멤버 변수의 개수, 멤버 함수의 개수 및 각 멤버 함수의 시그니처간의 비교에 기초하여 상기 제2 트리 구조의 데이터와 상기 데이터베이스에 저장된 상기 제1 트리 구조의 데이터를 비교하는 것을 특징으로 하는 라이선스 검증 방법.A comparison between the degree and the division included in the branch nodes of the first tree structure and the second tree structure, and the number of the member variables included in the leaf nodes of the first tree structure and the second tree structure, And comparing the data of the second tree structure with the data of the first tree structure stored in the database based on a comparison between the signatures of the respective member functions.
  18. 제1항 내지 제17항 중 어느 한 항의 방법을 컴퓨터에 실행시키기 위한 프로그램이 기록되어 있는 것을 특징으로 하는 컴퓨터에서 판독 가능한 기록매체.A computer-readable recording medium having recorded thereon a program for causing a computer to execute the method according to any one of claims 1 to 17.
PCT/KR2018/000162 2018-01-04 2018-01-04 Open source software license verification method and system WO2019135425A1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
KR1020207015830A KR102462541B1 (en) 2018-01-04 2018-01-04 Methods and systems for validating licenses for open source software
JP2020536852A JP7119096B2 (en) 2018-01-04 2018-01-04 license verification device
PCT/KR2018/000162 WO2019135425A1 (en) 2018-01-04 2018-01-04 Open source software license verification method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/KR2018/000162 WO2019135425A1 (en) 2018-01-04 2018-01-04 Open source software license verification method and system

Publications (1)

Publication Number Publication Date
WO2019135425A1 true WO2019135425A1 (en) 2019-07-11

Family

ID=67143677

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2018/000162 WO2019135425A1 (en) 2018-01-04 2018-01-04 Open source software license verification method and system

Country Status (3)

Country Link
JP (1) JP7119096B2 (en)
KR (1) KR102462541B1 (en)
WO (1) WO2019135425A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400672A (en) * 2020-03-18 2020-07-10 中国信息安全测评中心 Open source software monitoring method and device

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102286451B1 (en) 2020-11-18 2021-08-04 숭실대학교산학협력단 Method for recognizing obfuscated identifiers based on natural language processing, recording medium and device for performing the method
KR102443938B1 (en) 2020-12-24 2022-09-16 숭실대학교 산학협력단 Method for identifying intelligent core code based on code sequence, recording medium and device for performing the method
KR20230147908A (en) * 2022-04-15 2023-10-24 삼성전자주식회사 Electronic apparatus and method for open source license verification

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101214893B1 (en) * 2011-12-16 2013-01-09 주식회사 안랩 Apparatus and method for detecting similarity amongf applications
JP2013152559A (en) * 2012-01-24 2013-08-08 Toshiba Corp Program comparison analysis device and program comparison analysis method
KR20130142692A (en) * 2012-06-20 2013-12-30 삼성전자주식회사 License verification method, apparatus and computer readable medium thereof
KR20140050323A (en) * 2012-10-19 2014-04-29 삼성전자주식회사 Method and apparatus for license verification of binary file
KR101780233B1 (en) * 2016-04-26 2017-09-21 고려대학교 산학협력단 Apparatus and method for deteting code cloning of software

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100750834B1 (en) * 2005-10-06 2007-08-22 (주)아이피엠에스 A method of data call stack tracing in data monitoring of JAVA byte code and a device for storing the method in compter program type
US8108315B2 (en) 2006-06-19 2012-01-31 Hewlett-Packard Development Company, L.P. Discovering software code subject to licenses
JP5690689B2 (en) 2011-09-16 2015-03-25 Kddi株式会社 Application analysis apparatus and program
KR101472321B1 (en) * 2013-06-11 2014-12-12 고려대학교 산학협력단 Malignant code detect method and system for application in the mobile
CN103473346B (en) 2013-09-24 2017-01-04 北京大学 A kind of Android based on application programming interface beats again bag applying detection method
US10296745B2 (en) 2016-06-23 2019-05-21 International Business Machines Corporation Detecting vulnerable applications

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101214893B1 (en) * 2011-12-16 2013-01-09 주식회사 안랩 Apparatus and method for detecting similarity amongf applications
JP2013152559A (en) * 2012-01-24 2013-08-08 Toshiba Corp Program comparison analysis device and program comparison analysis method
KR20130142692A (en) * 2012-06-20 2013-12-30 삼성전자주식회사 License verification method, apparatus and computer readable medium thereof
KR20140050323A (en) * 2012-10-19 2014-04-29 삼성전자주식회사 Method and apparatus for license verification of binary file
KR101780233B1 (en) * 2016-04-26 2017-09-21 고려대학교 산학협력단 Apparatus and method for deteting code cloning of software

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400672A (en) * 2020-03-18 2020-07-10 中国信息安全测评中心 Open source software monitoring method and device

Also Published As

Publication number Publication date
KR102462541B1 (en) 2022-11-03
JP2021516379A (en) 2021-07-01
KR20200096766A (en) 2020-08-13
JP7119096B2 (en) 2022-08-16

Similar Documents

Publication Publication Date Title
WO2019135425A1 (en) Open source software license verification method and system
US9552237B2 (en) API validation system
US7849509B2 (en) Detection of security vulnerabilities in computer programs
Ojamaa et al. Assessing the security of Node. js platform
US11062022B1 (en) Container packaging device
WO2014035043A1 (en) Apparatus and method for diagnosing malicious applications
WO2019054613A1 (en) Method and system for identifying open source software package on basis of binary file
WO2013089340A1 (en) Apparatus and method for detecting similarity between applications
WO2013191458A1 (en) License verification method and apparatus, and computer readable storage medium storing program therefor
WO2013077538A1 (en) Device and method for analyzing api-based application
WO2019231122A1 (en) Electronic device detecting software vulnerability and method for operating same
WO2019066222A1 (en) Method and system for identifying open source software package on basis of binary file
WO2018016671A2 (en) Dangerous code detection system for checking security vulnerability and method thereof
WO2014088262A1 (en) Apparatus and method for detecting fraudulent/altered applications
US9330184B2 (en) Methods and systems for machine learning to discover application compatibility status
US20160098563A1 (en) Signatures for software components
KR102011725B1 (en) Whitelist construction method for analyzing malicious code, computer readable medium and device for performing the method
WO2018194196A1 (en) Method and system for detecting application of obfuscation to and evaluating security of elf file
WO2018199366A1 (en) Method and system for detecting whether obfuscation has been applied to dex file and evaluating security
Du et al. Aexpy: Detecting api breaking changes in python packages
WO2015046775A1 (en) Method of verifying integrity of program using hash
CN114417347A (en) Vulnerability detection method, device, equipment, storage medium and program of application program
CN113010268B (en) Malicious program identification method and device, storage medium and electronic equipment
Wang et al. A semantic-based smart contract defect detection general platform
WO2016048070A1 (en) Apparatus and method for reconstructing execution file

Legal Events

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

Ref document number: 18897972

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020536852

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18897972

Country of ref document: EP

Kind code of ref document: A1