Code Monkey home page Code Monkey logo

aesjniencrypt's Introduction

typingkeyboard

Working harder, not smarter? dealwithit

My GitHub

Top Langs

aesjniencrypt's People

Contributors

baoyongzhang avatar brucewind avatar larry19840909 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aesjniencrypt's Issues

key怎么做处理?

请问下:
1.真实的key为:1234567890abcdef,怎么处理成:NMTIzNDU2Nzg5MGFiY2RlZg?
2.加密结果要怎么处理,不让它出现特殊字符,如加号(+) 和 等号(=),只由字母和数字组成?

thanks.

Can you tell me which NDK version I should use? Thanks.

@BruceWind 你好,

我在项目的 Readme 中看到,ndk 版本要用 11-r13 的
image

但我又在 test_in_executing.sh 脚本中看到 r13 太老的提醒
image

请问当前 master 分支下的的代码,
1、build_libsodium_for_all_android_abi.sh 脚本
2、test_in_executing.sh 脚本
3、完整 so 库编译
具体用哪个 ndk 版本编译最稳定啊?
是用一个版本,还是分开用不同版本呢?

aes.c中密钥扩展的部分多次重复执行

这几天仔细看了aes.c的源码部分.其中密钥的扩展放在了加密的循环中,没有一段明文进行加密,就会进行一次密钥的扩展,如果需要加密的明文稍微长,有一大段的计算浪费在了这个重复的过程.比如160字符的数组就要进行1次有效的密钥扩展和16次多余的密钥扩展

build_libsodium_for_all_android_abi.sh 执行报错,env: python: No such file or directory。中间的日志很多过时,有没有影响

autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: glibtoolize --copy --force
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: copying file 'build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: aclocal --force -I m4
autoreconf: running: /usr/local/Cellar/autoconf/2.71/bin/autoconf --force
configure.ac:72: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:72: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... configure.ac:72: the top level configure.ac:118: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_pthread.m4:88: AX_PTHREAD is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... configure.ac:118: the top level configure.ac:159: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:159: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:1534: AC_ARG_ENABLE is expanded from...
configure.ac:159: the top level
configure.ac:159: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:159: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:1534: AC_ARG_ENABLE is expanded from... configure.ac:159: the top level configure.ac:190: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:190: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:1534: AC_ARG_ENABLE is expanded from...
configure.ac:190: the top level
configure.ac:209: warning: AC_PROG_CC_C99 is obsolete; use AC_PROG_CC
configure.ac:212: warning: ac_ext=c
configure.ac:212: ac_cpp='$CPP $CPPFLAGS'
configure.ac:212: ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
configure.ac:212: ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
configure.ac:212: ac_compiler_gnu=$ac_cv_c_compiler_gnu
configure.ac:212: if test -n "$ac_tool_prefix"; then
configure.ac:212: # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
configure.ac:212: set dummy ${ac_tool_prefix}gcc; ac_word=$2
configure.ac:212: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
configure.ac:212: printf %s "checking for $ac_word... " >&6; }
configure.ac:212: if test ${ac_cv_prog_CC+y}
configure.ac:212: then :
configure.ac:212: printf %s "(cached) " >&6
configure.ac:212: else $as_nop
configure.ac:212: if test -n "$CC"; then
configure.ac:212: ac_cv_prog_CC="$CC" # Let the user override the test.
configure.ac:212: else
configure.ac:212: as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
configure.ac:212: for as_dir in $PATH
configure.ac:212: do
configure.ac:212: IFS=$as_save_IFS
configure.ac:212: case $as_dir in #(((
configure.ac:212: '' is m4_require'd but not m4_defun'd
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/programs.m4:41: _AC_CHECK_PROG is expanded from...
./lib/autoconf/programs.m4:101: AC_CHECK_PROG is expanded from...
./lib/autoconf/programs.m4:221: AC_CHECK_TOOL is expanded from...
./lib/autoconf/c.m4:452: AC_PROG_CC is expanded from...
configure.ac:212: the top level
configure.ac:214: warning: AC_LINK_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
./lib/autoconf/specific.m4:364: AC_USE_SYSTEM_EXTENSIONS is expanded from...
configure.ac:214: the top level
configure.ac:219: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:219: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... m4/ax_check_define.m4:50: AC_CHECK_DEFINE is expanded from... configure.ac:219: the top level configure.ac:224: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:224: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:224: the top level
configure.ac:227: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:227: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... lib/m4sugar/m4sh.m4:594: AS_CASE is expanded from... configure.ac:227: the top level configure.ac:231: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:231: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
configure.ac:231: the top level
configure.ac:240: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:240: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:240: the top level configure.ac:241: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:241: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:241: the top level
configure.ac:241: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:241: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:241: the top level configure.ac:245: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:245: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2823: _AC_COMPILE_IFELSE is expanded from...
./lib/autoconf/general.m4:2839: AC_COMPILE_IFELSE is expanded from...
lib/m4sugar/m4sh.m4:594: AS_CASE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
configure.ac:245: the top level
configure.ac:279: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:279: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... lib/m4sugar/m4sh.m4:594: AS_CASE is expanded from... configure.ac:279: the top level configure.ac:286: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:286: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
lib/m4sugar/m4sh.m4:594: AS_CASE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
configure.ac:286: the top level
configure.ac:301: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:301: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:301: the top level configure.ac:302: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:302: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:302: the top level
configure.ac:305: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:305: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2823: _AC_COMPILE_IFELSE is expanded from... ./lib/autoconf/general.m4:2839: AC_COMPILE_IFELSE is expanded from... configure.ac:305: the top level configure.ac:317: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:317: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:317: the top level
configure.ac:318: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:318: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:318: the top level configure.ac:319: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:319: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:319: the top level
configure.ac:320: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:320: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:320: the top level configure.ac:321: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:321: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:321: the top level
configure.ac:322: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:322: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:322: the top level configure.ac:323: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:323: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:323: the top level
configure.ac:324: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:324: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:324: the top level configure.ac:325: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:325: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:325: the top level
configure.ac:326: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:326: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:326: the top level configure.ac:327: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:327: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:327: the top level
configure.ac:328: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:328: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:328: the top level configure.ac:329: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:329: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:329: the top level
configure.ac:330: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:330: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:330: the top level configure.ac:331: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:331: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:331: the top level
configure.ac:332: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:332: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:332: the top level configure.ac:333: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:333: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:333: the top level
configure.ac:334: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:334: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:334: the top level configure.ac:335: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:335: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:335: the top level
configure.ac:336: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:336: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:336: the top level configure.ac:337: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:337: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:337: the top level
configure.ac:338: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:338: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:338: the top level configure.ac:339: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:339: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:339: the top level
configure.ac:340: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:340: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:340: the top level configure.ac:341: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:341: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:341: the top level
configure.ac:342: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:342: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... configure.ac:342: the top level configure.ac:343: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:343: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:343: the top level
configure.ac:352: warning: The macro AC_TRY_COMPILE' is obsolete. configure.ac:352: You should run autoupdate. ./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from... lib/m4sugar/m4sh.m4:594: AS_CASE is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... m4/ax_tls.m4:49: AX_TLS is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... configure.ac:352: the top level configure.ac:352: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:352: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
m4/ax_tls.m4:49: AX_TLS is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
configure.ac:352: the top level
configure.ac:366: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:366: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... configure.ac:366: the top level configure.ac:366: warning: The macro AC_TRY_LINK' is obsolete.
configure.ac:366: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2823: _AC_COMPILE_IFELSE is expanded from...
./lib/autoconf/general.m4:2839: AC_COMPILE_IFELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
configure.ac:366: the top level
configure.ac:366: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:366: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2823: _AC_COMPILE_IFELSE is expanded from... ./lib/autoconf/general.m4:2839: AC_COMPILE_IFELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... configure.ac:366: the top level configure.ac:858: warning: The macro AC_LIBTOOL_WIN32_DLL' is obsolete.
configure.ac:858: You should run autoupdate.
m4/ltoptions.m4:148: AC_LIBTOOL_WIN32_DLL is expanded from...
configure.ac:858: the top level
configure.ac:858: warning: AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you
configure.ac:858: put the 'win32-dll' option into LT_INIT's first parameter.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
m4/ltoptions.m4:148: AC_LIBTOOL_WIN32_DLL is expanded from...
configure.ac:858: the top level
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:72: installing 'build-aux/compile'
configure.ac:7: installing 'build-aux/missing'
src/libsodium/Makefile.am: installing 'build-aux/depcomp'
autoreconf: Leaving directory '.'
Downloading config.guess and config.sub...
Done.

Warnings related to headers being present but not usable are due to functions
that didn't exist in the specified minimum API version level.
They can be safely ignored.

Building for platform [android-16]

---------------------------------->1
MakeToolChain: [/Users/xcj/Documents/sdk/ndk/21.1.6352462/build/tools/make_standalone_toolchain.py]

NdkPlatformCompat: [android-16]

Path: [/usr/local/bin:/usr/local/sbin:/Users/xcj/.sdkman/candidates/gradle/current/bin:/opt/local/bin:/opt/local/sbin:/Users/xcj/.nvm/versions/node/v4.2.1/bin:/Users/xcj/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/xcj/Documents/sdk/platform-tools:/Users/xcj/Documents/sdk/tools:/Users/xcj/Documents/devs/flutter/bin:/Users/xcj/Arcanist/arcanist/bin:/Users/xcj/Documents/devs/gradle/gradle-5.6.4/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin/python3:/usr/local/opt/libtool/libexec/gnubin:/Users/xcj/Documents/code/git/security/AESJniEncrypt/temp/libsodium/android-toolchain-armv7-a/bin]

ToolChainDir: [/Users/xcj/Documents/code/git/security/AESJniEncrypt/temp/libsodium/android-toolchain-armv7-a]
---------------------------------->1

env: python: No such file or directory
build-libsodium: built armv7-a!

如何生成新key

您的c代码里写死了处理后的key,那我如果想要用自己的key,那我如何获取到处理后的key

压测中文加密解密

奔溃信息:A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 5529 (JVMTI Agent thr), pid 5368
压测方式:
private void test() {
for (int i = 0; i < 1000000; i++) {
long start = SystemClock.currentThreadTimeMillis();
String initstr = edit.getText().toString();
String one = strings[random.nextInt(10)];
String two = strings[random.nextInt(10)];
initstr = initstr.concat(one).concat(two);
String encode = AESEncrypt.encode(SecondActivity.this, initstr);
String decode = AESEncrypt.decode(SecondActivity.this, encode);
if (!initstr.equals(decode)) {
// YLog.e(TAG, "解密出錯:initstr:" + initstr + "----decode:" + decode);
Log.e(TAG, "解密出錯:initstr:" + initstr + "----decode:" + decode);
}
long end = SystemClock.currentThreadTimeMillis();
Log.e(TAG, "initstr:" + initstr + "----encode:" + encode+ "----decode:" + decode+"---耗时:" + (end - start));
// Log.e(TAG, "initstr:" + initstr + "----encode:" + encode+ "---耗时:" + (end - start));
}

使用中文字符串压测,奔溃必现

NDK_PROJECT_PATH=null 这个错误?

Error while executing process /Users/fan/Library/Android/sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/fan/Documents/workspace1/AESJniEncrypt-master/aesjni/src/main/jni/Android.mk NDK_APPLICATION_MK=/Users/fan/Documents/workspace1/AESJniEncrypt-master/aesjni/src/main/jni/Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-15 NDK_OUT=/Users/fan/Documents/workspace1/AESJniEncrypt-master/aesjni/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/Users/fan/Documents/workspace1/AESJniEncrypt-master/aesjni/build/intermediates/ndkBuild/debug/lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}

如何动态添加秘钥

这个方案看起来是固定秘钥的用法,如果我使用动态秘钥有没有好的解决方案呢

python android aes

i use your aes jni in android project;
but i meet a problem;
android send the encrypt message to python server
but my python server can not decrypt the encrypt message ,
this is my python aes_utils
`class AESUtil:
__BLOCK_SIZE_16 = BLOCK_SIZE_16 = AES.block_size

@staticmethod
def encrypt(str, key):
    cipher = AES.new(key, AES.MODE_ECB)
    x = AESUtil.__BLOCK_SIZE_16 - (len(str) % AESUtil.__BLOCK_SIZE_16)
    if x != 0:
        str = str + chr(x) * x
    msg = cipher.encrypt(str)
    msg = base64.urlsafe_b64encode(msg).replace('=', '')
    return msg

@staticmethod
def decrypt(enStr, key):
    print ("---------->22")
    cipher = AES.new(key, AES.MODE_ECB)
    print ("---------->33  " + key)
    enStr += (len(enStr) % 4) * "="
    decryptByts = base64.urlsafe_b64decode(enStr)
    msg = cipher.decrypt(decryptByts)
    paddingLen = ord(msg[len(msg) - 1])
    return msg[0:-paddingLen]`

