[go: up one dir, main page]

KR102323276B1 - Method and apparatus for converting application - Google Patents

Method and apparatus for converting application Download PDF

Info

Publication number
KR102323276B1
KR102323276B1 KR1020210035161A KR20210035161A KR102323276B1 KR 102323276 B1 KR102323276 B1 KR 102323276B1 KR 1020210035161 A KR1020210035161 A KR 1020210035161A KR 20210035161 A KR20210035161 A KR 20210035161A KR 102323276 B1 KR102323276 B1 KR 102323276B1
Authority
KR
South Korea
Prior art keywords
code
calling
bytecode
application
optimization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
KR1020210035161A
Other languages
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 KR1020210035161A priority Critical patent/KR102323276B1/en
Application granted granted Critical
Publication of KR102323276B1 publication Critical patent/KR102323276B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/72Code refactoring
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/54Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by adding security routines or objects to programs
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/47Retargetable compilers
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/48Incremental compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Storage Device Security (AREA)

Abstract

Disclosed are a method and device for converting an application. The method for converting the application according to one embodiment comprises: a step of each decompiling a target application and a calling application that calls a security function to be added to the target application to generate a first bytecode for the target application and a second bytecode for the calling application; a step of extracting a calling code for calling the security function from the second bytecode; a step of adding the extracted calling code to the first bytecode; a step of performing code optimization to prevent a collision between the calling code and the remaining code in the first bytecode to which the calling code is added; and a step of recompiling the first bytecode on which the code optimization is performed. Therefore, the present invention is capable of allowing various security functions to be applied without conflict with an existing code.

Description

애플리케이션 변환 방법 및 장치{METHOD AND APPARATUS FOR CONVERTING APPLICATION}APPLICATION CONVERSION METHOD AND APPARATUS

본 발명의 실시예들은 앱 래핑(app wrapping) 기술과 관련된다.Embodiments of the present invention relate to app wrapping techniques.

스마트 기기의 대중화에 따라 많은 기업에서 개인의 스마트 기기를 업무에 활용하는 BYOD(Bring Your Own Device) 정책을 도입하고 있다. BYOD는 업무 효율성 향상, 비용 절감 등의 장점이 있지만, 개인의 스마트 기기에 업무용 데이터가 저장됨에 따라 기밀 데이터 유출과 같은 보안 위협이 제기되고 있다. With the popularization of smart devices, many companies are introducing BYOD (Bring Your Own Device) policies that utilize personal smart devices for work. Although BYOD has advantages such as improved work efficiency and cost reduction, security threats such as confidential data leakage are being raised as work data is stored on personal smart devices.

이러한 보안 위협을 해결하기 위해 EMM(Enterprise Mobility Management)과 같은 솔루션을 도입하여 스마트 기기 보안 및 기업 정책에 맞는 맞춤형 보안 서비스를 제공하고 있다. 기업 정책에 따라 보안 서비스를 제공하기 위해서는 애플리케이션의 원본 소스 코드를 분석하여 보안 기능이 필요한 위치에 보안 기능을 추가해야 한다. 이러한 작업은 기업 정책이 변경될 때마다 수행해야 하므로 정책에 따라 애플리케이션을 커스터마이징(customizing)하기 위해 매우 오랜 기간이 소요된다.To address these security threats, solutions such as Enterprise Mobility Management (EMM) have been introduced to provide customized security services for smart device security and corporate policies. In order to provide security services according to corporate policy, it is necessary to analyze the original source code of the application and add the security function to the location where the security function is required. This task has to be done every time the corporate policy changes, so it takes a very long time to customize the application according to the policy.

한편, 애플리케이션의 원본 소스 코드 없이 보안 기능을 적용하는 방안으로 앱 래핑(App wrapping)이 있다. 앱 래핑은 바이트코드(Bytecode) 수준에서 애플리케이션의 원본 소스 코드 없이 애플리케이션 파일에 직접 보안 기능 코드를 추가하는 기술이다. 하지만, 바이트코드 수준에서 보안 기능 코드를 추가한 이후에 애플리케이션이 원활하게 작동되게 하는 것은 어려운 문제로 알려져 있다. On the other hand, there is an app wrapping method to apply a security function without the original source code of the application. App wrapping is a technology that adds security function code directly to the application file without the original source code of the application at the bytecode level. However, it is known that it is difficult to make the application run smoothly after adding the security function code at the bytecode level.

특히, 안드로이드(Android)의 바이트코드인 스말리 코드(smali code)는 레지스터(register) 기반으로 각 메소드(method) 영역마다 사용할 수 있는 메모리(memory)가 한정되어 있어, 보안 기능 코드를 추가한 이후에 오버플로우(overflow) 에러가 발생하여 애플리케이션이 정상적으로 실행되지 않는다.In particular, the bytecode of Android, smali code, is a register-based memory that can be used for each method area is limited, so after adding the security function code An overflow error occurs in the , and the application does not run normally.

대한민국 공개특허공보 제10-2018-0053872호 (2018. 05. 24. 공개)Republic of Korea Patent Publication No. 10-2018-0053872 (published on May 24, 2018)

본 발명의 실시예들은 애플리케이션에 보안 기능을 추가하기 위한 애플리케이션 변환 방법 및 장치를 제공하기 위한 것이다.SUMMARY Embodiments of the present invention are to provide an application conversion method and apparatus for adding a security function to an application.

일 실시예에 따른 애플리케이션 변환 방법은, 타겟 애플리케이션 및 상기 타겟 애플리케이션에 추가할 보안 기능을 호출하는 호출 애플리케이션을 각각 디컴파일(decompile)하여 상기 타겟 애플리케이션에 대한 제1 바이트코드(bytecode) 및 상기 호출 애플리케이션에 대한 제2 바이트코드를 생성하는 단계; 상기 제2 바이트코드에서 상기 보안 기능을 호출하기 위한 호출 코드를 추출하는 단계; 상기 추출된 호출 코드를 상기 제1 바이트코드에 추가하는 단계; 상기 호출 코드가 추가된 제1 바이트코드에서 상기 호출 코드와 나머지 코드 사이의 충돌을 방지하기 위한 코드 최적화를 수행하는 단계; 및 상기 코드 최적화가 수행된 제1 바이트코드를 리컴파일(recompile)하는 단계를 포함한다.In an application conversion method according to an embodiment, a first bytecode for the target application and the calling application by decompile of a target application and a calling application that calls a security function to be added to the target application, respectively generating a second bytecode for extracting a calling code for calling the security function from the second bytecode; adding the extracted calling code to the first bytecode; performing code optimization to prevent a collision between the calling code and the remaining codes in the first bytecode to which the calling code is added; and recompiling the first bytecode on which the code optimization is performed.

상기 호출 코드는, 상기 보안 기능을 제공하는 보안 애플리케이션에서 상기 보안 기능을 호출하기 위한 코드일 수 있다.The calling code may be a code for calling the security function in a security application providing the security function.

상기 코드 최적화를 수행하는 단계는, 상기 나머지 코드에 포함된 하나 이상의 파라미터를 수정하여 상기 코드 최적화를 수행할 수 있다.The performing of the code optimization may include performing the code optimization by modifying one or more parameters included in the remaining code.

상기 코드 최적화를 수행하는 단계는, 상기 나머지 코드에서 상기 호출 코드에 포함된 파라미터와 변수 명이 중복되는 파라미터를 식별하는 단계; 및 상기 식별된 파라미터와 관련된 코드를 수정하여 상기 코드 최적화를 수행하는 단계를 포함할 수 있다.The performing of the code optimization may include: identifying a parameter whose variable name overlaps with a parameter included in the calling code in the remaining code; and performing the code optimization by modifying the code associated with the identified parameter.

일 실시예에 따른 장치는, 하나 이상의 프로세서; 및 상기 하나 이상의 프로세서에 의해 실행되는 하나 이상의 프로그램을 저장하는 메모리를 포함하는 장치로서, 상기 하나 이상의 프로그램은, 타겟 애플리케이션 및 상기 타겟 애플리케이션에 추가할 보안 기능을 호출하는 호출 애플리케이션을 각각 디컴파일(decompile)하여 상기 타겟 애플리케이션에 대한 제1 바이트코드(bytecode) 및 상기 호출 애플리케이션에 대한 제2 바이트코드를 생성하는 단계; 상기 제2 바이트코드에서 상기 보안 기능을 호출하기 위한 호출 코드를 추출하는 단계; 상기 추출된 호출 코드를 상기 제1 바이트코드에 추가하는 단계; 상기 호출 코드가 추가된 제1 바이트코드에서 상기 호출 코드와 나머지 코드 사이의 충돌을 방지하기 위한 코드 최적화를 수행하는 단계; 및 상기 코드 최적화가 수행된 제1 바이트코드를 리컴파일(recompile)하는 단계를 실행하기 위한 명령어들을 포함한다.An apparatus according to an embodiment includes one or more processors; and a memory storing one or more programs to be executed by the one or more processors, the one or more programs to decompile a target application and a calling application that calls a security function to be added to the target application, respectively. ) to generate a first bytecode for the target application and a second bytecode for the calling application; extracting a calling code for calling the security function from the second bytecode; adding the extracted calling code to the first bytecode; performing code optimization to prevent a collision between the calling code and the remaining codes in the first bytecode to which the calling code is added; and instructions for executing the step of recompiling the first bytecode on which the code optimization has been performed.

상기 호출 코드는, 상기 보안 기능을 제공하는 보안 애플리케이션에서 상기 보안 기능을 호출하기 위한 코드일 수 있다.The calling code may be a code for calling the security function in a security application providing the security function.

상기 코드 최적화를 수행하는 단계는, 상기 나머지 코드에 포함된 하나 이상의 파라미터를 수정하여 상기 코드 최적화를 수행할 수 있다.The performing of the code optimization may include performing the code optimization by modifying one or more parameters included in the remaining code.

상기 코드 최적화를 수행하는 단계는, 상기 나머지 코드에서 상기 호출 코드에 포함된 파라미터와 변수 명이 중복되는 파라미터를 식별하는 단계; 및 상기 식별된 파라미터와 관련된 코드를 수정하여 상기 코드 최적화를 수행하는 단계를 포함할 수 있다.The performing of the code optimization may include: identifying a parameter whose variable name overlaps with a parameter included in the calling code in the remaining code; and performing the code optimization by modifying the code associated with the identified parameter.

본 발명의 실시예들에 따르면, 애플리케이션의 원본 소스 코드 없이 바이트코드 수준에서 애플리케이션에 다양한 보안 기능들을 기존 코드와 충돌 없이 적용시킬 수 있다.According to embodiments of the present invention, various security functions can be applied to an application at the bytecode level without conflicting with the existing code without the original source code of the application.

도 1은 예시적인 실시예들에서 사용되기에 적합한 컴퓨팅 장치를 포함하는 컴퓨팅 환경을 예시하여 설명하기 위한 블록도
도 2는 일 실시예에 다른 애플리케이션 변환 방법의 순서도
도 3은 제1 바이트코드에 추가된 호출 코드와 제1 바이트코드의 나머지 코드 사이의 충돌을 예시적으로 설명하기 위한 도면
도 4는 일 실시예에 따른 코드 최적화를 예시적으로 설명하기 위한 도면
1 is a block diagram illustrating and describing a computing environment including a computing device suitable for use in example embodiments;
2 is a flowchart of an application conversion method according to an embodiment;
FIG. 3 is a diagram for exemplarily explaining a collision between a calling code added to the first bytecode and the remaining codes of the first bytecode; FIG.
4 is a diagram for exemplarily explaining code optimization according to an embodiment;

이하, 도면을 참조하여 본 발명의 구체적인 실시형태를 설명하기로 한다. 이하의 상세한 설명은 본 명세서에서 기술된 방법, 장치 및/또는 시스템에 대한 포괄적인 이해를 돕기 위해 제공된다. 그러나 이는 예시에 불과하며 본 발명은 이에 제한되지 않는다.Hereinafter, specific embodiments of the present invention will be described with reference to the drawings. The following detailed description is provided to provide a comprehensive understanding of the methods, apparatus, and/or systems described herein. However, this is merely an example and the present invention is not limited thereto.

본 발명의 실시예들을 설명함에 있어서, 본 발명과 관련된 공지기술에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명을 생략하기로 한다. 그리고, 후술되는 용어들은 본 발명에서의 기능을 고려하여 정의된 용어들로서 이는 사용자, 운용자의 의도 또는 관례 등에 따라 달라질 수 있다. 그러므로 그 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다. 상세한 설명에서 사용되는 용어는 단지 본 발명의 실시예들을 기술하기 위한 것이며, 결코 제한적이어서는 안 된다. 명확하게 달리 사용되지 않는 한, 단수 형태의 표현은 복수 형태의 의미를 포함한다. 본 설명에서, "포함" 또는 "구비"와 같은 표현은 어떤 특성들, 숫자들, 단계들, 동작들, 요소들, 이들의 일부 또는 조합을 가리키기 위한 것이며, 기술된 것 이외에 하나 또는 그 이상의 다른 특성, 숫자, 단계, 동작, 요소, 이들의 일부 또는 조합의 존재 또는 가능성을 배제하도록 해석되어서는 안 된다.In describing the embodiments of the present invention, if it is determined that the detailed description of the known technology related to the present invention may unnecessarily obscure the gist of the present invention, the detailed description thereof will be omitted. In addition, the terms to be described later are terms defined in consideration of functions in the present invention, which may vary according to intentions or customs of users and operators. Therefore, the definition should be made based on the content throughout this specification. The terminology used in the detailed description is for the purpose of describing embodiments of the present invention only, and should in no way be limiting. Unless explicitly used otherwise, expressions in the singular include the meaning of the plural. In this description, expressions such as “comprising” or “comprising” are intended to indicate certain features, numbers, steps, acts, elements, some or a combination thereof, and one or more other than those described. It should not be construed to exclude the presence or possibility of other features, numbers, steps, acts, elements, or any part or combination thereof.

도 1은 예시적인 실시예들에서 사용되기에 적합한 컴퓨팅 장치를 포함하는 컴퓨팅 환경을 예시하여 설명하기 위한 블록도이다. 1 is a block diagram illustrating and describing a computing environment including a computing device suitable for use in example embodiments.

도 1에 도시된 실시예에서, 각 컴포넌트들은 이하에 기술된 것 이외에 상이한 기능 및 능력을 가질 수 있고, 이하에 기술된 것 이외에도 추가적인 컴포넌트를 포함할 수 있다.In the embodiment shown in FIG. 1 , each component may have different functions and capabilities other than those described below, and may include additional components in addition to those described below.

컴퓨팅 환경(10)은 컴퓨팅 장치(12)를 포함한다. 일 실시예에서, 컴퓨팅 장치(12)는 후술할 애플리케이션 변환 방법을 수행하기 위한 장치일 수 있다.Computing environment 10 includes computing device 12 . In one embodiment, the computing device 12 may be a device for performing an application conversion method to be described later.

