Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdk_jni
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
sobot_android
sdk_jni
Commits
5adb637c
Commit
5adb637c
authored
Aug 18, 2021
by
znw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
密钥使用数组方式再加密
parent
8919c137
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
3 deletions
+27
-3
.DS_Store
.DS_Store
+0
-0
sobot.c
jni/sobot.c
+27
-3
libsobot.so
libs/arm64-v8a/libsobot.so
+0
-0
libsobot.so
libs/armeabi-v7a/libsobot.so
+0
-0
libsobot.so
libs/x86/libsobot.so
+0
-0
libsobot.so
libs/x86_64/libsobot.so
+0
-0
No files found.
.DS_Store
View file @
5adb637c
No preview for this file type
jni/sobot.c
View file @
5adb637c
...
@@ -4,7 +4,31 @@
...
@@ -4,7 +4,31 @@
#include <com_sobot_chat_core_SobotUtil.h>
#include <com_sobot_chat_core_SobotUtil.h>
#include <md5.h>
#include <md5.h>
const
char
*
KEY
=
"sobot*&^%$#@!"
;
static
const
uint8_t
*
getKey
()
{
const
int
len
=
13
;
uint8_t
*
src
=
malloc
(
len
+
1
);
for
(
int
i
=
0
;
i
<
len
;
++
i
)
{
switch
(
i
)
{
case
0
:
src
[
i
]
=
's'
;
break
;
case
1
:
src
[
i
]
=
'o'
;
break
;
case
2
:
src
[
i
]
=
'b'
;
break
;
case
3
:
src
[
i
]
=
'o'
;
break
;
case
4
:
src
[
i
]
=
't'
;
break
;
case
5
:
src
[
i
]
=
'*'
;
break
;
case
6
:
src
[
i
]
=
'&'
;
break
;
case
7
:
src
[
i
]
=
'^'
;
break
;
case
8
:
src
[
i
]
=
'%'
;
break
;
case
9
:
src
[
i
]
=
'$'
;
break
;
case
10
:
src
[
i
]
=
'#'
;
break
;
case
11
:
src
[
i
]
=
'@'
;
break
;
case
12
:
src
[
i
]
=
'!'
;
break
;
}
}
src
[
len
]
=
'\0'
;
return
src
;
}
char
*
jstringToChar
(
JNIEnv
*
env
,
jstring
jstr
)
{
char
*
jstringToChar
(
JNIEnv
*
env
,
jstring
jstr
)
{
char
*
rtn
=
NULL
;
char
*
rtn
=
NULL
;
...
@@ -28,8 +52,8 @@ JNIEXPORT jstring JNICALL Java_com_sobot_chat_core_SobotUtil_getKey
...
@@ -28,8 +52,8 @@ JNIEXPORT jstring JNICALL Java_com_sobot_chat_core_SobotUtil_getKey
char
*
aa
=
jstringToChar
(
env
,
a
);
char
*
aa
=
jstringToChar
(
env
,
a
);
char
*
cc
=
jstringToChar
(
env
,
c
);
char
*
cc
=
jstringToChar
(
env
,
c
);
char
*
dd
=
jstringToChar
(
env
,
d
);
char
*
dd
=
jstringToChar
(
env
,
d
);
char
*
result
=
(
char
*
)
malloc
(
strlen
(
aa
)
+
strlen
(
dd
)
+
strlen
(
cc
)
+
strlen
(
KEY
));
char
*
result
=
(
char
*
)
malloc
(
strlen
(
aa
)
+
strlen
(
dd
)
+
strlen
(
cc
)
+
strlen
(
getKey
()
));
sprintf
(
result
,
"%s%s%s%s"
,
aa
,
dd
,
cc
,
KEY
);
sprintf
(
result
,
"%s%s%s%s"
,
aa
,
dd
,
cc
,
getKey
()
);
MD5_CTX
context
=
{
0
};
MD5_CTX
context
=
{
0
};
MD5Init
(
&
context
);
MD5Init
(
&
context
);
MD5Update
(
&
context
,
result
,
strlen
(
result
));
MD5Update
(
&
context
,
result
,
strlen
(
result
));
...
...
libs/arm64-v8a/libsobot.so
View file @
5adb637c
No preview for this file type
libs/armeabi-v7a/libsobot.so
View file @
5adb637c
No preview for this file type
libs/x86/libsobot.so
View file @
5adb637c
No preview for this file type
libs/x86_64/libsobot.so
View file @
5adb637c
No preview for this file type
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