chore: 整理文档目录并清理冗余 JNI 与布局文件
This commit is contained in:
1 parent
e95490b5ce
commit
dfd43a167b
14 files changed
+49
-89
No files matched your search
@@ -395,7 +395,7 @@
|
||||
|
||||
<meta-data
|
||||
android:name="com.baidu.lbsapi.API_KEY"
|
||||
android:value="${BAIDU_LBS_API_KEY}" />
|
||||
android:value="CjFhFE1UP5G14tMBz1kWs7ca92bgHuLr" />
|
||||
|
||||
<!-- 请填写你自己的- appKey -->
|
||||
<meta-data
|
||||
|
||||
@@ -193,6 +193,11 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
// startActivity(new Intent(Settings.ACTION_SECURITY_SETTINGS));
|
||||
JgyUtils.getInstance().getAllRunningAppProcessInfo();
|
||||
JgyUtils.getInstance().getAllRunningServices();
|
||||
try {
|
||||
Log.e(TAG, "initView jni: " + JgyUtils.getJniInfo());
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "initView: jni Exception: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
String defaultDesktop = mMMKV.decodeString(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME, "");
|
||||
|
||||
@@ -388,8 +388,13 @@ public class MapManager {
|
||||
mMMKV.encode("MapError", "无法获取有效定位依据导致定位失败,一般是由于手机的原因,处于飞行模式下一般会造成这种结果,可以试着重启手机");
|
||||
break;
|
||||
case BDLocation.TypeServerDecryptError:
|
||||
Log.e(TAG, "onReceiveLocation: 服务端解密错误(162),通常是 AK 校验失败/包名或 SHA1 与 AK 不匹配");
|
||||
mMMKV.encode("MapError", "服务端解密错误,请检查 AK 与该包名、签名的绑定关系");
|
||||
Log.e(TAG, "onReceiveLocation: 请求串密文解析失败(162),通常是 liblocSDK8b.so 加载或打包异常");
|
||||
mMMKV.encode("MapError", "定位失败(162):liblocSDK8b.so 加载异常,请检查 SO 是否缺失、被 strip 或被改动");
|
||||
break;
|
||||
case 502:
|
||||
case BDLocation.TypeServerCheckKeyError:
|
||||
Log.e(TAG, "onReceiveLocation: AK 校验失败(" + location.getLocType() + ")");
|
||||
mMMKV.encode("MapError", "AK 校验失败(" + location.getLocType() + "),请检查 AK 与包名、签名 SHA1 的绑定关系");
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ public class JgyUtils {
|
||||
private CacheHelper cacheHelper;
|
||||
|
||||
static {
|
||||
System.loadLibrary("jgy");
|
||||
System.loadLibrary("aoleyun");
|
||||
}
|
||||
|
||||
private JgyUtils(Context context) {
|
||||
@@ -271,7 +271,7 @@ public class JgyUtils {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public static native String getAuthorization();
|
||||
public static native String getJniInfo();
|
||||
|
||||
private static final String EBAIFEN_PACKAGE = "com.kte.interfacesettings";
|
||||
private static final String EBAIFEN_CLASS_NAME = "com.kte.interfacesettings.ToolsImplService";
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#include <jni.h>
|
||||
#include <string>
|
||||
#include <sys/system_properties.h>
|
||||
// 日志打印
|
||||
#include <android/log.h>
|
||||
|
||||
#define LOG_TAG "TAG_LOG"
|
||||
#define LOGI(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_aoleyun_sn_utils_JgyUtils_getJniInfo(JNIEnv *env, jclass clazz) {
|
||||
std::string info = "form cpp";
|
||||
return env->NewStringUTF(info.c_str());
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
#include <jni.h>
|
||||
#include <string>
|
||||
#include <sys/system_properties.h>
|
||||
// 日志打印
|
||||
#include <android/log.h>
|
||||
|
||||
#define LOG_TAG "TAG_LOG"
|
||||
#define LOGI(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_aoleyun_sn_utils_JgyUtils_getAuthorization(JNIEnv *env, jclass clazz) {
|
||||
// TODO: implement getAuthorization()
|
||||
std::string hello;
|
||||
|
||||
// 1. 获取 SDK 版本号 , 存储于 C 字符串 sdk_verison_str 中
|
||||
char sdk[128] = "0";
|
||||
|
||||
// 获取版本号方法
|
||||
__system_property_get("ro.build.version.sdk", sdk);
|
||||
//将版本号转为 int 值
|
||||
int sdk_verison = atoi(sdk);
|
||||
jclass cls = env->FindClass("com/aoleyun/sn/BuildConfig");
|
||||
jfieldID jfieldId_text = env->GetStaticFieldID(cls, "FLAVOR", "Ljava/lang/String;");
|
||||
jstring text = (jstring) env->GetStaticObjectField(cls, jfieldId_text);
|
||||
const char *char_name = env->GetStringUTFChars(text, JNI_FALSE);
|
||||
std::string s = char_name;
|
||||
if (s.compare("newly") == 0) {
|
||||
LOGI("newly");
|
||||
hello = "Basic NzljNjRlZjQxYjg3MjhhZDZhYTI5YWY6YWJjNjQ3NzRiYjc2YzMyZDVkZTg0Yzk3==";
|
||||
} else if (s.compare("MTKnewly") == 0) {
|
||||
LOGI("MTKnewly");
|
||||
hello = "Basic NzljNjRlZjQxYjg3MjhhZDZhYTI5YWY6YWJjNjQ3NzRiYjc2YzMyZDVkZTg0Yzk3==";
|
||||
} else if (s.compare("beta") == 0) {
|
||||
LOGI("beta");
|
||||
hello = "Basic NTJkODE2NDM2NjViYjJjYWRhY2YwZTllOmI5N2RkZTYwNjdhY2ZhMjY5MDlhZjQ1Nw==";
|
||||
}
|
||||
// LOGI("%s", char_name);
|
||||
// LOGI("dasdasd");
|
||||
// LOGI("%s", hello.c_str());
|
||||
return env->NewStringUTF(hello.c_str());
|
||||
}
|
||||
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_aoleyun_sn_activity_main_MainAPresenter_getAeskey(JNIEnv *env, jobject thiz) {
|
||||
std::string key = "0123456789ABCDEF";
|
||||
return env->NewStringUTF(key.c_str());
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.aoleyun.sn.activity.MainActivity1">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_show"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
Reference in new issue
Block a user