Skip to content
This repository was archived by the owner on Jun 8, 2024. It is now read-only.

Commit c5fdb2e

Browse files
committed
add codeblocks project VirtualApkPatch
1 parent 6e89656 commit c5fdb2e

File tree

6 files changed

+134
-4
lines changed

6 files changed

+134
-4
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ project_fix_unity_jar/null_lib/libs
4141
xcshareddata
4242
Debug
4343
Release
44-
project_fix_unity_jar/fix_unity_jar/builds/codeblocks/bin
44+
Release_x86
4545
FixUnityJar.depend
4646
FixUnityJar.layout
47+
VirtualApkPatch.depend
48+
VirtualApkPatch.layout
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_project_file>
3+
<FileVersion major="1" minor="6" />
4+
<Project>
5+
<Option title="VirtualApkPatch" />
6+
<Option pch_mode="2" />
7+
<Option compiler="gcc" />
8+
<Build>
9+
<Target title="Debug">
10+
<Option output="bin/Debug/VirtualApkPatch" prefix_auto="1" extension_auto="1" />
11+
<Option object_output="obj/Debug/" />
12+
<Option type="1" />
13+
<Option compiler="gcc" />
14+
<Compiler>
15+
<Add option="-g" />
16+
</Compiler>
17+
</Target>
18+
<Target title="Release">
19+
<Option output="bin/Release/VirtualApkPatch" prefix_auto="1" extension_auto="1" />
20+
<Option object_output="obj/Release/" />
21+
<Option type="1" />
22+
<Option compiler="gcc" />
23+
<Compiler>
24+
<Add option="-O2" />
25+
</Compiler>
26+
<Linker>
27+
<Add option="-s" />
28+
</Linker>
29+
</Target>
30+
<Target title="Release_x86">
31+
<Option output="bin/Release_x86/VirtualApkPatch" prefix_auto="1" extension_auto="1" />
32+
<Option object_output="obj/Release_x86/" />
33+
<Option type="1" />
34+
<Option compiler="gcc" />
35+
<Compiler>
36+
<Add option="-O2" />
37+
<Add option="-m32" />
38+
</Compiler>
39+
<Linker>
40+
<Add option="-s" />
41+
<Add option="-m32" />
42+
</Linker>
43+
</Target>
44+
</Build>
45+
<Compiler>
46+
<Add option="-Wall" />
47+
<Add option="-fexceptions" />
48+
<Add option="-D_IS_NEED_VIRTUAL_ZIP=1" />
49+
<Add option="-D_IS_NEED_FIXED_ZLIB_VERSION=1" />
50+
</Compiler>
51+
<Linker>
52+
<Add library="pthread" />
53+
</Linker>
54+
<Unit filename="../../../ApkDiffPatch/HDiffPatch/compress_parallel.cpp" />
55+
<Unit filename="../../../ApkDiffPatch/HDiffPatch/file_for_patch.c">
56+
<Option compilerVar="CC" />
57+
</Unit>
58+
<Unit filename="../../../ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c">
59+
<Option compilerVar="CC" />
60+
</Unit>
61+
<Unit filename="../../../ApkDiffPatch/HDiffPatch/libParallel/parallel_channel.cpp" />
62+
<Unit filename="../../../ApkDiffPatch/HDiffPatch/libParallel/parallel_import.cpp" />
63+
<Unit filename="../../../ApkDiffPatch/lzma/C/LzFind.c">
64+
<Option compilerVar="CC" />
65+
</Unit>
66+
<Unit filename="../../../ApkDiffPatch/lzma/C/LzmaDec.c">
67+
<Option compilerVar="CC" />
68+
</Unit>
69+
<Unit filename="../../../ApkDiffPatch/src/patch/NewStream.cpp" />
70+
<Unit filename="../../../ApkDiffPatch/src/patch/NewStream.h" />
71+
<Unit filename="../../../ApkDiffPatch/src/patch/OldStream.cpp" />
72+
<Unit filename="../../../ApkDiffPatch/src/patch/OldStream.h" />
73+
<Unit filename="../../../ApkDiffPatch/src/patch/Patcher.cpp" />
74+
<Unit filename="../../../ApkDiffPatch/src/patch/Patcher.h" />
75+
<Unit filename="../../../ApkDiffPatch/src/patch/VirtualZipIO.h" />
76+
<Unit filename="../../../ApkDiffPatch/src/patch/ZipDiffData.cpp" />
77+
<Unit filename="../../../ApkDiffPatch/src/patch/ZipDiffData.h" />
78+
<Unit filename="../../../ApkDiffPatch/src/patch/Zipper.cpp" />
79+
<Unit filename="../../../ApkDiffPatch/src/patch/Zipper.h" />
80+
<Unit filename="../../../ApkDiffPatch/src/patch/patch_types.h" />
81+
<Unit filename="../../../ApkDiffPatch/zlib1.2.11/adler32.c">
82+
<Option compilerVar="CC" />
83+
</Unit>
84+
<Unit filename="../../../ApkDiffPatch/zlib1.2.11/compress.c">
85+
<Option compilerVar="CC" />
86+
</Unit>
87+
<Unit filename="../../../ApkDiffPatch/zlib1.2.11/crc32.c">
88+
<Option compilerVar="CC" />
89+
</Unit>
90+
<Unit filename="../../../ApkDiffPatch/zlib1.2.11/deflate.c">
91+
<Option compilerVar="CC" />
92+
</Unit>
93+
<Unit filename="../../../ApkDiffPatch/zlib1.2.11/infback.c">
94+
<Option compilerVar="CC" />
95+
</Unit>
96+
<Unit filename="../../../ApkDiffPatch/zlib1.2.11/inffast.c">
97+
<Option compilerVar="CC" />
98+
</Unit>
99+
<Unit filename="../../../ApkDiffPatch/zlib1.2.11/inflate.c">
100+
<Option compilerVar="CC" />
101+
</Unit>
102+
<Unit filename="../../../ApkDiffPatch/zlib1.2.11/inftrees.c">
103+
<Option compilerVar="CC" />
104+
</Unit>
105+
<Unit filename="../../../ApkDiffPatch/zlib1.2.11/trees.c">
106+
<Option compilerVar="CC" />
107+
</Unit>
108+
<Unit filename="../../../ApkDiffPatch/zlib1.2.11/uncompr.c">
109+
<Option compilerVar="CC" />
110+
</Unit>
111+
<Unit filename="../../../ApkDiffPatch/zlib1.2.11/zutil.c">
112+
<Option compilerVar="CC" />
113+
</Unit>
114+
<Unit filename="../../patch/virtual_apk_patch.cpp" />
115+
<Unit filename="../../patch/virtual_apk_patch.h" />
116+
<Unit filename="../main.cpp" />
117+
<Extensions>
118+
<envvars />
119+
<code_completion />
120+
<lib_finder disable_auto="1" />
121+
<debugger />
122+
</Extensions>
123+
</Project>
124+
</CodeBlocks_project_file>

