Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PlayIntegrityFix
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
PlayIntegrityFix
Commits
98bd06eb
There was an error fetching the commit references. Please try again later.
Unverified
Commit
98bd06eb
authored
1 year ago
by
shìwēi nguyen
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Handle reading file properly
parent
b72efd6f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/cpp/main.cpp
+25
-13
25 additions, 13 deletions
app/src/main/cpp/main.cpp
with
25 additions
and
13 deletions
app/src/main/cpp/main.cpp
+
25
−
13
View file @
98bd06eb
#include
<android/log.h>
#include
<sys/system_properties.h>
#include
<unistd.h>
#include
<stdlib.h>
#include
"zygisk.hpp"
#include
"shadowhook.h"
...
...
@@ -214,26 +215,34 @@ private:
static
void
companion
(
int
fd
)
{
FILE
*
dex
=
fopen
(
DEX_FILE_PATH
,
"rb"
);
long
dexSize
=
0
;
char
*
dexBuffer
=
nullptr
;
long
jsonSize
=
0
;
char
*
jsonBuffer
=
nullptr
;
fseek
(
dex
,
0
,
SEEK_END
);
long
dexSize
=
ftell
(
dex
);
fseek
(
dex
,
0
,
SEEK_SET
);
if
(
dex
)
{
fseek
(
dex
,
0
,
SEEK_END
);
dexSize
=
ftell
(
dex
);
fseek
(
dex
,
0
,
SEEK_SET
);
char
dexBuffer
[
dexSize
]
;
fread
(
dexBuffer
,
1
,
dexSize
,
dex
);
dexBuffer
=
(
char
*
)
calloc
(
1
,
dexSize
)
;
fread
(
dexBuffer
,
1
,
dexSize
,
dex
);
fclose
(
dex
);
fclose
(
dex
);
}
FILE
*
json
=
fopen
(
JSON_FILE_PATH
,
"r"
);
fseek
(
json
,
0
,
SEEK_END
);
long
jsonSize
=
ftell
(
json
);
fseek
(
json
,
0
,
SEEK_SET
);
if
(
json
)
{
fseek
(
json
,
0
,
SEEK_END
);
jsonSize
=
ftell
(
json
);
fseek
(
json
,
0
,
SEEK_SET
);
char
jsonBuffer
[
jsonSize
]
;
fread
(
jsonBuffer
,
1
,
jsonSize
,
json
);
jsonBuffer
=
(
char
*
)
calloc
(
1
,
jsonSize
)
;
fread
(
jsonBuffer
,
1
,
jsonSize
,
json
);
fclose
(
json
);
fclose
(
json
);
}
dexBuffer
[
dexSize
]
=
0
;
jsonBuffer
[
jsonSize
]
=
0
;
...
...
@@ -243,9 +252,12 @@ static void companion(int fd) {
write
(
fd
,
&
jsonSize
,
sizeof
(
long
));
write
(
fd
,
jsonBuffer
,
jsonSize
);
free
(
dexBuffer
);
free
(
jsonBuffer
);
}
REGISTER_ZYGISK_MODULE
(
PlayIntegrityFix
)
REGISTER_ZYGISK_COMPANION
(
companion
)
\ No newline at end of file
REGISTER_ZYGISK_COMPANION
(
companion
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment