Compare commits
19 Commits
bce11daee7
...
d7cc7beb58
| Author | SHA1 | Date |
|---|---|---|
|
|
d7cc7beb58 | |
|
|
df5a05f48c | |
|
|
425876339d | |
|
|
cfbca44456 | |
|
|
2363429491 | |
|
|
d3e4cc343e | |
|
|
a56e528421 | |
|
|
2cc080b12c | |
|
|
1cb45c2067 | |
|
|
cdecb938a1 | |
|
|
70c28847cc | |
|
|
b63e99b857 | |
|
|
4bd88021a2 | |
|
|
dc51082cd4 | |
|
|
f161762d92 | |
|
|
b4ce52bbdc | |
|
|
fb8f5cc077 | |
|
|
308f7246ed | |
|
|
204fe9e8ac |
|
|
@ -1,113 +1,5 @@
|
|||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.idea
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
|
||||
# Built application files
|
||||
*.apk
|
||||
*.ap_
|
||||
*.aab
|
||||
|
||||
# Files for the Dalvik VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Generated files
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
release/
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/
|
||||
.idea_modules/
|
||||
|
||||
# Keystore files
|
||||
*.jks
|
||||
*.keystore
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
google-services.json
|
||||
|
||||
# Freeline
|
||||
freeline.py
|
||||
freeline/
|
||||
freeline_project_description.json
|
||||
|
||||
# fastlane
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots
|
||||
fastlane/test_output
|
||||
fastlane/readme.md
|
||||
|
||||
# Version control
|
||||
vcs.xml
|
||||
|
||||
# lint
|
||||
lint/intermediates/
|
||||
lint/generated/
|
||||
lint/outputs/
|
||||
lint/tmp/
|
||||
lint/reports/
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
# .idea/modules.xml
|
||||
# .idea/*.iml
|
||||
# .idea/modules
|
||||
# *.iml
|
||||
# *.ipr
|
||||
|
||||
# CMake
|
||||
cmake-build-debug/
|
||||
|
||||
# Local config
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/gradle.xml
|
||||
.idea/assetWizardSettings.xml
|
||||
.idea/dictionaries
|
||||
.idea/libraries
|
||||
.idea/caches
|
||||
|
||||
# Android Patch
|
||||
gen-external-apklibs
|
||||
app/debug/app-debug.apk
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ dependencies {
|
|||
compileOnly 'org.projectlombok:lombok:1.18.28'
|
||||
// https://mvnrepository.com/artifact/com.google.code.gson/gson
|
||||
implementation 'com.google.code.gson:gson:2.10'
|
||||
// https://mvnrepository.com/artifact/com.jakewharton.timber/timber
|
||||
implementation 'com.jakewharton.timber:timber:5.0.1'
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'com.google.android.material:material:1.3.0'
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 28 KiB |
|
|
@ -0,0 +1,46 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<group android:scaleX="0.063738704"
|
||||
android:scaleY="0.063738704"
|
||||
android:translateX="21.063614"
|
||||
android:translateY="21.365784">
|
||||
<path
|
||||
android:pathData="M323.2,259.9C323.2,259.9 439.6,348.2 616.7,183C773.9,36.3 902.3,267.8 903.2,378.7C904.3,522.3 745.9,637.2 822.8,731.5C899.7,825.9 670.4,981.6 546.8,846.8C393.1,679.1 351.4,815.4 263.8,815.4C200.9,815.4 71.8,659.1 159,542.9C232.4,445 192.3,412.6 173,378.7C145,329.8 211.4,197 323.2,259.9Z"
|
||||
android:fillColor="#f0fffd"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M842.5,199.6C842.5,201.8 842.4,203.9 842.2,206.1C840.5,225.2 831.4,243 816.8,255.5C802.2,268 783.2,274.3 764,273C744.8,271.8 726.9,263 714.1,248.7C701.2,234.4 694.5,215.6 695.4,196.4C696.2,177.1 704.6,159 718.6,145.9C732.7,132.7 751.3,125.6 770.5,126C789.8,126.5 808.1,134.4 821.5,148.2C835,161.9 842.5,180.4 842.5,199.6L842.5,199.6Z"
|
||||
android:fillColor="#8ad1c8"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M778.2,205.3C773.4,209 766.8,216.3 768.8,232.7C766.6,239 758.7,251.2 758.7,257C758.7,262.8 749.2,263.8 748.1,262.3C747,260.7 746.5,240.6 740.7,236.9C734.9,233.2 736,216.4 736,216.4C736,216.4 738.1,210 731.2,205.8C724.4,201.6 719.6,191.6 725.7,185.8C731.8,179.9 715.4,176.3 713.3,172C712.4,170.2 709,166.2 705.3,162.2C713.2,148.9 725.1,138.3 739.3,132.1C744.7,137.7 749.4,144.9 748.1,152.5C748.3,156.2 764.3,162 756.5,169.9C748.6,177.8 738,188.9 756.5,192.6C775,196.3 782.9,201.6 778.2,205.3Z"
|
||||
android:fillColor="#0d6e61"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M820.3,147C816.4,155.3 806.5,162 800.9,162C794.5,155.1 780.8,164.6 779.5,153.6C778.8,147.1 786.2,137.1 792.4,129.8C802.9,133.4 812.4,139.2 820.3,147Z"
|
||||
android:fillColor="#0d6e61"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M842.2,206.1C840.6,224.3 832.3,241.3 818.9,253.7C816.4,251.3 814.4,248.6 815.1,246.4C816.7,241.7 823.1,231.6 822,225.3C821,219.4 826.5,201.5 842.2,206.1Z"
|
||||
android:fillColor="#0d6e61"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M722.4,571.8C720,586.3 716.1,600.6 710.8,614.3C675.7,704.1 581.7,760.3 482.8,744.1C428.1,735.2 379.3,704.9 347,660C314.7,615.1 301.5,559.1 310.4,504.5C310.9,501.8 311.4,499 312,496.2C334.3,387 439.1,314.1 550.1,332.2C583.2,337.5 614.5,350.9 641.4,371C650.2,377.5 658.5,384.8 666.1,392.8C688.8,416.1 705.8,444.5 715.5,475.6C725.3,506.7 727.7,539.6 722.4,571.8L722.4,571.8Z"
|
||||
android:fillColor="#3da193"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M710.8,614.3C671,639.9 624.1,663.5 572.3,683.1C519.6,703 467.9,716.5 420.5,723.5C309,740.2 221.5,721.6 201.8,669.4C183.3,620.7 228.8,554.7 312,496.2C311.4,499 310.9,501.8 310.4,504.5C308.8,514.7 307.9,524.9 307.7,535.2C259.8,572.2 234.9,608.5 244.7,634.5C254.3,659.8 294.9,670.5 352.6,667.5C409.1,664.5 481.9,648.2 558.2,619.4C624.2,594.4 682,564.1 725.1,533.6C782.7,492.8 814,451.8 803.2,423.2C792.1,393.8 739.2,384 666.1,392.8C658.5,384.8 650.2,377.6 641.4,371C743.6,359.1 822.4,378.5 841,427.6C860.9,480.1 806.6,552.7 710.8,614.3Z"
|
||||
android:fillColor="#0d6e61"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
</group>
|
||||
</vector>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#3F9C8F</color>
|
||||
</resources>
|
||||
|
|
@ -19,12 +19,14 @@
|
|||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
|
||||
<application
|
||||
android:name=".EchoLink"
|
||||
android:allowBackup="true"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.EchoLink"
|
||||
tools:targetApi="29">
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 28 KiB |
|
|
@ -0,0 +1,17 @@
|
|||
package com.nbee.echolink;
|
||||
|
||||
import android.app.Application;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class EchoLink extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
// 植入 Timber
|
||||
Timber.plant(new FileLoggingTree(this));
|
||||
|
||||
// 打印日志文件的路径
|
||||
Timber.d("Log file path: " + this.getFilesDir() + "/logs/echoLink.log");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.nbee.echolink;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import timber.log.Timber;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class FileLoggingTree extends Timber.DebugTree {
|
||||
private final File logFile;
|
||||
|
||||
public FileLoggingTree(Context context) {
|
||||
File logDirectory = new File(context.getFilesDir(), "logs");
|
||||
if (!logDirectory.exists()) {
|
||||
logDirectory.mkdirs();
|
||||
}
|
||||
this.logFile = new File(logDirectory, "echoLink.log");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void log(int priority, String tag, String message, Throwable t) {
|
||||
super.log(priority, tag, message, t);
|
||||
|
||||
try (FileWriter fileWriter = new FileWriter(logFile, true)) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
||||
String timestamp = dateFormat.format(new Date());
|
||||
String logMessage = timestamp + " [" + priorityToString(priority) + "] " + tag + ": " + message + "\n";
|
||||
fileWriter.append(logMessage);
|
||||
|
||||
if (t != null) {
|
||||
fileWriter.append(Log.getStackTraceString(t)).append("\n");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Log.e("FileLoggingTree", "Error writing log to file", e);
|
||||
}
|
||||
}
|
||||
|
||||
private String priorityToString(int priority) {
|
||||
switch (priority) {
|
||||
case Log.ERROR:
|
||||
return "ERROR";
|
||||
case Log.WARN:
|
||||
return "WARN";
|
||||
case Log.INFO:
|
||||
return "INFO";
|
||||
case Log.DEBUG:
|
||||
return "DEBUG";
|
||||
case Log.VERBOSE:
|
||||
return "VERBOSE";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +1,79 @@
|
|||
package com.nbee.echolink;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
import android.telephony.PhoneStateListener;
|
||||
import android.telephony.TelephonyManager;
|
||||
import com.nbee.echolink.broadcast.PhoneCallReceiver;
|
||||
import com.nbee.echolink.broadcast.SMSReceiver;
|
||||
import com.nbee.echolink.service.MonitorService;
|
||||
import com.nbee.echolink.utils.PermissionUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
private final String TAG = "MainActivity";
|
||||
private PermissionUtils permissionUtils;
|
||||
private TextView logTextView; // 将类型从 View 更改为 TextView
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
logTextView = findViewById(R.id.logTextView);
|
||||
updateLog("初始化日志...");
|
||||
|
||||
|
||||
|
||||
permissionUtils = new PermissionUtils(this);
|
||||
permissionUtils.checkPermissions();
|
||||
|
||||
// 启动MonitorService服务
|
||||
Intent serviceIntent = new Intent(this, MonitorService.class);
|
||||
startService(serviceIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
permissionUtils.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
String logContent = readLogFile();
|
||||
updateLog(logContent);
|
||||
}
|
||||
|
||||
|
||||
private void updateLog(String newLog) {
|
||||
logTextView.setText(newLog);
|
||||
}
|
||||
|
||||
private String readLogFile() {
|
||||
try {
|
||||
File logFile = new File(getFilesDir(), "logs/echoLink.log"); // 日志文件的路径
|
||||
if (!logFile.exists()) {
|
||||
return "日志文件不存在";
|
||||
}
|
||||
StringBuilder logContent = new StringBuilder();
|
||||
try (BufferedReader reader = new BufferedReader(new FileReader(logFile))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
logContent.append(line).append("\n");
|
||||
}
|
||||
}
|
||||
return logContent.toString();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return "读取日志文件时出错";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -20,29 +20,34 @@ import com.nbee.echolink.utils.NetworkUtil;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
public class MonitorService extends Service {
|
||||
private NetworkUtil networkUtil;
|
||||
private static final String TAG = "MonitorService";
|
||||
private String lastPhoneNumber = null;
|
||||
private long lastCallTime = 0;
|
||||
private int count;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Timber.d("MonitorService onCreate");
|
||||
startForegroundService();
|
||||
networkUtil = new NetworkUtil(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
Timber.d("MonitorService onStartCommand");
|
||||
if (intent != null) {
|
||||
if (intent.hasExtra("incomingNumber")) {
|
||||
String incomingNumber = intent.getStringExtra("incomingNumber");
|
||||
Log.i(TAG, "获取到来电信息,号码: "+ incomingNumber);
|
||||
Timber.d("获取到来电信息,号码: "+ incomingNumber);
|
||||
sendCallInfoToServer(incomingNumber);
|
||||
} else if (intent.hasExtra("sender") && intent.hasExtra("messageBody")) {
|
||||
String sender = intent.getStringExtra("sender");
|
||||
String messageBody = intent.getStringExtra("messageBody");
|
||||
Log.i(TAG, "获取到短信信息,号码: "+ sender);
|
||||
Timber.d("获取到短信信息,号码: "+ sender);
|
||||
sendSmsInfoToServer(sender, messageBody);
|
||||
}
|
||||
}
|
||||
|
|
@ -50,6 +55,7 @@ public class MonitorService extends Service {
|
|||
}
|
||||
|
||||
private void sendCallInfoToServer(String incomingNumber) {
|
||||
Timber.d("sendCallInfoToServer: 处理来电信息");
|
||||
if (incomingNumber.equals("null") || incomingNumber == null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -57,7 +63,7 @@ public class MonitorService extends Service {
|
|||
long currentTimeMillis = System.currentTimeMillis();
|
||||
if (incomingNumber.equals(lastPhoneNumber) && (currentTimeMillis - lastCallTime) < 70000) {
|
||||
// 如果电话号码与上次相同,且在70秒之内,则不执行请求
|
||||
Log.i(TAG, "sendCallInfoToServer: 电话号码与上次相同,且在70秒之内,不执行请求.");
|
||||
Timber.d("sendCallInfoToServer: 电话号码与上次相同,且在70秒之内,不执行请求.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -73,6 +79,7 @@ public class MonitorService extends Service {
|
|||
}
|
||||
|
||||
private void sendSmsInfoToServer(String sender,String messageBody){
|
||||
Timber.d("sendSmsInfoToServer: 处理短信信息");
|
||||
if (checkNullString(sender,messageBody)){
|
||||
return;
|
||||
}
|
||||
|
|
@ -95,6 +102,7 @@ public class MonitorService extends Service {
|
|||
}
|
||||
|
||||
private void startForegroundService() {
|
||||
Timber.d("startForegroundService: 启动前台服务");
|
||||
// 创建通知频道(仅在API 26及以上版本中需要)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationChannel channel = new NotificationChannel("channel_id", "Channel Name", NotificationManager.IMPORTANCE_DEFAULT);
|
||||
|
|
@ -104,8 +112,7 @@ public class MonitorService extends Service {
|
|||
|
||||
// 创建通知
|
||||
Notification notification = new NotificationCompat.Builder(this, "channel_id")
|
||||
.setContentTitle("服务运行中")
|
||||
.setContentText("EchoLink正在运行")
|
||||
.setContentTitle(getString(R.string.notification_title))
|
||||
.setSmallIcon(R.drawable.ic_notification) // 确保您有这个图标
|
||||
.build();
|
||||
|
||||
|
|
@ -116,6 +123,7 @@ public class MonitorService extends Service {
|
|||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
Timber.d("MonitorService onBind");
|
||||
return null; // 不提供绑定服务的接口
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
package com.nbee.echolink.utils;
|
||||
|
||||
import static android.content.Context.POWER_SERVICE;
|
||||
import static androidx.core.content.ContextCompat.getSystemService;
|
||||
import static androidx.core.content.ContextCompat.startActivity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.PowerManager;
|
||||
import android.provider.Settings;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
public class BatteryOptimizationUtil {
|
||||
|
||||
/**
|
||||
* 检查应用是否在电池优化白名单中。
|
||||
*/
|
||||
public static boolean isAppIgnoringBatteryOptimizations(Context context) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
PowerManager pm = (PowerManager) context.getSystemService(POWER_SERVICE);
|
||||
if (pm != null) {
|
||||
return pm.isIgnoringBatteryOptimizations(context.getPackageName());
|
||||
}
|
||||
}
|
||||
return true; // 在低于Android 6.0的设备上,默认为true
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求将应用加入电池优化白名单。
|
||||
*/
|
||||
public static void requestIgnoreBatteryOptimization(Context context) {
|
||||
Timber.d("请求电池优化白名单");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
String packageName = context.getPackageName();
|
||||
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||
if (pm != null && !pm.isIgnoringBatteryOptimizations(packageName)) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||
intent.setData(Uri.parse("package:" + packageName));
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 添加FLAG_ACTIVITY_NEW_TASK标志
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
package com.nbee.echolink.utils;
|
||||
|
||||
|
||||
import java.util.Locale;
|
||||
import android.content.Context;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
|
||||
|
||||
public class DeviceInfoUtils {
|
||||
/**
|
||||
* 获取设备宽度(px)
|
||||
*
|
||||
*/
|
||||
public static int getDeviceWidth(Context context) {
|
||||
return context.getResources().getDisplayMetrics().widthPixels;
|
||||
}
|
||||
/**
|
||||
* 获取设备高度(px)
|
||||
*/
|
||||
public static int getDeviceHeight(Context context) {
|
||||
return context.getResources().getDisplayMetrics().heightPixels;
|
||||
}
|
||||
/**
|
||||
* 获取设备的唯一标识, 需要 “android.permission.READ_Phone_STATE”权限
|
||||
* Android 10 无法获取此权限
|
||||
*/
|
||||
// public static String getIMEI(Context context) {
|
||||
// TelephonyManager tm = (TelephonyManager) context
|
||||
// .getSystemService(Context.TELEPHONY_SERVICE);
|
||||
// String deviceId = tm.getDeviceId();
|
||||
// if (deviceId == null) {
|
||||
// return "UnKnown";
|
||||
// } else {
|
||||
// return deviceId;
|
||||
// }
|
||||
// }
|
||||
/**
|
||||
* 获取厂商名
|
||||
* **/
|
||||
public static String getDeviceManufacturer() {
|
||||
return android.os.Build.MANUFACTURER;
|
||||
}
|
||||
/**
|
||||
* 获取产品名
|
||||
* **/
|
||||
public static String getDeviceProduct() {
|
||||
return android.os.Build.PRODUCT;
|
||||
}
|
||||
/**
|
||||
* 获取手机品牌
|
||||
*/
|
||||
public static String getDeviceBrand() {
|
||||
return android.os.Build.BRAND;
|
||||
}
|
||||
/**
|
||||
* 获取手机型号
|
||||
*/
|
||||
public static String getDeviceModel() {
|
||||
return android.os.Build.MODEL;
|
||||
}
|
||||
/**
|
||||
* 获取手机主板名
|
||||
*/
|
||||
public static String getDeviceBoard() {
|
||||
return android.os.Build.BOARD;
|
||||
}
|
||||
/**
|
||||
* 设备名
|
||||
* **/
|
||||
public static String getDeviceDevice() {
|
||||
return android.os.Build.DEVICE;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
* fingerprit 信息
|
||||
* **/
|
||||
public static String getDeviceFubgerprint() {
|
||||
return android.os.Build.FINGERPRINT;
|
||||
}
|
||||
/**
|
||||
* 硬件名
|
||||
*
|
||||
* **/
|
||||
public static String getDeviceHardware() {
|
||||
return android.os.Build.HARDWARE;
|
||||
}
|
||||
/**
|
||||
* 主机
|
||||
*
|
||||
* **/
|
||||
public static String getDeviceHost() {
|
||||
return android.os.Build.HOST;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* 显示ID
|
||||
* **/
|
||||
public static String getDeviceDisplay() {
|
||||
return android.os.Build.DISPLAY;
|
||||
}
|
||||
/**
|
||||
* ID
|
||||
*
|
||||
* **/
|
||||
public static String getDeviceId() {
|
||||
return android.os.Build.ID;
|
||||
}
|
||||
/**
|
||||
* 获取手机用户名
|
||||
*
|
||||
* **/
|
||||
public static String getDeviceUser() {
|
||||
return android.os.Build.USER;
|
||||
}
|
||||
/**
|
||||
* 获取手机 硬件序列号
|
||||
* **/
|
||||
public static String getDeviceSerial() {
|
||||
return android.os.Build.SERIAL;
|
||||
}
|
||||
/**
|
||||
* 获取手机Android 系统SDK
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static int getDeviceSDK() {
|
||||
return android.os.Build.VERSION.SDK_INT;
|
||||
}
|
||||
/**
|
||||
* 获取手机Android 版本
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getDeviceAndroidVersion() {
|
||||
return android.os.Build.VERSION.RELEASE;
|
||||
}
|
||||
/**
|
||||
* 获取当前手机系统语言。
|
||||
*/
|
||||
public static String getDeviceDefaultLanguage() {
|
||||
return Locale.getDefault().getLanguage();
|
||||
}
|
||||
/**
|
||||
* 获取当前系统上的语言列表(Locale列表)
|
||||
*/
|
||||
public static String getDeviceSupportLanguage() {
|
||||
Log.e("wangjie", "Local:" + Locale.GERMAN);
|
||||
Log.e("wangjie", "Local:" + Locale.ENGLISH);
|
||||
Log.e("wangjie", "Local:" + Locale.US);
|
||||
Log.e("wangjie", "Local:" + Locale.CHINESE);
|
||||
Log.e("wangjie", "Local:" + Locale.TAIWAN);
|
||||
Log.e("wangjie", "Local:" + Locale.FRANCE);
|
||||
Log.e("wangjie", "Local:" + Locale.FRENCH);
|
||||
Log.e("wangjie", "Local:" + Locale.GERMANY);
|
||||
Log.e("wangjie", "Local:" + Locale.ITALIAN);
|
||||
Log.e("wangjie", "Local:" + Locale.JAPAN);
|
||||
Log.e("wangjie", "Local:" + Locale.JAPANESE);
|
||||
return Locale.getAvailableLocales().toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,7 @@ import okhttp3.MediaType;
|
|||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.RequestBody;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class NetworkUtil {
|
||||
private final String TAG = "NetworkUtil";
|
||||
|
|
@ -45,14 +46,17 @@ public class NetworkUtil {
|
|||
OkHttpClient client = new OkHttpClient();
|
||||
// ... 构建请求 ...
|
||||
Request request = buildRequest(dataObject,apiUrl);
|
||||
Timber.d("Sending request to " + apiUrl + " (Retry count: " + retryCount + ")");
|
||||
|
||||
client.newCall(request).enqueue(new okhttp3.Callback() {
|
||||
@Override
|
||||
public void onFailure(okhttp3.Call call, IOException e) {
|
||||
Timber.d("Request to " + apiUrl + " failed on attempt " + retryCount+ e);
|
||||
if (retryCount < MAX_RETRIES) {
|
||||
handler.postDelayed(() -> postRequestWithRetry(dataObject, retryCount + 1,apiUrl), RETRY_DELAY_MS);
|
||||
} else {
|
||||
Log.e(TAG, "onFailure: Failed after " + MAX_RETRIES + " attempts", e);
|
||||
Timber.e("onFailure: Failed after " + MAX_RETRIES + " attempts" + e);
|
||||
// 超出重试次数,处理失败情况
|
||||
}
|
||||
}
|
||||
|
|
@ -60,14 +64,14 @@ public class NetworkUtil {
|
|||
public void onResponse(okhttp3.Call call, okhttp3.Response response) throws IOException {
|
||||
if (!response.isSuccessful()) {
|
||||
// 在这里处理响应错误
|
||||
Log.d("onResponse", response.message());
|
||||
Timber.d("Request to " + apiUrl + " returned error: " + response.code() + ", " + response.message());
|
||||
throw new IOException("Unexpected code " + response);
|
||||
}
|
||||
// ... 处理响应 ...
|
||||
Gson gson1 = new Gson();
|
||||
ApiResponse apiResponse = gson1.fromJson(response.body().string(), ApiResponse.class);
|
||||
if (apiResponse.getCode().equals(0)){
|
||||
Log.i(TAG, "onResponse ResponseCode: " + apiResponse.getCode() + "ResponseMessage" + apiResponse.getMsg());
|
||||
Timber.d("Received response from " + apiUrl + ": " + apiResponse.getCode() + " - " + apiResponse.getMsg());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -77,7 +81,7 @@ public class NetworkUtil {
|
|||
Gson gson = new Gson();
|
||||
// 将对象转换为JSON字符串
|
||||
String json = gson.toJson(dataObject);
|
||||
|
||||
Timber.d("Building request to " + apiUrl + " with data: " + json);
|
||||
// 创建请求体
|
||||
MediaType JSON = MediaType.get("application/json; charset=utf-8");
|
||||
RequestBody body = RequestBody.create(json, JSON);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,90 @@
|
|||
package com.nbee.echolink.utils;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
|
||||
public class PermissionUtils {
|
||||
private static final int PERMISSION_REQUEST_CODE = 1;
|
||||
private Activity activity;
|
||||
|
||||
public PermissionUtils(Activity activity) {
|
||||
this.activity = activity;
|
||||
}
|
||||
|
||||
public void checkPermissions() {
|
||||
String[] permissions = {
|
||||
Manifest.permission.READ_PHONE_STATE,
|
||||
Manifest.permission.SEND_SMS,
|
||||
Manifest.permission.READ_CALL_LOG,
|
||||
Manifest.permission.READ_CONTACTS,
|
||||
Manifest.permission.RECEIVE_SMS
|
||||
|
||||
};
|
||||
|
||||
if (!hasPermissions(permissions)) {
|
||||
Timber.d("请求以下权限:" + Arrays.toString(permissions));
|
||||
ActivityCompat.requestPermissions(activity, permissions, PERMISSION_REQUEST_CODE);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasPermissions(String... permissions) {
|
||||
for (String permission : permissions) {
|
||||
if (ContextCompat.checkSelfPermission(activity, permission) != PackageManager.PERMISSION_GRANTED) {
|
||||
Timber.d("缺少权限:" + permission);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||
if (requestCode == PERMISSION_REQUEST_CODE) {
|
||||
StringBuilder deniedPermissions = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < grantResults.length; i++) {
|
||||
if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {
|
||||
if (deniedPermissions.length() > 0) deniedPermissions.append(", ");
|
||||
deniedPermissions.append(permissions[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (deniedPermissions.length() > 0) {
|
||||
// 显示对话框
|
||||
Timber.d("权限被拒绝:" + deniedPermissions.toString());
|
||||
showAlert("以下权限被拒绝:\n" + deniedPermissions.toString());
|
||||
} else {
|
||||
// 所有请求的权限都被授予
|
||||
// 在这里处理所有权限被授予的情况
|
||||
Timber.d("已获取所有权限:" + Arrays.toString(permissions));
|
||||
showToast("已授予运行所需的权限");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void showAlert(String message) {
|
||||
new AlertDialog.Builder(activity)
|
||||
.setMessage(message)
|
||||
.setPositiveButton("确认", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
})
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
private void showToast(String message) {
|
||||
Toast.makeText(activity, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<group android:scaleX="0.063738704"
|
||||
android:scaleY="0.063738704"
|
||||
android:translateX="21.063614"
|
||||
android:translateY="21.365784">
|
||||
<path
|
||||
android:pathData="M323.2,259.9C323.2,259.9 439.6,348.2 616.7,183C773.9,36.3 902.3,267.8 903.2,378.7C904.3,522.3 745.9,637.2 822.8,731.5C899.7,825.9 670.4,981.6 546.8,846.8C393.1,679.1 351.4,815.4 263.8,815.4C200.9,815.4 71.8,659.1 159,542.9C232.4,445 192.3,412.6 173,378.7C145,329.8 211.4,197 323.2,259.9Z"
|
||||
android:fillColor="#f0fffd"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M842.5,199.6C842.5,201.8 842.4,203.9 842.2,206.1C840.5,225.2 831.4,243 816.8,255.5C802.2,268 783.2,274.3 764,273C744.8,271.8 726.9,263 714.1,248.7C701.2,234.4 694.5,215.6 695.4,196.4C696.2,177.1 704.6,159 718.6,145.9C732.7,132.7 751.3,125.6 770.5,126C789.8,126.5 808.1,134.4 821.5,148.2C835,161.9 842.5,180.4 842.5,199.6L842.5,199.6Z"
|
||||
android:fillColor="#8ad1c8"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M778.2,205.3C773.4,209 766.8,216.3 768.8,232.7C766.6,239 758.7,251.2 758.7,257C758.7,262.8 749.2,263.8 748.1,262.3C747,260.7 746.5,240.6 740.7,236.9C734.9,233.2 736,216.4 736,216.4C736,216.4 738.1,210 731.2,205.8C724.4,201.6 719.6,191.6 725.7,185.8C731.8,179.9 715.4,176.3 713.3,172C712.4,170.2 709,166.2 705.3,162.2C713.2,148.9 725.1,138.3 739.3,132.1C744.7,137.7 749.4,144.9 748.1,152.5C748.3,156.2 764.3,162 756.5,169.9C748.6,177.8 738,188.9 756.5,192.6C775,196.3 782.9,201.6 778.2,205.3Z"
|
||||
android:fillColor="#0d6e61"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M820.3,147C816.4,155.3 806.5,162 800.9,162C794.5,155.1 780.8,164.6 779.5,153.6C778.8,147.1 786.2,137.1 792.4,129.8C802.9,133.4 812.4,139.2 820.3,147Z"
|
||||
android:fillColor="#0d6e61"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M842.2,206.1C840.6,224.3 832.3,241.3 818.9,253.7C816.4,251.3 814.4,248.6 815.1,246.4C816.7,241.7 823.1,231.6 822,225.3C821,219.4 826.5,201.5 842.2,206.1Z"
|
||||
android:fillColor="#0d6e61"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M722.4,571.8C720,586.3 716.1,600.6 710.8,614.3C675.7,704.1 581.7,760.3 482.8,744.1C428.1,735.2 379.3,704.9 347,660C314.7,615.1 301.5,559.1 310.4,504.5C310.9,501.8 311.4,499 312,496.2C334.3,387 439.1,314.1 550.1,332.2C583.2,337.5 614.5,350.9 641.4,371C650.2,377.5 658.5,384.8 666.1,392.8C688.8,416.1 705.8,444.5 715.5,475.6C725.3,506.7 727.7,539.6 722.4,571.8L722.4,571.8Z"
|
||||
android:fillColor="#3da193"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M710.8,614.3C671,639.9 624.1,663.5 572.3,683.1C519.6,703 467.9,716.5 420.5,723.5C309,740.2 221.5,721.6 201.8,669.4C183.3,620.7 228.8,554.7 312,496.2C311.4,499 310.9,501.8 310.4,504.5C308.8,514.7 307.9,524.9 307.7,535.2C259.8,572.2 234.9,608.5 244.7,634.5C254.3,659.8 294.9,670.5 352.6,667.5C409.1,664.5 481.9,648.2 558.2,619.4C624.2,594.4 682,564.1 725.1,533.6C782.7,492.8 814,451.8 803.2,423.2C792.1,393.8 739.2,384 666.1,392.8C658.5,384.8 650.2,377.6 641.4,371C743.6,359.1 822.4,378.5 841,427.6C860.9,480.1 806.6,552.7 710.8,614.3Z"
|
||||
android:fillColor="#0d6e61"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
</group>
|
||||
</vector>
|
||||
|
|
@ -5,14 +5,32 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<!-- 用于显示日志标题的 TextView -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/logTitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Hello World!"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:text="日志"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<!-- ScrollView 包含一个 TextView 用于显示日志内容 -->
|
||||
<ScrollView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/logTitleTextView"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/logTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 982 B |
|
Before Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
|
@ -10,7 +10,7 @@
|
|||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<item name="android:statusBarColor">@color/grey</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
|
|
@ -7,4 +7,5 @@
|
|||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="grey">#808080</color>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#3F9C8F</color>
|
||||
</resources>
|
||||
|
|
@ -3,4 +3,7 @@
|
|||
<string name="call_api_url">https://api.kimgo.cn/api/call</string>
|
||||
<string name="message_api_url">https://api.kimgo.cn/api/sms</string>
|
||||
<string name="access_token">gKGCDSgWV82XbU0H</string>
|
||||
<string name="notification_title">监控服务运行中</string>
|
||||
<string name="notification_text">EchoLink正在运行</string>
|
||||
|
||||
</resources>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<!-- Base application theme. -->
|
||||
<style name="Theme.EchoLink" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimary">@color/teal_700</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<item name="android:statusBarColor">@color/grey</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||