VirtualApkPatch/builds_test/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
#include "../patch/virtual_apk_patch.h"
99
#include "../../ApkDiffPatch/HDiffPatch/_clock_for_demo.h"
1010

11+
#include <stdio.h>
12+
#include <stdlib.h>
13+
#include <string.h>
1114
#include <iostream>
1215

1316
int main(int argc, const char * argv[]) {
1417
double time0=clock_s();
1518
if (argc!=1+9){
1619
printf(" virtual_apk_patch()\\virtual_apk_merge() is run on android;\n"
17-
" VirtualApkPatch for test them on PC;\n"
20+
" VirtualApkPatch for test them on PC;\n"
1821
"usage: VirtualApkPatch baseApk baseSoDir hotApk hotSoDir"
1922
" out_newApk out_newChangedSoDir zipDiffPath arch_abi threadNum\n");
2023
return -1;

VirtualApkPatch/builds_test/xcode/VirtualApkPatch.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@
101101
D65C69BC23293AB300A3C89C = {
102102
isa = PBXGroup;
103103
children = (
104-
D698B4CF236AD0BB00FC04E9 /* main.cpp */,
105104
D65C69D9232A0E5900A3C89C /* ApkDiffPatch */,
106105
D65C69D023293AFA00A3C89C /* patch */,
106+
D698B4CF236AD0BB00FC04E9 /* main.cpp */,
107107
D65C69C623293AB300A3C89C /* Products */,
108108
D65C6A0D232A0FBB00A3C89C /* Frameworks */,
109109
);

VirtualApkPatch/patch/virtual_apk_patch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static bool findLibDir(const UnZipper* apk,const char* arch_abi,
4848
const int arch_abiLen=(int)strlen(arch_abi);
4949
if (arch_abiLen<=0) return false;
5050
const int dirLen=4+arch_abiLen+1;
51-
if (dirLen+1>libDirBufSize) return false;
51+
if (dirLen+1>(int)libDirBufSize) return false;
5252
memcpy(outLibDir,"lib/",4);
5353
memcpy(outLibDir+4,arch_abi,arch_abiLen);
5454
memcpy(outLibDir+4+arch_abiLen,"/\0",1+1);

VirtualApkPatch/patch/virtual_apk_patch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ extern "C" {
4545
// baseApk&baseSoDir read only
4646
// out_newChangedSoDir can NULL or "", meen no need cache .so files
4747
// if first patch hotApk/hotSoDir can NULL or "", and not need use merge
48+
// if threadNum>1 then used more and more memory, you need test it
4849
int virtual_apk_patch(const char* baseApk,const char* baseSoDir,
4950
const char* hotApk,const char* hotSoDir,
5051
const char* out_newApk,const char* out_newChangedSoDir,

0 commit comments

Comments
 (0)