wangsiyuan 2023-12-07 15:59:50 +08:00
parent bce11daee7
commit 204fe9e8ac
36 changed files with 357 additions and 47 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -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>

View File

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#3F9C8F</color>
</resources>

View File

@ -24,7 +24,7 @@
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">

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -3,26 +3,31 @@ package com.nbee.echolink;
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;
public class MainActivity extends AppCompatActivity {
private final String TAG = "MainActivity";
private PermissionUtils permissionUtils;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
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);
}
}

View File

@ -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();
}
}

View File

@ -0,0 +1,79 @@
package com.nbee.echolink.utils;
import android.Manifest;
import android.app.Activity;
import android.content.pm.PackageManager;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.widget.Toast;
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
};
if (!hasPermissions(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) {
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) {
// 显示对话框
showAlert("以下权限被拒绝:\n" + deniedPermissions.toString());
} else {
// 所有请求的权限都被授予
// 在这里处理所有权限被授予的情况
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();
}
}

View File

@ -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>

View File

@ -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"

View File

@ -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>

View File

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#3F9C8F</color>
</resources>