出现anr

06-05 17:37:43.161 29089-29094/com.androidyuan.aesjniencrypt I/art: Thread[2,tid=29094,WaitingInMainSignalCatcherLoop,Thread*=0xaf650000,peer=0x12e5c0a0,"Signal Catcher"]: reacting to signal 3
06-05 17:37:48.205 29089-29094/com.androidyuan.aesjniencrypt W/libbacktrace: bool ThreadEntry::Wait(int): pthread_cond_timedwait for value 1 failed: Connection timed out
06-05 17:37:48.205 29089-29094/com.androidyuan.aesjniencrypt E/libbacktrace: bool BacktraceCurrent::UnwindThread(size_t): Timed out waiting for signal handler to get ucontext data.
06-05 17:37:48.359 29089-29094/com.androidyuan.aesjniencrypt I/art: Wrote stack traces to '/data/anr/traces.txt'

如何修改 Key

请问如何将 key 修改一下啊
`
char *getKey() {
int n = 0;
char s[23];//"NMTIzNDU2Nzg5MGFiY2RlZg";

s[n++] = 'N';
s[n++] = 'M';
s[n++] = 'T';
s[n++] = 'I';
s[n++] = 'z';
s[n++] = 'N';
s[n++] = 'D';
s[n++] = 'U';
s[n++] = '2';
s[n++] = 'N';
s[n++] = 'z';
s[n++] = 'g';
s[n++] = '5';
s[n++] = 'M';
s[n++] = 'G';
s[n++] = 'F';
s[n++] = 'i';
s[n++] = 'Y';
s[n++] = '2';
s[n++] = 'R';
s[n++] = 'l';
s[n++] = 'Z';
s[n++] = 'g';
char *encode_str = s + 1;
return b64_decode(encode_str, strlen(encode_str));

//初版hidekey的方案

}
`

我改动了 s 的值后,decode就是乱码了,我在项目中也没发现定义 base64 之前的 key 的地方。
不好意思 c 小白,肯请告知。

加密数据量变大后,解密偶发异常

加密字符个数>11072,偶发解密异常或解密的字符中出现码,.I��.P��K;bK����<�
�i�29[�]иv�T s�sǎĨ�|���G�
��'�0'��u�=/(�4������p�$���o.k��ˣ��o�$;�8n2����|ɲ�<��B�)�d��|�1C��7��߲���Sꋆ�V
��"
����x����� ��IO��6�B�j?�u,�?�^Gp��wiDh|lpm,�G�1�
�51)]

AES_128_ECB_PKCS5Padding_Decrypt bug修复

hi,几个月前我提供了一份关于加解密优化的代码。

最近我发现在解密的时候由于逻辑不严谨,会导致解密出来的数据出问题。

主要是有两处。

第一处是函数AES_128_ECB_PKCS5Padding_Decrypt

在计算base64 decode之后的输出长度时,采用的是估算。

const size_t inputLength= (strlen(in) / 4) * 3;

但是这个时候没有考虑到外部传入的base64字符串是否已经在尾部添加了“=”。

因为“=”是 base64 encode时候做的padding,如果此时用这个长度来计算就会变多,导致后续去除我们自己添加的padding的时候,就会出错。

因此,这个长度直接采用下面的函数获取真实长度

b64_decode_ex(in,strlen(in), &inputLength)

修正后的代码在下方

https://pastebin.com/yUdpwrvx

第二处是函数findPaddingIndex

这个函数是从数据尾部找到padding字符。之前是通过strlen来进行的

但是由于out这块数据是严格按照inputLength来大小分配的,所以导致最后不存在0结尾,会溢出。

而且这个函数的入参,也是定义的uint8_t*,类型上也不严谨。所以,对这个函数进行了修改。

修改参数为

int findPaddingIndex(uint8_t * out, int len);

len为out的真实大小,在有外层调用的时候传入。

实现代码

https://pastebin.com/8cf6FZ1z

项目构建错误能帮忙看下么