컴퓨팅 장치(12)는 적어도 하나의 프로세서(14), 컴퓨터 판독 가능 저장 매체(16) 및 통신 버스(18)를 포함한다. 프로세서(14)는 컴퓨팅 장치(12)로 하여금 앞서 언급된 예시적인 실시예에 따라 동작하도록 할 수 있다. 예컨대, 프로세서(14)는 컴퓨터 판독 가능 저장 매체(16)에 저장된 하나 이상의 프로그램들을 실행할 수 있다. 상기 하나 이상의 프로그램들은 하나 이상의 컴퓨터 실행 가능 명령어를 포함할 수 있으며, 상기 컴퓨터 실행 가능 명령어는 프로세서(14)에 의해 실행되는 경우 컴퓨팅 장치(12)로 하여금 예시적인 실시예에 따른 동작들을 수행하도록 구성될 수 있다.Computing device 12 includes at least one processor 14 , computer readable storage medium 16 , and communication bus 18 . The processor 14 may cause the computing device 12 to operate in accordance with the exemplary embodiments discussed above. For example, the processor 14 may execute one or more programs stored in the computer-readable storage medium 16 . The one or more programs may include one or more computer-executable instructions that, when executed by the processor 14, configure the computing device 12 to perform operations in accordance with the exemplary embodiment. can be

컴퓨터 판독 가능 저장 매체(16)는 컴퓨터 실행 가능 명령어 내지 프로그램 코드, 프로그램 데이터 및/또는 다른 적합한 형태의 정보를 저장하도록 구성된다. 컴퓨터 판독 가능 저장 매체(16)에 저장된 프로그램(20)은 프로세서(14)에 의해 실행 가능한 명령어의 집합을 포함한다. 일 실시예에서, 컴퓨터 판독 가능 저장 매체(16)는 메모리(랜덤 액세스 메모리와 같은 휘발성 메모리, 비휘발성 메모리, 또는 이들의 적절한 조합), 하나 이상의 자기 디스크 저장 디바이스들, 광학 디스크 저장 디바이스들, 플래시 메모리 디바이스들, 그 밖에 컴퓨팅 장치(12)에 의해 액세스되고 원하는 정보를 저장할 수 있는 다른 형태의 저장 매체, 또는 이들의 적합한 조합일 수 있다.Computer-readable storage medium 16 is configured to store computer-executable instructions or program code, program data, and/or other suitable form of information. The program 20 stored in the computer readable storage medium 16 includes a set of instructions executable by the processor 14 . In one embodiment, computer-readable storage medium 16 includes memory (volatile memory, such as random access memory, non-volatile memory, or a suitable combination thereof), one or more magnetic disk storage devices, optical disk storage devices, flash It may be memory devices, other forms of storage medium accessed by computing device 12 and capable of storing desired information, or a suitable combination thereof.

통신 버스(18)는 프로세서(14), 컴퓨터 판독 가능 저장 매체(16)를 포함하여 컴퓨팅 장치(12)의 다른 다양한 컴포넌트들을 상호 연결한다.Communication bus 18 interconnects various other components of computing device 12 , including processor 14 and computer readable storage medium 16 .

컴퓨팅 장치(12)는 또한 하나 이상의 입출력 장치(24)를 위한 인터페이스를 제공하는 하나 이상의 입출력 인터페이스(22) 및 하나 이상의 네트워크 통신 인터페이스(26)를 포함할 수 있다. 입출력 인터페이스(22) 및 네트워크 통신 인터페이스(26)는 통신 버스(18)에 연결된다. 입출력 장치(24)는 입출력 인터페이스(22)를 통해 컴퓨팅 장치(12)의 다른 컴포넌트들에 연결될 수 있다. 예시적인 입출력 장치(24)는 포인팅 장치(마우스 또는 트랙패드 등), 키보드, 터치 입력 장치(터치패드 또는 터치스크린 등), 음성 또는 소리 입력 장치, 다양한 종류의 센서 장치 및/또는 촬영 장치와 같은 입력 장치, 및/또는 디스플레이 장치, 프린터, 스피커 및/또는 네트워크 카드와 같은 출력 장치를 포함할 수 있다. 예시적인 입출력 장치(24)는 컴퓨팅 장치(12)를 구성하는 일 컴포넌트로서 컴퓨팅 장치(12)의 내부에 포함될 수도 있고, 컴퓨팅 장치(12)와는 구별되는 별개의 장치로 컴퓨팅 장치(12)와 연결될 수도 있다.Computing device 12 may also include one or more input/output interfaces 22 and one or more network communication interfaces 26 that provide interfaces for one or more input/output devices 24 . The input/output interface 22 and the network communication interface 26 are coupled to the communication bus 18 . Input/output device 24 may be coupled to other components of computing device 12 via input/output interface 22 . Exemplary input/output device 24 may include a pointing device (such as a mouse or trackpad), a keyboard, a touch input device (such as a touchpad or touchscreen), a voice or sound input device, various types of sensor devices, and/or imaging devices. input devices, and/or output devices such as display devices, printers, speakers and/or network cards. The exemplary input/output device 24 may be included in the computing device 12 as a component constituting the computing device 12 , and may be connected to the computing device 12 as a separate device distinct from the computing device 12 . may be

도 2는 일 실시예에 따른 애플리케이션 변환 방법의 순서도이다.2 is a flowchart of an application conversion method according to an embodiment.

도 2에 도시된 애플리케이션 변환 방법은 변환 대상인 타겟 애플리케이션을 보안 기능이 추가된 애플리케이션으로 변환하기 위한 것으로 예를 들어, 도 1에 도시된 컴퓨팅 장치(12)에 의해 수행될 수 있다.The application conversion method shown in FIG. 2 is for converting a target application to be converted into an application to which a security function is added, and may be performed, for example, by the computing device 12 shown in FIG. 1 .

도 2를 참조하면, 우선, 컴퓨팅 장치(12)는 타겟 애플리케이션과 호출 애플리케이션을 각각 디컴파일(decompile)하여 타겟 애플리케이션에 대한 바이트코드(bytecode)(이하, 제1 바이트코드) 및 호출 애플리케이션에 대한 바이트코드(이하, 제2 바이트코드)를 생성한다(210). Referring to FIG. 2 , first, the computing device 12 decompiles a target application and a calling application, respectively, and a bytecode for the target application (hereinafter, a first bytecode) and a byte for the calling application. A code (hereinafter, referred to as a second byte code) is generated ( 210 ).

이때, 타겟 애플리케이션은 예를 들어, EMM(Enterprise Mobility Management), MDM(Mobile Device Management) 등과 같이 보안 애플리케이션에 의해 제공되는 하나 이상의 보안 기능이 적용될 애플리케이션을 의미할 수 있다. In this case, the target application may refer to an application to which one or more security functions provided by a security application, such as Enterprise Mobility Management (EMM), Mobile Device Management (MDM), etc. are applied.

또한, 호출 애플리케이션은 보안 애플리케이션에 의해 제공되는 보안 기능을 호출하기 위한 호출 코드를 포함하는 애플리케이션을 의미할 수 있다.Also, the calling application may refer to an application including a calling code for calling a security function provided by the security application.

한편, 일 실시예에 따르면, 타겟 애플리케이션 및 호출 애플리케이션은 예를 들어, 구글(Google) 사에서 공개한 안드로이드(Android) 운영체제에서 실행되는 APK(Android Application Package) 형식의 파일일 수 있으며, 제1 바이트코드 및 제2 바이트코드는 예를 들어, 스말리 코드(Smali code)일 수 있으나 반드시 이에 한정되는 것은 아니다. Meanwhile, according to an embodiment, the target application and the calling application may be, for example, files in the format of an Android Application Package (APK) executed in the Android operating system disclosed by Google, and the first byte The code and the second bytecode may be, for example, Smali code, but are not limited thereto.

또한, 일 실시예에 따르면, 보안 애플리케이션에 의해 제공되는 보안 기능은 예를 들어, API(Application Programming Interface) 형태일 수 있으나, 실시예에 따라, 안드로이드 액티비티(Android Activity)의 형태일 수 있다.In addition, according to an embodiment, the security function provided by the security application may be in the form of, for example, an application programming interface (API), but according to an embodiment, it may be in the form of an Android activity.

이후, 컴퓨팅 장치(12)는 제2 바이트코드에서 타겟 애플리케이션에 추가할 보안 기능을 호출하기 위한 호출 코드를 추출한 후, 추출된 호출 코드를 제1 바이트코드에 추가한다(220).Thereafter, the computing device 12 extracts a calling code for calling a security function to be added to the target application from the second bytecode, and then adds the extracted calling code to the first bytecode ( 220 ).

이후, 컴퓨팅 장치(12)는 제1 바이트코드에 추가된 호출 코드와 제1 바이트코드의 나머지 코드 사이의 충돌을 방지하기 위한 코드 최적화를 수행한다(230).Thereafter, the computing device 12 performs code optimization to prevent a collision between the calling code added to the first bytecode and the remaining codes of the first bytecode ( 230 ).

이때, 일 실시예에 따르면, 컴퓨팅 장치(12)는 제1 바이트코드의 나머지 코드에 포함된 하나 이상의 파라미터를 수정하여 코드 최적화를 수행할 수 있다. In this case, according to an embodiment, the computing device 12 may perform code optimization by modifying one or more parameters included in the remaining codes of the first bytecode.

구체적으로, 컴퓨팅 장치(12)는 제 바이트코드에 추가된 호출 코드와 제1 바이트코드의 나머지 코드에서 변수 명이 중복되는 파라미터를 식별하고, 나머지 코드에서 해당 파라미터와 관련된 코드를 수정하여 코드 최적화를 수행할 수 있다. Specifically, the computing device 12 identifies a parameter whose variable name overlaps in the calling code added to the first bytecode and the remaining code of the first bytecode, and performs code optimization by correcting the code related to the parameter in the remaining code can do.

도 3은 제1 바이트코드에 추가된 호출 코드와 제1 바이트코드의 나머지 코드 사이의 충돌을 예시적으로 설명하기 위한 도면이다. 3 is a diagram for exemplarily explaining a collision between a calling code added to the first bytecode and the remaining codes of the first bytecode.

도 3을 참조하면, 제1 바이트코드(300)에 추가된 호출 코드(310) 중 일부 코드(320)에서 사용되는 파라미터 "p0"는 제1 바이트코드(330)의 나머지 코드 중 일부 코드(330)에서 사용되는 포함된 파라미터 "p0"와 동일한 변수 명을 가지고 있으므로, 애플리케이션 실행 시 에러가 발생하게 된다. 따라서, 호출 코드(310)가 제1 바이트코드(300)에 추가된 경우, 나머지 코드에서 사용되는 파라미터와 충돌이 발생하지 않도록 코드 최적화를 수행할 필요가 있다.Referring to FIG. 3 , the parameter “p0” used in some codes 320 among the calling codes 310 added to the first bytecode 300 is a partial code 330 of the remaining codes of the first bytecode 330 . ) has the same variable name as the included parameter "p0" used in ), so an error occurs when running the application. Therefore, when the calling code 310 is added to the first bytecode 300 , it is necessary to perform code optimization so as not to conflict with parameters used in the remaining codes.

도 4는 일 실시예에 따른 코드 최적화를 예시적으로 설명하기 위한 도면이다.4 is a diagram for exemplarily explaining code optimization according to an embodiment.

도 4를 참조하면, 컴퓨팅 장치(12)는 코드 최적화를 위해 우선 제1 바이트코드의 나머지 코드에서 제1 바이트코드에 추가된 호출 코드에 포함된 파라미터와 변수 명이 중복되는 파라미터인 “activity”를 전역 변수로 선언(410)할 수 있다. 이때, 전역 변수 명은 다른 변수 명과 중복되지 않도록 결정될 수 있다. Referring to FIG. 4 , the computing device 12 globalizes “activity”, which is a parameter whose variable name overlaps with a parameter included in the calling code added to the first bytecode, from the remaining codes of the first bytecode for code optimization. It can be declared as a variable (410). In this case, the global variable name may be determined not to overlap with other variable names.

이후, 컴퓨팅 장치(12)는 나머지 코드에서 해당 변수 명을 가진 파라미터를 “this”로 지정(420)하고, 해당 파라미터가 호출되는 메소드에서 410에서 선언된 전역 변수 명이 사용되도록 코드를 변경(430)함으로써 코드 최적화를 수행할 수 있다.Thereafter, the computing device 12 designates a parameter having a corresponding variable name as “this” in the rest of the code (420), and changes the code so that the global variable name declared in 410 is used in the method in which the corresponding parameter is called (430) This allows code optimization to be performed.

다시 도 2를 참조하면, 컴퓨팅 장치(12)는 코드 최적화가 완료된 경우, 코드 최적화가 수행된 제1 바이트코드를 리컴파일(recompile)하여 보안 기능이 추가된 타겟 애플리케이션을 생성한다(240).Referring back to FIG. 2 , when the code optimization is completed, the computing device 12 recompiles the first bytecode on which the code optimization is performed to generate a target application to which a security function is added ( 240 ).

이때, 실시예에 따라, 생성된 타겟 애플리케이션에는 전자 서명을 통해 생성된 서명 정보가 추가될 수 있다.In this case, according to an embodiment, signature information generated through an electronic signature may be added to the generated target application.

한편, 도 2에 도시된 순서도에서 적어도 일부의 단계들은 순서를 바꾸어 수행되거나, 다른 단계와 결합되어 함께 수행되거나, 생략되거나, 세부 단계들로 나뉘어 수행되거나, 또는 도시되지 않은 하나 이상의 단계가 부가되어 수행될 수 있다.On the other hand, in the flowchart shown in FIG. 2, at least some of the steps are performed in a reversed order, performed together with other steps, omitted, divided into detailed steps, or one or more steps not shown are added. can be performed.

이상에서 대표적인 실시예를 통하여 본 발명에 대하여 상세하게 설명하였으나, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 전술한 실시예에 대하여 본 발명의 범주에서 벗어나지 않는 한도 내에서 다양한 변형이 가능함을 이해할 것이다. 그러므로 본 발명의 권리범위는 설명된 실시예에 국한되어 정해져서는 안 되며, 후술하는 특허청구범위뿐만 아니라 이 특허청구범위와 균등한 것들에 의해 정해져야 한다.Although the present invention has been described in detail through representative embodiments above, those of ordinary skill in the art to which the present invention pertains can make various modifications to the above-described embodiments without departing from the scope of the present invention. will understand Therefore, the scope of the present invention should not be limited to the described embodiments and should be defined by the claims described below as well as the claims and equivalents.

10: 컴퓨팅 환경
12: 컴퓨팅 장치
14: 프로세서
16: 컴퓨터 판독 가능 저장 매체
18: 통신 버스
20: 프로그램
22: 입출력 인터페이스
24: 입출력 장치
26: 네트워크 통신 인터페이스
10: Computing Environment
12: computing device
14: Processor
16: computer readable storage medium
18: communication bus
20: Program
22: input/output interface
24: input/output device
26: network communication interface

Claims (8)

