CN109271759A - So file security reinforcement technique method based on Android platform - Google Patents

So file security reinforcement technique method based on Android platform Download PDF

Info

Publication number
CN109271759A
CN109271759A CN201811120565.8A CN201811120565A CN109271759A CN 109271759 A CN109271759 A CN 109271759A CN 201811120565 A CN201811120565 A CN 201811120565A CN 109271759 A CN109271759 A CN 109271759A
Authority
CN
China
Prior art keywords
file
character string
java
android
reinforcement technique
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.)
Granted
Application number
CN201811120565.8A
Other languages
Chinese (zh)
Other versions
CN109271759B (en
Inventor
李博帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Kaimi Technology Co Ltd
Original Assignee
Hangzhou Kaimi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Kaimi Technology Co Ltd filed Critical Hangzhou Kaimi Technology Co Ltd
Priority to CN201811120565.8A priority Critical patent/CN109271759B/en
Publication of CN109271759A publication Critical patent/CN109271759A/en
Application granted granted Critical
Publication of CN109271759B publication Critical patent/CN109271759B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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]
    • G06F21/12Protecting executable software
    • G06F21/14Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Technology Law (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses so file security reinforcement technique methods based on Android platform.Belong to so file security reinforcement technique field, the form aspect of so file is handled, there is it in the form of a file, it is set dynamically to carry out encryption and decryption in memory, it prevents from directly obtaining so file from local by attacker, the difficulty illegally cracked is increased, has so file security reinforcement technique method based on Android platform of good result in confrontation static analysis and anti-dynamic debugging.Including so file reinforcing process and so file decryption loading procedure;When Android project is needed using content in so file, read encrypted character string dimension in java file, the displacement for dynamically carrying out custom algorithm to the character string in character string dimension is decrypted and splicing, the character string spliced is written in the form of file stream under the app/pkgName/lib catalogue of java file, and it loads and calls in such a way that System.load loads so file, and be deleted after the completion of calling.

Description

So file security reinforcement technique method based on Android platform
Technical field
The present invention relates to so file security reinforcement technique fields, and in particular to so file security based on Android platform is reinforced Technical method.
Background technique
There are two types of present so file reinforcing is general, one is consolidation process is carried out to so file itself, another is pair The Native code of so file internal carries out obscuring encryption.Both reinforcing modes of present so file are all with file Form exists, the carry out encryption and decryption in memory for fixing it, is easy to directly obtain so file from local by attacker, reduce The difficulty illegally cracked, effect is poor in confrontation static analysis and anti-dynamic debugging.
Summary of the invention
The present invention is to provide the shape of a kind of pair of so file to solve existing so file security and reinforce above shortcomings It is handled in terms of formula, has it in the form of a file, it is made dynamically to carry out encryption and decryption in memory, prevent from being attacked The person of hitting directly obtains so file from local, increases the difficulty illegally cracked, has in confrontation static analysis and anti-dynamic debugging So file security reinforcement technique method based on Android platform of good result.
The above technical problem is solved through the following technical scheme:
So file security reinforcement technique method based on Android platform, including so file reinforcing process and so file decryption add Load process;
So file reinforcing process is as follows:
(A1) unguyed so file is read, which is read into memory in the form of file stream;
(A2) restoring files in memory are changed into byte arrays, displacement is carried out to byte arrays according to custom algorithm and is added It is close, obtain new byte arrays;
(A3) then circulation reads byte arrays, in an orderly manner with the character string forms of regular length by the byte arrays of reading It is written in java file, finally obtains a complete character string dimension;
So file decryption loading procedure is as follows:
(A4) when Android project is needed using content in so file, encrypted word is read in java file Symbol string array, the displacement for dynamically carrying out custom algorithm to the character string in character string dimension is decrypted and splicing, will splice Character string be written in the form of file stream under the app/pkgName/lib catalogue of java file, and pass through System.load The mode of load so file is loaded and is called, and is deleted after the completion of calling.
It can be concluded that, general so file reinforcing mode, form side of this Scheme of Strengthening to so file are compared by analysis Face is handled, and has it in the form of a file, so that it is dynamically carried out encryption and decryption in memory, is prevented by attacker So file is directly obtained from local, increases the difficulty illegally cracked, is had well in confrontation static analysis and anti-dynamic debugging Effect.
Preferably, before reading unguyed so file, getting out Android engineering first in step A1 and being used So file;So file supported including each CPU frame of armeabi, x86 and armeabi-v7a;
In step A2, when changing the restoring files in memory into byte arrays, also need to prepare a reinforcing engineering, the work Journey is created by template of java, uses pure java language, it is intended to reinforce so file.
In step A3, when circulation reads byte arrays, also so file is placed under specified directory, runs reinforcing project, So file is passed through into a series of processing, one txt file of final output, txt file content is multiple character string compositions;Then So of file format is read out in the form of file stream, is then encrypted in the form of byte byte, after encryption is completed, Using every 2048 bytes as the output of the length of a character string, less than 2048, just exported with residue length, and in its head and the tail In addition double quotation marks and comma, make its uniform format;Using all character strings in txt file according to the sequence of output as one Character string dimension is stored in " .java " file;
In step A4, when Android project is needed using content in so file, also character string dimension assembly is risen Come, being assembled into final character string in fact is exactly encrypted file, operation is decrypted in this character string, with the shape of file stream Formula is saved in the sd card of mobile phone, is equivalent to and is reduced so file, its loading method is then called.
Preferably, so file includes so file that each CPU frame of armeabi, x86 and armeabi-v7a is supported.
The present invention can reach following effect:
The present invention by analysis it can be concluded that, compare general so file reinforcing mode, this Scheme of Strengthening is to so file Handled in terms of form, have it in the form of a file, it is made dynamically to carry out encryption and decryption in memory, prevent by Attacker directly obtains so file from local, increases the difficulty illegally cracked, equal in confrontation static analysis and anti-dynamic debugging There is good effect.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of so file reinforcing process of the present invention.
Fig. 2 is a kind of flow diagram of so file decryption loading procedure of the present invention.
Specific embodiment
The present invention will be further described below with reference to the accompanying drawings and embodiments.
Embodiment, so file security reinforcement technique method based on Android platform, referring to shown in Fig. 1, Fig. 2, including so text Part reinforcing process and so file decryption loading procedure;
So file reinforcing process is as follows:
(A1) unguyed so file is read, which is read into memory in the form of file stream;
(A2) restoring files in memory are changed into byte arrays, displacement is carried out to byte arrays according to custom algorithm and is added It is close, obtain new byte arrays;
(A3) then circulation reads byte arrays, in an orderly manner with the character string forms of regular length by the byte arrays of reading It is written in java file, finally obtains a complete character string dimension;
So file decryption loading procedure is as follows:
(A4) when Android project is needed using content in so file, encrypted word is read in java file Symbol string array, the displacement for dynamically carrying out custom algorithm to the character string in character string dimension is decrypted and splicing, will splice Character string be written in the form of file stream under the app/pkgName/lib catalogue of java file, and pass through System.load The mode of load so file is loaded and is called, and is deleted after the completion of calling.
In step A1, before reading unguyed so file, it gets out so file used in Android engineering first; So file supported including each CPU frame of armeabi, x86 and armeabi-v7a;
In step A2, when changing the restoring files in memory into byte arrays, also need to prepare a reinforcing engineering, the work Journey is created by template of java, uses pure java language, it is intended to reinforce so file.
In step A3, when circulation reads byte arrays, also so file is placed under specified directory, runs reinforcing project, So file is passed through into a series of processing, one txt file of final output, txt file content is multiple character string compositions;Then So of file format is read out in the form of file stream, is then encrypted in the form of byte byte, after encryption is completed, Using every 2048 bytes as the output of the length of a character string, less than 2048, just exported with residue length, and in its head and the tail In addition double quotation marks and comma, make its uniform format;Using all character strings in txt file according to the sequence of output as one Character string dimension is stored in " .java " file;
In step A4, when Android project is needed using content in so file, also character string dimension assembly is risen Come, being assembled into final character string in fact is exactly encrypted file, operation is decrypted in this character string, with the shape of file stream Formula is saved in the sd card of mobile phone, is equivalent to and is reduced so file, its loading method is then called.
It can be concluded that, general so file reinforcing mode, form side of this Scheme of Strengthening to so file are compared by analysis Face is handled, and has it in the form of a file, so that it is dynamically carried out encryption and decryption in memory, is prevented by attacker So file is directly obtained from local, increases the difficulty illegally cracked, is had well in confrontation static analysis and anti-dynamic debugging Effect.
Embodiments of the present invention are described above in conjunction with attached drawing, however, the implementation is not limited to the above embodiments, this field Those of ordinary skill can be with various changes and modifications may be made within the scope of the appended claims.

Claims (3)

1. so file security reinforcement technique method based on Android platform, which is characterized in that including so file reinforcing process and so File decryption loading procedure;
So file reinforcing process is as follows:
(A1) unguyed so file is read, which is read into memory in the form of file stream;
(A2) restoring files in memory are changed into byte arrays, displacement encryption are carried out to byte arrays according to custom algorithm, Obtain new byte arrays;
(A3) then circulation reads byte arrays, and the byte arrays of reading are written in an orderly manner with the character string forms of regular length Into java file, a complete character string dimension is finally obtained;
So file decryption loading procedure is as follows:
(A4) when Android project is needed using content in so file, encrypted character string is read in java file Array,
The displacement for dynamically carrying out custom algorithm to the character string in character string dimension is decrypted and splicing,
The character string spliced is written under the app/pkgName/lib catalogue of java file in the form of file stream, and led to The mode for crossing System.load load so file is loaded and is called,
And after the completion of calling by it from local deletion.
2. a kind of so file security reinforcement technique method based on Android platform according to claim 1, is characterized in that,
In step A1, before reading unguyed so file, it gets out so file used in Android engineering first;Including So file that each CPU frame of armeabi, x86 and armeabi-v7a is supported;
In step A2, when changing the restoring files in memory into byte arrays, also need to prepare a reinforcing engineering, which is It is created using java as template, uses pure java language, it is intended to reinforce so file;
In step A3, when circulation reads byte arrays, also so file is placed under specified directory, reinforcing project is run, by so File passes through a series of processing, one txt file of final output, and txt file content is multiple character string compositions;It then will be literary So of part format is read out in the form of file stream, is then encrypted in the form of byte byte, will be every after encryption is completed Length output of 2048 bytes as a character string, less than 2048, is just exported with residue length, and add in its head and the tail Double quotation marks and comma make its uniform format;Using all character strings in txt file according to the sequence of output as a character String array is stored in " .java " file;
In step A4, when Android project is needed using content in so file, also character string dimension assembly is got up, is spelled Dressing up final character string in fact is exactly encrypted file, and operation is decrypted in this character string, is protected in the form of file stream It is stored in the sd card of mobile phone, is equivalent to and reduces so file, then call its loading method.
3. a kind of so file security reinforcement technique method based on Android platform according to claim 2, is characterized in that, so File includes so file that each CPU frame of armeabi, x86 and armeabi-v7a is supported.
CN201811120565.8A 2018-09-26 2018-09-26 So file security reinforcement technical method based on android platform Active CN109271759B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811120565.8A CN109271759B (en) 2018-09-26 2018-09-26 So file security reinforcement technical method based on android platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811120565.8A CN109271759B (en) 2018-09-26 2018-09-26 So file security reinforcement technical method based on android platform

Publications (2)

Publication Number Publication Date
CN109271759A true CN109271759A (en) 2019-01-25
CN109271759B CN109271759B (en) 2022-04-05

Family

ID=65198884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811120565.8A Active CN109271759B (en) 2018-09-26 2018-09-26 So file security reinforcement technical method based on android platform

Country Status (1)

Country Link
CN (1) CN109271759B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324317A (en) * 2020-02-18 2020-06-23 上海东普信息科技有限公司 Local printing method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105278954A (en) * 2015-09-25 2016-01-27 杭州哲信信息技术有限公司 Anti-cracking Android APP and operation mode thereof
CN105930745A (en) * 2016-04-25 2016-09-07 北京珊瑚灵御科技有限公司 Android platform-based character string reinforcement method
CN106650327A (en) * 2016-11-24 2017-05-10 湖南鼎源蓝剑信息科技有限公司 so file dynamic recovery-based Android application reinforcement method
CN107273723A (en) * 2017-07-07 2017-10-20 广东工业大学 A kind of Android platform applied software protection method based on so file shell addings

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105278954A (en) * 2015-09-25 2016-01-27 杭州哲信信息技术有限公司 Anti-cracking Android APP and operation mode thereof
CN105930745A (en) * 2016-04-25 2016-09-07 北京珊瑚灵御科技有限公司 Android platform-based character string reinforcement method
CN106650327A (en) * 2016-11-24 2017-05-10 湖南鼎源蓝剑信息科技有限公司 so file dynamic recovery-based Android application reinforcement method
CN107273723A (en) * 2017-07-07 2017-10-20 广东工业大学 A kind of Android platform applied software protection method based on so file shell addings

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324317A (en) * 2020-02-18 2020-06-23 上海东普信息科技有限公司 Local printing method, device, equipment and storage medium
CN111324317B (en) * 2020-02-18 2024-03-26 上海东普信息科技有限公司 Local printing face list method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN109271759B (en) 2022-04-05

Similar Documents

Publication Publication Date Title
CN106203006A (en) Android application reinforcement means based on dex Yu so file Dynamic Execution
CN107194242B (en) Firmware upgrade method and device
KR101471589B1 (en) Method for Providing Security for Common Intermediate Language Program
US9607160B2 (en) Method and apparatus for providing string encryption and decryption in program files
CN104318155A (en) Dynamic loading method capable of guarding against reverse APK file
CN111475824B (en) Data access method, device, equipment and storage medium
CN104317625A (en) Dynamic loading method for APK files
CN106326694A (en) Android application reinforcing method baed on C source code mixing
CN107291485B (en) Dynamic link library reinforcing method, operation method, reinforcing device and safety system
CN103530535A (en) Shell adding and removing method for Android platform application program protection
CN104408337A (en) Reinforcement method for preventing reverse of APK (Android package) file
CN106897587A (en) The method and apparatus of reinforcement application, loading reinforcement application
CN106161336A (en) A kind of information updating method, Apparatus and system
CN111901337A (en) File uploading method and system and storage medium
CN112231702B (en) Application protection method, device, equipment and medium
WO2019062015A1 (en) Source code protection method, application server, and computer-readable storage medium
CN106599629A (en) Strengthening method and apparatus for Android application program
CN109426515A (en) The generation method and device of upgrade package
CN109271759A (en) So file security reinforcement technique method based on Android platform
CN104462883A (en) APK file strengthening method
CN110472425A (en) Unity plug-in unit encryption method based on Mono, storage medium
CN116235174A (en) Apparatus and method for performing encryption algorithm
CN114036561A (en) Information hiding method, information acquiring method, information hiding device, information acquiring device, storage medium and electronic equipment
CN112035803B (en) Protection method and device based on Windows platform software
CN108768662A (en) A method of self-defined signature is increased to Android APK

Legal Events

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