Build command failed.
Error while executing process E:\android\sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HE:\code\AESJniEncrypt-master\aesjni -BE:\code\AESJniEncrypt-master\aesjni.externalNativeBuild\cmake\release\armeabi -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi -DANDROID_NDK=E:\android\sdk\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=E:\code\AESJniEncrypt-master\aesjni\build\intermediates\cmake\release\obj\armeabi -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=E:\android\sdk\cmake\3.6.4111459\bin\ninja.exe -DCMAKE_TOOLCHAIN_FILE=E:\android\sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DANDROID_PLATFORM=android-15 -DCMAKE_CXX_FLAGS=-frtti -fexceptions}
(include) CMakeLists.txt
Open File
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

带有"\n"的json格式化之后解密不出来

{ "ret_result": { "ret_code": 10330, "ret_message": "类别Id为空" } }
服务端返回这种格式的json时,可以解密

{
"ret_result": {
"ret_code": 1,
"ret_message": "成功"
}
}
服务端返回这种格式的json时,解密不出来

Key是怎么处理的?

想问一下 大神 的原始key 1234567890abcdef 是如何处理成 NMTIzNDU2Nzg5MGFiY2RlZg . 如果我将现在项目中的 NMTIzNDU2Nzg5MGFiY2RlZg 改为其他的字符串 会报错,比如说直接改为1234567890abcdef

JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0x9f
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] string: '�]W�'
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] in call to NewStringUTF
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] from java.lang.String com.androidyuan.aesjni.AESEncrypt.decode(java.lang.Object, java.lang.String)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] "main" prio=5 tid=1 Runnable
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] | group="main" sCount=0 dsCount=0 obj=0x739a6df0 self=0xb76f56d0
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] | sysTid=28647 nice=-1 cgrp=top_visible sched=0/0 handle=0xb6f62b38
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] | state=R schedstat=( 725591984 30464304 253 ) utm=42 stm=30 core=4 HZ=100
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] | stack=0xbe21e000-0xbe220000 stackSize=8MB
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] | held mutexes= "mutator lock"(shared held)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] native: #00 pc 00371069 /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiPKcPNS_9ArtMethodEPv+160)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] native: #1 pc 003508c3 /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+150)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] native: #2 pc 0025a8ed /system/lib/libart.so (ZN3art9JavaVMExt8JniAbortEPKcS2+740)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] native: #3 pc 0025afc5 /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+64)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] native: #4 pc 000fda29 /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+32)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] native: #5 pc 00103713 /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95+8102)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] native: #6 pc 0010a67b /system/lib/libart.so (_ZN3art8CheckJNI12NewStringUTFEP7_JNIEnvPKc+386)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] native: #7 pc 000eb189 /system/lib/libart.so (art_quick_generic_jni_trampoline+40)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] native: #8 pc 000e6a91 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] native: #9 pc 00403623 /system/lib/libart.so (art_quick_invoke_static_stub+170)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] native: #10 pc 007fd864 [stack] (???)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at com.androidyuan.aesjni.AESEncrypt.decode(Native method)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at com.androidyuan.aesjniencrypt.MainActivity.onCreate(MainActivity.java:24)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at android.app.Activity.performCreate(Activity.java:6367)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2397)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2504)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at android.app.ActivityThread.access$900(ActivityThread.java:165)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at android.os.Handler.dispatchMessage(Handler.java:102)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at android.os.Looper.loop(Looper.java:150)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at android.app.ActivityThread.main(ActivityThread.java:5546)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at java.lang.reflect.Method.invoke!(Native method)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/java_vm_ext.cc:410]
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/runtime.cc:368] Runtime aborting...
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/art: art/runtime/runtime.cc:368]
09-24 15:47:25.941 28647-28647/com.androidyuan.aesjniencrypt A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 28647 (n.aesjniencrypt)

所以想问问 我们自己项目中的key 要如何处理

ndk-build出错

make: /Users/xxx/Library/Android/sdk/ndk-bundle/toolchains/ollvm-4.0/prebuilt/darwin-x86_64/bin/clang++: Command not found

报了这个错 不知为何会用到darwin-x86_64 并没有改过配置

能否请教一些编译项目时候遇到的问题?

我尝试使用gradle build命令编译您的项目,但是似乎遇到了一些麻烦QAQ

尝试自行解决了好久实在没有头绪,还希望作者能指点一下orz

这是执行gradle build以后给出的错误信息:

* What went wrong:
Execution failed for task ':aesjni:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process /home/saaaaalty/Android/Sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C /home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/.cxx/cmake/debug/armeabi-v7a JNIEncrypt}
  ninja: Entering directory `/home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/.cxx/cmake/debug/armeabi-v7a'
  
  ninja: error: '../../../../src/main/jni/sodium_include/libsodium-android-armv7-a/lib/libsodium.a', needed by '../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libJNIEncrypt.so', missing and no known rule to make it

不知道作者能否帮助我解决一下这个问题?

如果需要的话,这是在完整的信息:

> Configure project :aesjni
WARNING: Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.

> Configure project :app
WARNING: Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.
WARNING: The specified Android SDK Build Tools version (25.0.3) is ignored, as it is below the minimum supported version (29.0.2) for Android Gradle Plugin 4.1.2.
Android SDK Build Tools 29.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :aesjni:generateJsonModelDebug
/home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/CMakeLists.txt : C/C++ debug|armeabi-v7a : CMake Warning at /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android-legacy.toolchain.cmake:416 (message):
  An old version of CMake is being used that cannot automatically detect
  compiler attributes.  Compiler identification is being bypassed.  Some
  values may be wrong or missing.  Update to CMake 3.19 or newer to use
  CMake's built-in compiler identification.
Call Stack (most recent call first):
  /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake:55 (include)
  .cxx/cmake/debug/armeabi-v7a/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt

/home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/CMakeLists.txt : C/C++ debug|armeabi-v7a : CMake Warning at /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android-legacy.toolchain.cmake:416 (message):
  An old version of CMake is being used that cannot automatically detect
  compiler attributes.  Compiler identification is being bypassed.  Some
  values may be wrong or missing.  Update to CMake 3.19 or newer to use
  CMake's built-in compiler identification.
Call Stack (most recent call first):
  /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake:55 (include)
  .cxx/cmake/debug/armeabi-v7a/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt

/home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/CMakeLists.txt : C/C++ debug|arm64-v8a : CMake Warning at /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android-legacy.toolchain.cmake:416 (message):
  An old version of CMake is being used that cannot automatically detect
  compiler attributes.  Compiler identification is being bypassed.  Some
  values may be wrong or missing.  Update to CMake 3.19 or newer to use
  CMake's built-in compiler identification.
Call Stack (most recent call first):
  /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake:55 (include)
  .cxx/cmake/debug/arm64-v8a/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt

/home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/CMakeLists.txt : C/C++ debug|arm64-v8a : CMake Warning at /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android-legacy.toolchain.cmake:416 (message):
  An old version of CMake is being used that cannot automatically detect
  compiler attributes.  Compiler identification is being bypassed.  Some
  values may be wrong or missing.  Update to CMake 3.19 or newer to use
  CMake's built-in compiler identification.
Call Stack (most recent call first):
  /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake:55 (include)
  .cxx/cmake/debug/arm64-v8a/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt

/home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/CMakeLists.txt : C/C++ debug|x86 : CMake Warning at /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android-legacy.toolchain.cmake:416 (message):
  An old version of CMake is being used that cannot automatically detect
  compiler attributes.  Compiler identification is being bypassed.  Some
  values may be wrong or missing.  Update to CMake 3.19 or newer to use
  CMake's built-in compiler identification.
Call Stack (most recent call first):
  /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake:55 (include)
  .cxx/cmake/debug/x86/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt

/home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/CMakeLists.txt : C/C++ debug|x86 : CMake Warning at /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android-legacy.toolchain.cmake:416 (message):
  An old version of CMake is being used that cannot automatically detect
  compiler attributes.  Compiler identification is being bypassed.  Some
  values may be wrong or missing.  Update to CMake 3.19 or newer to use
  CMake's built-in compiler identification.
Call Stack (most recent call first):
  /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake:55 (include)
  .cxx/cmake/debug/x86/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt

/home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/CMakeLists.txt : C/C++ debug|x86_64 : CMake Warning at /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android-legacy.toolchain.cmake:416 (message):
  An old version of CMake is being used that cannot automatically detect
  compiler attributes.  Compiler identification is being bypassed.  Some
  values may be wrong or missing.  Update to CMake 3.19 or newer to use
  CMake's built-in compiler identification.
Call Stack (most recent call first):
  /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake:55 (include)
  .cxx/cmake/debug/x86_64/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt

/home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/CMakeLists.txt : C/C++ debug|x86_64 : CMake Warning at /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android-legacy.toolchain.cmake:416 (message):
  An old version of CMake is being used that cannot automatically detect
  compiler attributes.  Compiler identification is being bypassed.  Some
  values may be wrong or missing.  Update to CMake 3.19 or newer to use
  CMake's built-in compiler identification.
Call Stack (most recent call first):
  /home/saaaaalty/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake:55 (include)
  .cxx/cmake/debug/x86_64/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt


> Task :aesjni:externalNativeBuildDebug FAILED
Build JNIEncrypt_armeabi-v7a
ninja: Entering directory `/home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/.cxx/cmake/debug/armeabi-v7a'
ninja: error: '../../../../src/main/jni/sodium_include/libsodium-android-armv7-a/lib/libsodium.a', needed by '../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libJNIEncrypt.so', missing and no known rule to make it

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':aesjni:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process /home/saaaaalty/Android/Sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C /home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/.cxx/cmake/debug/armeabi-v7a JNIEncrypt}
  ninja: Entering directory `/home/saaaaalty/Desktop/Dark/AESJniEncrypt/aesjni/.cxx/cmake/debug/armeabi-v7a'
  
  ninja: error: '../../../../src/main/jni/sodium_include/libsodium-android-armv7-a/lib/libsodium.a', needed by '../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libJNIEncrypt.so', missing and no known rule to make it


* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s

之前在运行编译前运行的shell脚本的时候,给出的部分警告信息如下:

Warnings related to headers being present but not usable are due to functions
that didn't exist in the specified minimum API version level.
They can be safely ignored.


Building for platform [android-16]

WARNING:__main__:make_standalone_toolchain.py is no longer necessary. The
$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin directory contains target-specific scripts that perform
the same task. For example, instead of:

    $ python $NDK/build/tools/make_standalone_toolchain.py \
        --arch arm --api 16 --install-dir toolchain
    $ toolchain/bin/clang++ src.cpp

Instead use:

    $ $NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi16-clang++ src.cpp

Traceback (most recent call last):
  File "/home/saaaaalty/Android/Sdk/ndk/23.1.7779620//build/tools/make_standalone_toolchain.py", line 377, in <module>
    main()
  File "/home/saaaaalty/Android/Sdk/ndk/23.1.7779620//build/tools/make_standalone_toolchain.py", line 361, in main
    create_toolchain(install_path, args.arch, api, toolchain_path, host_tag)
  File "/home/saaaaalty/Android/Sdk/ndk/23.1.7779620//build/tools/make_standalone_toolchain.py", line 224, in create_toolchain
    copy_tree(toolchain_path, install_path)
  File "/usr/lib/python2.7/distutils/dir_util.py", line 163, in copy_tree
    verbose=verbose, dry_run=dry_run))
  File "/usr/lib/python2.7/distutils/dir_util.py", line 163, in copy_tree
    verbose=verbose, dry_run=dry_run))
  File "/usr/lib/python2.7/distutils/dir_util.py", line 167, in copy_tree
    dry_run=dry_run)
  File "/usr/lib/python2.7/distutils/file_util.py", line 110, in copy_file
    "can't copy '%s': doesn't exist or not a regular file" % src)
distutils.errors.DistutilsFileError: can't copy '/home/saaaaalty/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android/bin/as': doesn't exist or not a regular file
build-libsodium: built armv6!

key相关

最后的key是如何处理的?

cmake

有没有可能改成最新的camke来编译呢

Android 10 调用会Crash.

Android 10 调用会Crash.

  • 因为对C++Crash不太熟悉,没啥好的解决办法.

堆栈如下

--logversion:utracea
Process Name: &#39;com.angel.league&#39;
Thread Name: &#39;RxCachedThreadS&#39;
pid: 1030, tid: 2968  &gt;&gt;&gt; com.angel.league &lt;&lt;&lt;
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
  r0 00000000  r1 00000b98  r2 00000006  r3 ba4df8a8
  r4 ba4df8bc  r5 ba4df8a0  r6 00000406  r7 0000016b
  r8 ba4df8b8  r9 ba4df8a8  10 ba4df8d8  fp ba4df8c8
  ip 00000b98  sp ba4df878  lr ed45c143  pc ed45c156  cpsr 000b0030
  d0  6566667500000000  d1  20646e6500000000
  d2  594c4945bd87778e  d3  312f3030bf000000
  d4  00000000bc2d8b60  d5  30006d8eeb1ecbc0
  d6  efe8dd4cb9a55c21  d7  eaeae04d1a430fa8
  d8  0000000000000000  d9  0000000000000000
  d10 0000000000000000  d11 0000000000000000
  d12 0000000000000000  d13 0000000000000000
  d14 0000000000000000  d15 0000000000000000
  d16 0000000000000000  d17 0000000000000000
  d18 006e006f0070006d  d19 00460074006e0065
  d20 0018310800183108  d21 0000000000000000
  d22 eae68b81eae68af1  d23 eae68651eae685f1
  d24 eae683b1eae68351  d25 eae68471eae68411
  d26 eae681d1eae68171  d27 eae68291eae68231
  d28 ebf377677405e182  d29 f011935f026dfe37
  d30 0000000000000028  d31 abf0ecfaa590e738
  scr 2800001b

    #00  pc 0002a156  /apex/com.android.runtime/lib/bionic/libc.so (abort)
    #00  pc 0002a156  /apex/com.android.runtime/lib/bionic/libc.so
    #01  pc 0002a143  /apex/com.android.runtime/lib/bionic/libc.so
    --- --- ---
[DEBUG] Read self maps instead! map: 0x0
    00 pc 0002a156  /apex/com.android.runtime/lib/bionic/libc.so (abort+165)
    01 pc 00045cf3  /apex/com.android.runtime/lib/bionic/libc.so (_ZL15__fortify_fatalPKcz+26)
    02 pc 000463fb  /apex/com.android.runtime/lib/bionic/libc.so (__strlen_chk+18)
    03 pc 00000ff3  /data/app/com.angel.league-kSNzosn0FERNGWVhbwYS8g==/lib/arm/libJNIEncrypt.so (getKey+58)
    04 pc 00001047  /data/app/com.angel.league-kSNzosn0FERNGWVhbwYS8g==/lib/arm/libJNIEncrypt.so (encode+30)
    05 pc 0000d519  /apex/com.android.runtime/lib/libart.so (art_quick_generic_jni_trampoline+40)
    06 pc 00008bc5  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub_internal+68)
    07 pc 0037160f  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_static_stub+246)
    08 pc 00011009  /apex/com.android.runtime/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+180)
    09 pc 0014263f  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_11ShadowFrameEtPNS_6JValueE+274)
    10 pc 0013e7a7  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+802)
    11 pc 00368ccb  /apex/com.android.runtime/lib/libart.so (MterpInvokeStatic+318)
    12 pc 00003994  /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_static+20)
    13 pc 00000046  00000046

阅读源码的时候发现了几个问题,提几个修改建议。

非常感谢作者的代码。
我在阅读和使用的过程中发现了三个问题,我自己是这样修改的,不知道对作者原先意图是否有误解。

  1. 内存泄露的问题
    在JNIEncrypt.c中,encode和decode函数在返回jsting之前没有将base64,以及getkey产生的内存产生的临时内存free掉。

  2. 加密填充
    这段代码是多余的
    if(inLength<16) { paddingInput=(uint8_t*)malloc(16); paddingInputLengt=16; int i; for (i = 0; i < 16; i++) { if (i < inLength) { paddingInput[i] = in[i]; } else { paddingInput[i] = HEX[16 - inLength]; } }
    在inLength < 16的时候
    size其实就是等于16的,所以这段逻辑和else里的是一样的,可以去除

  3. 解密去除填充
    在findPaddingIndex这个函数里。
    原来去除后缀的方式是从头往前查,而且是双重循环,感觉有点耗。
    既然在padding的时候,填充的是dif,所以不需要再判断'\n'之类的。
    直接取解密后的字符串最后一位即可。
    return (int)(strlen(str) - str[strlen(str) - 1]);
    当然了,我不知道是不是有特殊的例子存在。

解密中去除填充的算法有问题

image
这个算法有问题,这里应该是把后面填充的内容去掉吧,不足16填充几个几,这里忽略 0x0a,0A对应ascii码里的 \n ,这样的话,如果正好差 10 位不足 16,那就会填充 10 个 10 ,10 就是 0x0A,解密之后的原文后面会出现 10个 \n。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.