Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ReyunSecureSdk
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhanglei
ReyunSecureSdk
Commits
c06620d7
Commit
c06620d7
authored
Apr 01, 2021
by
Fear1ess
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4/1
parent
b888a62d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
168 additions
and
4 deletions
+168
-4
CMakeLists.txt
wandun/src/main/cpp/CMakeLists.txt
+5
-4
jni_helper.h
wandun/src/main/cpp/include/jni_helper.h
+158
-0
jni_helper.cpp
wandun/src/main/cpp/jni_helper.cpp
+0
-0
wd_syscall32.s
wandun/src/main/cpp/wd_syscall32.s
+1
-0
wd_syscall64.s
wandun/src/main/cpp/wd_syscall64.s
+4
-0
No files found.
wandun/src/main/cpp/CMakeLists.txt
View file @
c06620d7
...
@@ -5,11 +5,11 @@ project(Wandun)
...
@@ -5,11 +5,11 @@ project(Wandun)
include_directories
(
${
CMAKE_SOURCE_DIR
}
/include
)
include_directories
(
${
CMAKE_SOURCE_DIR
}
/include
)
if
(
${
CMAKE_ANDROID_ARCH_ABI
}
STREQUAL
"arm64-v8a"
)
if
(
${
CMAKE_ANDROID_ARCH_ABI
}
STREQUAL
"arm64-v8a"
)
set
(
OS
_DEPENDENDED_SRC
set
(
ARCH
_DEPENDENDED_SRC
wd_syscall64.s
)
wd_syscall64.s
)
elseif
(
${
CMAKE_ANDROID_ARCH_ABI
}
STREQUAL
"armeabi-v7a"
)
elseif
(
${
CMAKE_ANDROID_ARCH_ABI
}
STREQUAL
"armeabi-v7a"
)
set
(
OS
_DEPENDENDED_SRC
set
(
ARCH
_DEPENDENDED_SRC
wd_syscall32.s
)
wd_syscall32.s
)
endif
()
endif
()
...
@@ -17,8 +17,9 @@ endif()
...
@@ -17,8 +17,9 @@ endif()
add_library
(
wdun
add_library
(
wdun
SHARED
SHARED
core.cpp
core.cpp
wd_syscall.cpp
wd_syscall.cpp
${
OS_DEPENDENDED_SRC
}
jni_helper.cpp
${
ARCH_DEPENDENDED_SRC
}
)
)
target_link_libraries
(
wdun log
)
target_link_libraries
(
wdun log
)
...
...
wandun/src/main/cpp/include/jni_helper.h
0 → 100644
View file @
c06620d7
//
// Created by Fear1ess on 2021/4/1.
//
#ifndef REYUNSDK_JNI_HELPER_H
#define REYUNSDK_JNI_HELPER_H
#include <jni.h>
void
wdCheckException
(
JNIEnv
*
env
);
char
wdGetMethodRetType
(
const
char
*
sig
);
inline
char
wdGetFieldType
(
const
char
*
sig
)
{
return
*
sig
;
}
jvalue
wdGetStaticField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
);
jvalue
wdGetField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
);
void
wdSetStaticField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jvalue
value
);
void
wdSetField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jvalue
value
);
jobject
wdNewObject
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
methodSig
,
...);
jvalue
wdCallStaticMethod
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
methodName
,
const
char
*
methodSig
,
...);
jvalue
wdCallMethod
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
methodName
,
const
char
*
methodSig
,
...);
jboolean
wdCallStaticBooleanMethod
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
methodName
,
const
char
*
methodSig
,
...);
inline
jboolean
wdGetStaticBooleanField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
).
z
;
}
inline
jbyte
wdGetStaticByteField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
).
b
;
}
inline
jchar
wdGetStaticCharField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
).
c
;
}
inline
jshort
wdGetStaticShortField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
).
s
;
}
inline
jint
wdGetStaticIntField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
).
i
;
}
inline
jlong
wdGetStaticLongField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
).
j
;
}
inline
jfloat
wdGetStaticFloatField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
).
f
;
}
inline
jdouble
wdGetStaticDoubleField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
).
d
;
}
inline
jobject
wdGetStaticObjectField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
).
l
;
}
inline
jboolean
wdGetBooleanField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetField
(
env
,
obj
,
fieldName
,
fieldSig
).
z
;
}
inline
jbyte
wdGetByteField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetField
(
env
,
obj
,
fieldName
,
fieldSig
).
b
;
}
inline
jchar
wdGetCharField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetField
(
env
,
obj
,
fieldName
,
fieldSig
).
c
;
}
inline
jshort
wdGetShortField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetField
(
env
,
obj
,
fieldName
,
fieldSig
).
s
;
}
inline
jint
wdGetIntField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetField
(
env
,
obj
,
fieldName
,
fieldSig
).
i
;
}
inline
jlong
wdGetLongField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetField
(
env
,
obj
,
fieldName
,
fieldSig
).
j
;
}
inline
jfloat
wdGetFloatField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetField
(
env
,
obj
,
fieldName
,
fieldSig
).
f
;
}
inline
jdouble
wdGetDoubleField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetField
(
env
,
obj
,
fieldName
,
fieldSig
).
d
;
}
inline
jobject
wdGetObjectField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
)
{
return
wdGetField
(
env
,
obj
,
fieldName
,
fieldSig
).
l
;
}
inline
void
wdSetStaticBooleanField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jboolean
value
)
{
jvalue
j
=
{.
z
=
value
};
wdSetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetStaticByteField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jbyte
value
)
{
jvalue
j
=
{.
b
=
value
};
wdSetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetStaticCharField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jchar
value
)
{
jvalue
j
=
{.
c
=
value
};
wdSetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetStaticShortField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jshort
value
)
{
jvalue
j
=
{.
s
=
value
};
wdSetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetStaticIntField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jint
value
)
{
jvalue
j
=
{.
i
=
value
};
wdSetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetStaticLongField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jlong
value
)
{
jvalue
j
=
{.
j
=
value
};
wdSetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetStaticFloatField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jfloat
value
)
{
jvalue
j
=
{.
f
=
value
};
wdSetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetStaticDoubleField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jdouble
value
)
{
jvalue
j
=
{.
d
=
value
};
wdSetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetStaticObjectField
(
JNIEnv
*
env
,
const
char
*
clsName
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jobject
value
)
{
jvalue
j
=
{.
l
=
value
};
wdSetStaticField
(
env
,
clsName
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetBooleanField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jboolean
value
)
{
jvalue
j
=
{.
z
=
value
};
wdSetField
(
env
,
obj
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetByteField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jbyte
value
)
{
jvalue
j
=
{.
b
=
value
};
wdSetField
(
env
,
obj
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetCharField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jchar
value
)
{
jvalue
j
=
{.
c
=
value
};
wdSetField
(
env
,
obj
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetShortField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jshort
value
)
{
jvalue
j
=
{.
s
=
value
};
wdSetField
(
env
,
obj
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetIntField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jint
value
)
{
jvalue
j
=
{.
i
=
value
};
wdSetField
(
env
,
obj
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetLongField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jlong
value
)
{
jvalue
j
=
{.
j
=
value
};
wdSetField
(
env
,
obj
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetFloatField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jfloat
value
)
{
jvalue
j
=
{.
f
=
value
};
wdSetField
(
env
,
obj
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetDoubleField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jdouble
value
)
{
jvalue
j
=
{.
d
=
value
};
wdSetField
(
env
,
obj
,
fieldName
,
fieldSig
,
j
);
}
inline
void
wdSetObjectField
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
fieldName
,
const
char
*
fieldSig
,
jobject
value
)
{
jvalue
j
=
{.
l
=
value
};
wdSetField
(
env
,
obj
,
fieldName
,
fieldSig
,
j
);
}
#endif //REYUNSDK_JNI_HELPER_H
wandun/src/main/cpp/jni_helper.cpp
0 → 100644
View file @
c06620d7
This diff is collapsed.
Click to expand it.
wandun/src/main/cpp/wd_syscall32.s
View file @
c06620d7
//
//
// Created by Fear1ess on 2021/3/31.
// Created by Fear1ess on 2021/3/31.
//
//
.global wd_syscall32
.global wd_syscall32
.extern wd_set_errno
.extern wd_set_errno
...
...
wandun/src/main/cpp/wd_syscall64.s
View file @
c06620d7
//
// Created by Fear1ess on 2021/3/31.
//
.global wd_syscall64
.global wd_syscall64
.extern wd_set_errno
.extern wd_set_errno
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment