-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a340ab7
commit 20cf300
Showing
184 changed files
with
77,475 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ | |
.externalNativeBuild | ||
.cxx | ||
local.properties | ||
/path/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Sets the minimum version of CMake required to build your native library. | ||
# This ensures that a certain set of CMake features is available to | ||
# your build. | ||
|
||
cmake_minimum_required(VERSION 3.21.1) | ||
|
||
add_subdirectory(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.PHONY: all | ||
|
||
all: info | ||
|
||
branch := $(shell git rev-parse --abbrev-ref HEAD) | ||
commit := $(shell git rev-parse --short HEAD) | ||
|
||
info: | ||
@echo 'SHELL='$(SHELL) | ||
@echo 'branch='$(branch) | ||
@echo 'commit='$(commit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
/build | ||
/release | ||
/release | ||
/cmake_install.cmake | ||
/CMakeFiles/ | ||
/Makefile | ||
/src/main/cpp/native-lib.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# Sets the minimum version of CMake required to build your native library. | ||
# This ensures that a certain set of CMake features is available to | ||
# your build. | ||
cmake_minimum_required(VERSION 3.21.1) | ||
|
||
project(MyTV) | ||
|
||
# Specifies a path to native header files. | ||
include_directories(src/main/cpp/include) | ||
|
||
if (IS_SO_BUILD) | ||
# Specifies a library name, specifies whether the library is STATIC or | ||
# SHARED, and provides relative paths to the source code. You can | ||
# define multiple libraries by adding multiple add_library() commands, | ||
# and CMake builds them for you. When you build your app, Gradle | ||
# automatically packages shared libraries with your APK. | ||
add_library( # Specifies the name of the library. | ||
native-lib | ||
|
||
# Sets the library as a shared library. | ||
SHARED | ||
|
||
# Provides a relative path to your source file(s). | ||
src/main/cpp/native-lib.c) | ||
|
||
# 设置编译输出路径 | ||
set_target_properties( | ||
native-lib | ||
PROPERTIES | ||
LIBRARY_OUTPUT_DIRECTORY | ||
${CMAKE_SOURCE_DIR}/src/main/cpp/${ANDROID_ABI} | ||
) | ||
else () | ||
add_library( | ||
nothing | ||
SHARED | ||
src/main/cpp/nothing.c) | ||
|
||
add_library(native-lib | ||
SHARED | ||
IMPORTED) | ||
|
||
set_target_properties( # Specifies the target library. | ||
native-lib | ||
|
||
# Specifies the parameter you want to define. | ||
PROPERTIES IMPORTED_LOCATION | ||
|
||
# Provides the path to the library you want to import. | ||
${CMAKE_SOURCE_DIR}/src/main/cpp/${ANDROID_ABI}/libnative-lib.so) | ||
endif () | ||
|
||
add_library(libssl | ||
SHARED | ||
IMPORTED) | ||
|
||
set_target_properties( # Specifies the target library. | ||
libssl | ||
|
||
# Specifies the parameter you want to define. | ||
PROPERTIES IMPORTED_LOCATION | ||
|
||
# Provides the path to the library you want to import. | ||
${CMAKE_SOURCE_DIR}/src/main/cpp/${ANDROID_ABI}/libssl.so) | ||
|
||
add_library(libcrypto | ||
SHARED | ||
IMPORTED) | ||
|
||
set_target_properties( # Specifies the target library. | ||
libcrypto | ||
|
||
# Specifies the parameter you want to define. | ||
PROPERTIES IMPORTED_LOCATION | ||
|
||
# Provides the path to the library you want to import. | ||
${CMAKE_SOURCE_DIR}/src/main/cpp/${ANDROID_ABI}/libcrypto.so) | ||
|
||
find_library( # Defines the name of the path variable that stores the | ||
# location of the NDK library. | ||
log-lib | ||
|
||
# Specifies the name of the NDK library that | ||
# CMake needs to locate. | ||
log) | ||
|
||
if (IS_SO_BUILD) | ||
# Links your native library against one or more other native libraries. | ||
target_link_libraries( # Specifies the target library. | ||
native-lib | ||
libssl | ||
libcrypto | ||
|
||
# Links the log library to the target library. | ||
${log-lib}) | ||
else () | ||
target_link_libraries( # Specifies the target library. | ||
nothing | ||
native-lib) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/* | ||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. You can obtain a copy | ||
* in the file LICENSE in the source distribution or at | ||
* https://www.openssl.org/source/license.html | ||
*/ | ||
|
||
#ifndef OPENSSL_AES_H | ||
# define OPENSSL_AES_H | ||
# pragma once | ||
|
||
# include <openssl/macros.h> | ||
# ifndef OPENSSL_NO_DEPRECATED_3_0 | ||
# define HEADER_AES_H | ||
# endif | ||
|
||
# include <openssl/opensslconf.h> | ||
|
||
# include <stddef.h> | ||
# ifdef __cplusplus | ||
extern "C" { | ||
# endif | ||
|
||
# define AES_BLOCK_SIZE 16 | ||
|
||
# ifndef OPENSSL_NO_DEPRECATED_3_0 | ||
|
||
# define AES_ENCRYPT 1 | ||
# define AES_DECRYPT 0 | ||
|
||
# define AES_MAXNR 14 | ||
|
||
|
||
/* This should be a hidden type, but EVP requires that the size be known */ | ||
struct aes_key_st { | ||
# ifdef AES_LONG | ||
unsigned long rd_key[4 * (AES_MAXNR + 1)]; | ||
# else | ||
unsigned int rd_key[4 * (AES_MAXNR + 1)]; | ||
# endif | ||
int rounds; | ||
}; | ||
typedef struct aes_key_st AES_KEY; | ||
|
||
# endif | ||
# ifndef OPENSSL_NO_DEPRECATED_3_0 | ||
OSSL_DEPRECATEDIN_3_0 const char *AES_options(void); | ||
OSSL_DEPRECATEDIN_3_0 | ||
int AES_set_encrypt_key(const unsigned char *userKey, const int bits, | ||
AES_KEY *key); | ||
OSSL_DEPRECATEDIN_3_0 | ||
int AES_set_decrypt_key(const unsigned char *userKey, const int bits, | ||
AES_KEY *key); | ||
OSSL_DEPRECATEDIN_3_0 | ||
void AES_encrypt(const unsigned char *in, unsigned char *out, | ||
const AES_KEY *key); | ||
OSSL_DEPRECATEDIN_3_0 | ||
void AES_decrypt(const unsigned char *in, unsigned char *out, | ||
const AES_KEY *key); | ||
OSSL_DEPRECATEDIN_3_0 | ||
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, | ||
const AES_KEY *key, const int enc); | ||
OSSL_DEPRECATEDIN_3_0 | ||
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, const int enc); | ||
OSSL_DEPRECATEDIN_3_0 | ||
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, int *num, const int enc); | ||
OSSL_DEPRECATEDIN_3_0 | ||
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, int *num, const int enc); | ||
OSSL_DEPRECATEDIN_3_0 | ||
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, int *num, const int enc); | ||
OSSL_DEPRECATEDIN_3_0 | ||
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, int *num); | ||
|
||
/* NB: the IV is _two_ blocks long */ | ||
OSSL_DEPRECATEDIN_3_0 | ||
void AES_ige_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, const int enc); | ||
/* NB: the IV is _four_ blocks long */ | ||
OSSL_DEPRECATEDIN_3_0 | ||
void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, const AES_KEY *key2, | ||
const unsigned char *ivec, const int enc); | ||
OSSL_DEPRECATEDIN_3_0 | ||
int AES_wrap_key(AES_KEY *key, const unsigned char *iv, | ||
unsigned char *out, const unsigned char *in, | ||
unsigned int inlen); | ||
OSSL_DEPRECATEDIN_3_0 | ||
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, | ||
unsigned char *out, const unsigned char *in, | ||
unsigned int inlen); | ||
# endif | ||
|
||
|
||
# ifdef __cplusplus | ||
} | ||
# endif | ||
|
||
#endif |
Oops, something went wrong.