mirror of
https://github.com/revanced/smali.git
synced 2025-05-11 20:04:28 +02:00
open the odex file as read-only
git-svn-id: https://smali.googlecode.com/svn/trunk@482 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
090e553f34
commit
6ff845a9c1
@ -417,7 +417,7 @@ int main(int argc, char* const argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
int odexFd = open(inputFileName, O_RDWR, 0644);
|
||||
int odexFd = open(inputFileName, O_RDONLY);
|
||||
if (odexFd < 0) {
|
||||
fprintf(stderr, "Unable to open '%s': %s\n", inputFileName, strerror(errno));
|
||||
return 1;
|
||||
@ -466,8 +466,8 @@ int main(int argc, char* const argv[])
|
||||
*/
|
||||
bool success;
|
||||
void* mapAddr;
|
||||
mapAddr = mmap(NULL, inputInfo.st_size, PROT_READ|PROT_WRITE,
|
||||
MAP_SHARED, odexFd, 0);
|
||||
mapAddr = mmap(NULL, inputInfo.st_size, PROT_READ,
|
||||
MAP_PRIVATE, odexFd, 0);
|
||||
if (mapAddr == MAP_FAILED) {
|
||||
fprintf(stderr, "unable to mmap DEX cache: %s\n", strerror(errno));
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user