타겟 애플리케이션 및 상기 타겟 애플리케이션에 추가할 보안 기능을 호출하는 호출 애플리케이션을 각각 디컴파일(decompile)하여 상기 타겟 애플리케이션에 대한 제1 바이트코드(bytecode) 및 상기 호출 애플리케이션에 대한 제2 바이트코드를 생성하는 단계;
상기 제2 바이트코드에서 상기 보안 기능을 호출하기 위한 호출 코드를 추출하는 단계;
상기 추출된 호출 코드를 상기 제1 바이트코드에 추가하는 단계;
상기 호출 코드가 추가된 제1 바이트코드에서 상기 호출 코드와 나머지 코드 사이의 충돌을 방지하기 위한 코드 최적화를 수행하는 단계; 및
상기 코드 최적화가 수행된 제1 바이트코드를 리컴파일(recompile)하는 단계를 포함하는, 애플리케이션 변환 방법.
generating a first bytecode for the target application and a second bytecode for the calling application by decompiling a target application and a calling application that calls a security function to be added to the target application, respectively ;
extracting a calling code for calling the security function from the second bytecode;
adding the extracted calling code to the first bytecode;
performing code optimization to prevent a collision between the calling code and the remaining codes in the first bytecode to which the calling code is added; and
and recompiling the first bytecode on which the code optimization is performed.
청구항 1에 있어서,
상기 호출 코드는, 상기 보안 기능을 제공하는 보안 애플리케이션에서 상기 보안 기능을 호출하기 위한 코드인, 애플리케이션 변환 방법.
The method according to claim 1,
The calling code is a code for calling the security function in a security application providing the security function, the application conversion method.
청구항 1에 있어서,
상기 코드 최적화를 수행하는 단계는, 상기 나머지 코드에 포함된 하나 이상의 파라미터를 수정하여 상기 코드 최적화를 수행하는, 애플리케이션 변환 방법.
The method according to claim 1,
In the performing the code optimization, the code optimization is performed by modifying one or more parameters included in the remaining code.
청구항 1에 있어서,
상기 코드 최적화를 수행하는 단계는, 상기 나머지 코드에서 상기 호출 코드에 포함된 파라미터와 변수 명이 중복되는 파라미터를 식별하는 단계; 및
상기 식별된 파라미터와 관련된 코드를 수정하여 상기 코드 최적화를 수행하는 단계를 포함하는, 애플리케이션 변환 방법.
The method according to claim 1,
The performing of the code optimization may include: identifying a parameter whose variable name overlaps with a parameter included in the calling code in the remaining code; and
performing the code optimization by modifying a code associated with the identified parameter.
하나 이상의 프로세서; 및
상기 하나 이상의 프로세서에 의해 실행되는 하나 이상의 프로그램을 저장하는 메모리를 포함하는 장치로서,
상기 하나 이상의 프로그램은,
타겟 애플리케이션 및 상기 타겟 애플리케이션에 추가할 보안 기능을 호출하는 호출 애플리케이션을 각각 디컴파일(decompile)하여 상기 타겟 애플리케이션에 대한 제1 바이트코드(bytecode) 및 상기 호출 애플리케이션에 대한 제2 바이트코드를 생성하는 단계;
상기 제2 바이트코드에서 상기 보안 기능을 호출하기 위한 호출 코드를 추출하는 단계;
상기 추출된 호출 코드를 상기 제1 바이트코드에 추가하는 단계;
상기 호출 코드가 추가된 제1 바이트코드에서 상기 호출 코드와 나머지 코드 사이의 충돌을 방지하기 위한 코드 최적화를 수행하는 단계; 및
상기 코드 최적화가 수행된 제1 바이트코드를 리컴파일(recompile)하는 단계를 실행하기 위한 명령어들을 포함하는, 장치.
one or more processors; and
A device comprising a memory storing one or more programs executed by the one or more processors,
the one or more programs,
generating a first bytecode for the target application and a second bytecode for the calling application by decompiling a target application and a calling application that calls a security function to be added to the target application, respectively ;
extracting a calling code for calling the security function from the second bytecode;
adding the extracted calling code to the first bytecode;
performing code optimization to prevent a collision between the calling code and the remaining codes in the first bytecode to which the calling code is added; and
and instructions for executing the step of recompiling the first bytecode on which the code optimization has been performed.
청구항 5에 있어서,
상기 호출 코드는, 상기 보안 기능을 제공하는 보안 애플리케이션에서 상기 보안 기능을 호출하기 위한 코드인, 장치.
6. The method of claim 5,
The calling code is a code for calling the security function in a security application that provides the security function.
청구항 5에 있어서,
상기 코드 최적화를 수행하는 단계는, 상기 나머지 코드에 포함된 하나 이상의 파라미터를 수정하여 상기 코드 최적화를 수행하는, 장치.
6. The method of claim 5,
The performing of the code optimization may include performing the code optimization by modifying one or more parameters included in the remaining code.
청구항 5에 있어서,
상기 코드 최적화를 수행하는 단계는, 상기 나머지 코드에서 상기 호출 코드에 포함된 파라미터와 변수 명이 중복되는 파라미터를 식별하는 단계; 및
상기 식별된 파라미터와 관련된 코드를 수정하여 상기 코드 최적화를 수행하는 단계를 포함하는, 장치.
6. The method of claim 5,
The performing of the code optimization may include: identifying a parameter whose variable name overlaps with a parameter included in the calling code in the remaining code; and
performing the code optimization by modifying code associated with the identified parameter.
KR1020210035161A 2021-03-18 2021-03-18 Method and apparatus for converting application Active KR102323276B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210035161A KR102323276B1 (en) 2021-03-18 2021-03-18 Method and apparatus for converting application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210035161A KR102323276B1 (en) 2021-03-18 2021-03-18 Method and apparatus for converting application

Publications (1)

Publication Number Publication Date
KR102323276B1 true KR102323276B1 (en) 2021-11-05

Family

ID=78507651

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210035161A Active KR102323276B1 (en) 2021-03-18 2021-03-18 Method and apparatus for converting application

Country Status (1)

Country Link
KR (1) KR102323276B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102604270B1 (en) * 2023-08-22 2023-11-21 주식회사 피앤피시큐어 Communication encryption plug-in method and system for applications using JAVA BCI technology
KR102614060B1 (en) 2023-11-21 2023-12-15 인프라닉스 주식회사 Automatic analysis method for converting general applications into software-as-a-service applications

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140075785A (en) * 2011-10-10 2014-06-19 오픈픽 아이엔씨. System and method for creating secure applications
KR101436741B1 (en) * 2013-05-27 2014-09-01 (주)스마일게이트엔터테인먼트 The method and system for applying security solution program
KR20170045437A (en) * 2015-10-16 2017-04-27 성균관대학교산학협력단 Apparatus and method for analyzing general application to be operative upon general-purpose graphic processing units
KR20180053872A (en) 2016-11-14 2018-05-24 삼성에스디에스 주식회사 System and method for converting application

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140075785A (en) * 2011-10-10 2014-06-19 오픈픽 아이엔씨. System and method for creating secure applications
KR101436741B1 (en) * 2013-05-27 2014-09-01 (주)스마일게이트엔터테인먼트 The method and system for applying security solution program
KR20170045437A (en) * 2015-10-16 2017-04-27 성균관대학교산학협력단 Apparatus and method for analyzing general application to be operative upon general-purpose graphic processing units
KR20180053872A (en) 2016-11-14 2018-05-24 삼성에스디에스 주식회사 System and method for converting application

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102604270B1 (en) * 2023-08-22 2023-11-21 주식회사 피앤피시큐어 Communication encryption plug-in method and system for applications using JAVA BCI technology
KR102614060B1 (en) 2023-11-21 2023-12-15 인프라닉스 주식회사 Automatic analysis method for converting general applications into software-as-a-service applications

Similar Documents

Publication Publication Date Title
US8955142B2 (en) Secure execution of unsecured apps on a device
CN112199720B (en) Permission monitoring processing method, device, computer equipment and medium
US10133560B2 (en) Link time program optimization in presence of a linker script
CN106203113A (en) The privacy leakage monitoring method of Android application file
US9871800B2 (en) System and method for providing application security in a cloud computing environment
KR102323276B1 (en) Method and apparatus for converting application
CN110197052A (en) Authority application method, apparatus, equipment and storage medium based on Android platform
EP4088212A1 (en) Method and apparatus for authority control, computer device and storage medium
CN110333872B (en) Application processing method, device, equipment and medium
US20180275976A1 (en) Link time optimization in presence of a linker script using path based rules
US20160342788A1 (en) Generating packages for managed applications
US20150113506A1 (en) Method and system for adaptive loading of application
US20150113502A1 (en) Method and system for encapsulation of application
US11882123B2 (en) Kernel level application data protection
KR102439778B1 (en) Application converting apparatus and method for improving security
CN115794738A (en) Resource file search method, device, equipment and storage medium for application program
KR102272635B1 (en) System and method for converting large scale application
CN111045746B (en) Code expansion method and framework
Avvenuti et al. JCSI: A tool for checking secure information flow in java card applications
US20180129490A1 (en) Object ordering preservation during lto link stage
US9098317B2 (en) Optional retargeting of library references
KR102471221B1 (en) System and method for converting application
CN115202665B (en) Android compile-time API replacement method, device, computer equipment and storage medium
KR20190112491A (en) System and method for converting application
US20110321009A1 (en) Implementing encryption via aspect oriented programming

Legal Events

Date Code Title Description
PA0109 Patent application

Patent event code: PA01091R01D

Comment text: Patent Application

Patent event date: 20210318

PA0201 Request for examination
PA0302 Request for accelerated examination

Patent event date: 20210318

Patent event code: PA03022R01D

Comment text: Request for Accelerated Examination

PE0902 Notice of grounds for rejection

Comment text: Notification of reason for refusal

Patent event date: 20210329

Patent event code: PE09021S01D

E701 Decision to grant or registration of patent right
PE0701 Decision of registration

Patent event code: PE07011S01D

Comment text: Decision to Grant Registration

Patent event date: 20211029

GRNT Written decision to grant
PR0701 Registration of establishment

Comment text: Registration of Establishment

Patent event date: 20211102

Patent event code: PR07011E01D

PR1002 Payment of registration fee

Payment date: 20211102

End annual number: 3

Start annual number: 1

PG1601 Publication of registration