├── .gitignore
├── .idea
├── .gitignore
├── compiler.xml
├── gradle.xml
└── misc.xml
├── DataCapture
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── itaem
│ │ └── datacapture
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ └── java
│ │ └── com
│ │ └── itaem
│ │ └── datacapture
│ │ ├── Factory
│ │ ├── DataListFactory.java
│ │ └── Factory.java
│ │ ├── Utils
│ │ ├── AddressBookUtil.java
│ │ ├── AppListUtil.java
│ │ ├── AppUtil.java
│ │ ├── BatteryStatusUtil.java
│ │ ├── CalendarListUtil.java
│ │ ├── DataCaptureUtil.java
│ │ ├── DataUtil.java
│ │ ├── DeviceInfoUtil.java
│ │ ├── GeneralDataUtil.java
│ │ ├── HardwareUtil.java
│ │ ├── LocationUtils.java
│ │ ├── NetworkBeanUtils.java
│ │ ├── OtherDataUtil.java
│ │ ├── PhotoInfosUtil.java
│ │ ├── SDCardUtils.java
│ │ ├── SensorListUtil.java
│ │ ├── SmsUtil.java
│ │ └── bean.java
│ │ └── bean
│ │ ├── AddressBookBean.java
│ │ ├── AppListBean.java
│ │ ├── BatteryStatusBean.java
│ │ ├── CalendarListBean.java
│ │ ├── DeviceInfoBean.java
│ │ ├── GeneralDataBean.java
│ │ ├── HardwareBean.java
│ │ ├── NetworkBean.java
│ │ ├── NewStorageBean.java
│ │ ├── OtherDataBean.java
│ │ ├── PhotoInfosBean.java
│ │ ├── SensorListBean.java
│ │ ├── ShowListBean.java
│ │ └── SmsBean.java
│ └── test
│ └── java
│ └── com
│ └── itaem
│ └── datacapture
│ └── ExampleUnitTest.java
├── LICENSE
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── itaem
│ │ └── datacapture
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── itaem
│ │ │ └── datacapture
│ │ │ ├── Constant.java
│ │ │ ├── MainActivity.java
│ │ │ ├── beanShow
│ │ │ ├── BeanAdapter.java
│ │ │ └── DataBeanActivity.java
│ │ │ ├── dialog
│ │ │ └── AppBeanDialog.java
│ │ │ ├── listShow
│ │ │ ├── DataListAdapter.java
│ │ │ └── DataListShowActivity.java
│ │ │ └── utils
│ │ │ └── MarketUtils.java
│ └── res
│ │ ├── anim
│ │ └── anim_timestyle.xml
│ │ ├── drawable-v24
│ │ ├── glide_error.png
│ │ ├── ic_launcher_foreground.xml
│ │ ├── item_img1.png
│ │ ├── placeholder_load.png
│ │ └── time.png
│ │ ├── drawable
│ │ ├── ic_baseline_apps_24.xml
│ │ ├── ic_baseline_local_phone_24.xml
│ │ ├── ic_baseline_search_24.xml
│ │ ├── ic_launcher_background.xml
│ │ └── shape_dialog.xml
│ │ ├── layout
│ │ ├── activity_data_bean.xml
│ │ ├── activity_data_show.xml
│ │ ├── activity_main.xml
│ │ ├── dialog_appbean.xml
│ │ ├── item_bean.xml
│ │ ├── list_item_addressbook.xml
│ │ ├── list_item_app.xml
│ │ ├── list_item_app_card.xml
│ │ └── list_item_photo.xml
│ │ ├── menu
│ │ ├── menu_data.xml
│ │ └── menu_list_data.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── values-night
│ │ └── themes.xml
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ ├── style.xml
│ │ └── themes.xml
│ │ └── xml
│ │ ├── backup_rules.xml
│ │ └── data_extraction_rules.xml
│ └── test
│ └── java
│ └── com
│ └── itaem
│ └── datacapture
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | <<<<<<< HEAD
2 | # Default ignored files
3 | =======
4 | # 默认忽略的文件
5 | >>>>>>> 6404994 (数据抓取开源库:实现照片,消息,网络数据,通讯录,app日历时间,电量数据抓取)
6 | /shelf/
7 | /workspace.xml
8 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
20 |
21 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <<<<<<< HEAD
5 |
6 | =======
7 |
8 | >>>>>>> 6404994 (数据抓取开源库:实现照片,消息,网络数据,通讯录,app日历时间,电量数据抓取)
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/DataCapture/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/DataCapture/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.library'
3 | }
4 |
5 | android {
6 | namespace 'com.itaem.datacapture'
7 | compileSdk 34
8 |
9 | defaultConfig {
10 | minSdk 21
11 | targetSdk 34
12 |
13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14 | consumerProguardFiles "consumer-rules.pro"
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | compileOptions {
24 | sourceCompatibility JavaVersion.VERSION_1_8
25 | targetCompatibility JavaVersion.VERSION_1_8
26 | }
27 | }
28 |
29 | dependencies {
30 | implementation 'com.github.huangyanbin:SmartTable:2.2.0'
31 | // 添加google play服务 ----获取谷歌广告id
32 | implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
33 | // Google Play Referrer API
34 | implementation 'com.android.installreferrer:installreferrer:2.2'
35 | // Play 服务身份验证组件
36 | implementation 'com.google.android.gms:play-services-auth:20.1.0'
37 | implementation 'com.google.android.gms:play-services-auth-api-phone:18.0.1'
38 |
39 | implementation 'androidx.appcompat:appcompat:1.4.1'
40 | implementation 'com.google.android.material:material:1.5.0'
41 | testImplementation 'junit:junit:4.13.2'
42 | androidTestImplementation 'androidx.test.ext:junit:1.1.3'
43 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
44 | }
--------------------------------------------------------------------------------
/DataCapture/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/DataCapture/consumer-rules.pro
--------------------------------------------------------------------------------
/DataCapture/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/DataCapture/src/androidTest/java/com/itaem/datacapture/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.itaem.datacapture.test", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/DataCapture/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
30 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Factory/DataListFactory.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Factory;// 2023/11/9
2 |
3 | import android.content.Context;
4 |
5 | import com.itaem.datacapture.Utils.DataUtil;
6 | import com.itaem.datacapture.bean.ShowListBean;
7 |
8 | import java.util.List;
9 |
10 | // 作者:ITAEM 陈金城
11 | public abstract class DataListFactory {
12 | public abstract T getDataUtil(Class className);
13 | }
14 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Factory/Factory.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Factory;// 2023/11/9
2 |
3 | import com.itaem.datacapture.Utils.DataUtil;
4 |
5 | // 作者:ITAEM 陈金城
6 | public class Factory extends DataListFactory{
7 | @SuppressWarnings("unchecked")
8 | @Override
9 | public T getDataUtil(Class clz) {
10 | DataUtil dataUtil = null;
11 | String className = clz.getName();
12 | try {
13 | // 通过反射生产不同厂家的计算机
14 | dataUtil = (DataUtil) Class.forName(className).getDeclaredConstructor().newInstance();
15 | } catch (Exception e) {
16 | throw new RuntimeException(e);
17 | }
18 | return (T) dataUtil;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/AddressBookUtil.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/8/13
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.ContentResolver;
5 | import android.content.Context;
6 | import android.database.Cursor;
7 | import android.provider.ContactsContract;
8 |
9 | import com.itaem.datacapture.bean.AddressBookBean;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | // 作者:ITAEM 陈金城
15 | public class AddressBookUtil {
16 | @SuppressLint("Range")
17 | public static List getAddressBookBean(Context context) {
18 | List addressBook = new ArrayList<>();
19 | ContentResolver cr = context.getContentResolver();
20 | Cursor crs = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
21 | while (crs.moveToNext()) {
22 | // 获得联系人姓名
23 | int nameColumnIndex = crs.getColumnIndex(ContactsContract.PhoneLookup.DISPLAY_NAME);
24 | String name = crs.getString(nameColumnIndex);
25 | // 获取联系人手机号码
26 | int numberColumnIndex = crs.getColumnIndex(ContactsContract.Contacts._ID);
27 | // 获得当前联系人的ID索引用于查询号码
28 | String contact_Id = crs.getString(numberColumnIndex);
29 | // 注意第一个参数和上一个游标crs的参数是不同的。上一个是ContactsContract.Contacts.CONTENT_URI,并且第三个参数是为了得到和前面匹配的电话号码
30 | Cursor crs_Num = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = "
31 | + contact_Id, null, null);
32 | String number = "";
33 | while (crs_Num.moveToNext()) {
34 | int index = crs_Num.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
35 | number = crs_Num.getString(index);
36 | if (!number.isEmpty()) break;
37 | }
38 | // 编辑时间
39 | int updateTimeColumnIndex = crs.getColumnIndex(ContactsContract.Contacts.CONTACT_LAST_UPDATED_TIMESTAMP);
40 | long updateTime = crs.getLong(updateTimeColumnIndex);
41 | // 上次通讯时间(毫秒)
42 | int lastTimeColumnIndex = crs.getColumnIndex(ContactsContract.PhoneLookup.LAST_TIME_CONTACTED);
43 | long lastTime = crs.getLong(lastTimeColumnIndex);
44 | // 获得联系次数
45 | int timeColumnIndex = crs.getColumnIndex(ContactsContract.PhoneLookup.TIMES_CONTACTED);
46 | String type = "";
47 | switch (crs.getColumnIndex(ContactsContract.PhoneLookup.TYPE)){
48 | case 1:
49 | type = "家庭电话";
50 | break;
51 | case 2:
52 | type = "移动电话";
53 | break;
54 | case 3:
55 | type = "工作电话";
56 | break;
57 | default:
58 | type = "其他";
59 | break;
60 | }
61 | int times = crs.getInt(timeColumnIndex);
62 | addressBook.add(new AddressBookBean(name, String.valueOf(lastTime), number, times, String.valueOf(updateTime),type));
63 | }
64 | crs.close();
65 | return addressBook;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/AppListUtil.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/8/13
2 |
3 |
4 | import android.content.Context;
5 | import android.content.pm.ApplicationInfo;
6 | import android.content.pm.PackageInfo;
7 | import android.content.pm.PackageManager;
8 | import android.graphics.drawable.Drawable;
9 | import android.os.Build;
10 |
11 | import com.itaem.datacapture.bean.AppListBean;
12 | import com.itaem.datacapture.bean.ShowListBean;
13 |
14 | import java.util.ArrayList;
15 | import java.util.Date;
16 | import java.util.List;
17 |
18 | // 作者:ITAEM 陈金城
19 | public class AppListUtil extends DataUtil{
20 | /**
21 | * 获取列表
22 | */
23 | public static List getAppListBean(Context context) {
24 | List appListBeans = new ArrayList<>();
25 | PackageManager packageManager = context.getPackageManager();
26 | List installedApplications = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
27 | for (ApplicationInfo applicationInfo : installedApplications) {
28 | try {
29 | PackageInfo packageInfo = packageManager.getPackageInfo(applicationInfo.packageName, PackageManager.GET_ACTIVITIES);
30 | // 获取app名称
31 | String name = packageInfo.applicationInfo.loadLabel(packageManager).toString();
32 | Drawable drawable = applicationInfo.loadIcon(packageManager);
33 | // Drawable drawable = context.getPackageManager().getApplicationIcon(packageInfo.packageName);
34 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
35 | appListBeans.add(new AppListBean(name,
36 | // 判断是否系统应用
37 | String.valueOf((applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0 ? 1 : 0), packageInfo.versionName,
38 | String.valueOf(packageInfo.firstInstallTime),
39 | (int) (new Date().getTime() / 1000), packageInfo.packageName,
40 | String.valueOf(packageInfo.lastUpdateTime), String.valueOf(packageInfo.getLongVersionCode()),drawable));
41 | }else {
42 | appListBeans.add(new AppListBean(name,
43 | // 判断是否系统应用
44 | String.valueOf((applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0 ? 1 : 0), packageInfo.versionName,
45 | String.valueOf(packageInfo.firstInstallTime),
46 | (int) (new Date().getTime() / 1000), packageInfo.packageName,
47 | String.valueOf(packageInfo.lastUpdateTime), String.valueOf(packageInfo.versionCode),drawable));
48 | }
49 | } catch (PackageManager.NameNotFoundException e) {
50 | e.printStackTrace();
51 | }
52 | }
53 | return appListBeans;
54 | }
55 |
56 | @Override
57 | public List getData(Context context) {
58 | return (List) getAppListBean(context);
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/AppUtil.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/9/14
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 |
6 | // 作者:ITAEM 陈金城
7 | @SuppressLint("StaticFieldLeak")
8 | public class AppUtil {
9 | private volatile static AppUtil appUtil;
10 | private static Context context;
11 | public static AppUtil getInstance(Context context){
12 | if (appUtil==null){
13 | synchronized (AppUtil.class){
14 | if (appUtil==null){
15 | appUtil = new AppUtil(context);
16 | }
17 | }
18 | }
19 | return appUtil;
20 | }
21 |
22 | public AppUtil(Context context) {
23 | AppUtil.context = context;
24 | }
25 |
26 | public static Context getContext() {
27 | return context;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/BatteryStatusUtil.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/8/13
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.IntentFilter;
6 | import android.os.BatteryManager;
7 | import android.os.Build;
8 | import android.util.Log;
9 |
10 | import com.itaem.datacapture.bean.BatteryStatusBean;
11 |
12 | // 作者:ITAEM 陈金城
13 | public class BatteryStatusUtil {
14 | /**
15 | * 获取设备电量数据
16 | */
17 | public static BatteryStatusBean getBatteryState(Context context) {
18 | boolean is_usb_charge = false;
19 | boolean is_ac_charge = false;
20 | IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
21 | Intent batteryStatus = context.registerReceiver(null, ifilter);
22 | int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
23 | boolean is_charging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
24 | status == BatteryManager.BATTERY_STATUS_FULL;// 是否充电
25 | if (is_charging) {
26 | int chargePlug = batteryStatus.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
27 | is_usb_charge = chargePlug == BatteryManager.BATTERY_PLUGGED_USB;
28 | is_ac_charge = chargePlug == BatteryManager.BATTERY_PLUGGED_AC;
29 | }
30 |
31 | // 电池总容量
32 | Object mPowerProfile;
33 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
34 | BatteryManager batteryManager = (BatteryManager) context.getSystemService(Context.BATTERY_SERVICE);
35 | int capacity = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);
36 | System.out.println("电量" + capacity);
37 | }
38 |
39 | double battery_max = 0;
40 | if (isMIUI()) {
41 | battery_max = getBatteryCapacityMIUI(context);
42 | }
43 | if (battery_max==0.0){
44 | final String POWER_PROFILE_CLASS = "com.android.internal.os.PowerProfile";
45 | try {
46 | mPowerProfile = Class.forName(POWER_PROFILE_CLASS)
47 | .getConstructor(Context.class)
48 | .newInstance(context);
49 |
50 | battery_max = (double) Class
51 | .forName(POWER_PROFILE_CLASS)
52 | .getMethod("getBatteryCapacity")
53 | .invoke(mPowerProfile);
54 | } catch (Exception e) {
55 | e.printStackTrace();
56 | System.out.println("反射出现问题");
57 | }
58 | }
59 |
60 | int level = batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);// 当前电量
61 | int scale = batteryStatus.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
62 | double batteryPct = level * 1.0 / (float) scale;
63 | double battery_level = battery_max * batteryPct;// 当前电量
64 | return new BatteryStatusBean(String.valueOf(battery_level), String.valueOf(battery_max),
65 | level, is_charging ? 0 : 1, is_ac_charge ? 1 : 0, is_charging ? 0 : 1, is_usb_charge ? 1 : 0);
66 |
67 | }
68 | private static boolean isMIUI() {
69 | try {
70 | Class> miuiUtilsClass = Class.forName("miui.os.Build");
71 | return miuiUtilsClass.getField("IS_MIUI").getBoolean(null);
72 | } catch (Exception e) {
73 | Log.e("BatteryUtils", "Error checking MIUI: " + e.getMessage());
74 | }
75 | return false;
76 | }
77 | // 获取小米设备的电池容量
78 | private static double getBatteryCapacityMIUI(Context context) {
79 | double capacity = 0.0;
80 | try {
81 | IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
82 | Intent batteryStatus = context.registerReceiver(null, ifilter);
83 | int chargeCounter = batteryStatus.getIntExtra("charge_counter", -1);
84 | int capacityMicroAh = batteryStatus.getIntExtra("capacity_microamp", -1);
85 |
86 | if (chargeCounter != -1 && capacityMicroAh != -1) {
87 | capacity = (double) chargeCounter / capacityMicroAh;
88 | }
89 | } catch (Exception e) {
90 | Log.e("BatteryUtils", "Error getting battery capacity for MIUI: " + e.getMessage());
91 | }
92 | return capacity;
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/CalendarListUtil.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/8/13
2 |
3 | import android.Manifest;
4 | import android.annotation.SuppressLint;
5 | import android.content.ContentResolver;
6 | import android.content.Context;
7 | import android.content.pm.PackageManager;
8 | import android.database.Cursor;
9 | import android.net.Uri;
10 | import android.provider.CalendarContract;
11 | import android.util.Log;
12 | import android.widget.Toast;
13 |
14 | import androidx.core.app.ActivityCompat;
15 |
16 | import com.itaem.datacapture.bean.CalendarListBean;
17 |
18 | import java.util.ArrayList;
19 | import java.util.List;
20 |
21 | // 作者:ITAEM 陈金城
22 | public class CalendarListUtil {
23 | /**
24 | * 获取日历信息
25 | */
26 | @SuppressLint("Range")
27 | public static List getCalendarListBean(Context context) {
28 | List listBeans = new ArrayList<>();
29 | if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_CALENDAR) != PackageManager.PERMISSION_GRANTED) {
30 | Log.d("数据抓取:CalendarListUtil", "并未申请相关权限");
31 | return listBeans;
32 | }
33 | Cursor eventCursor = context.getContentResolver().query(CalendarContract.Events.CONTENT_URI, null, null, null, null);
34 | ContentResolver cr = context.getContentResolver();
35 | Uri uri = CalendarContract.Reminders.CONTENT_URI;
36 | String[] projection = {CalendarContract.Reminders._ID, CalendarContract.Reminders.MINUTES, CalendarContract.Reminders.METHOD};
37 | String selection = CalendarContract.Reminders.EVENT_ID + " = ?";
38 | if (eventCursor != null) {
39 | while (eventCursor.moveToNext()) {
40 | int descriptionIndex = eventCursor.getColumnIndex("description");
41 | String description = descriptionIndex >= 0 ? eventCursor.getString(descriptionIndex) : null;
42 | int titleIndex = eventCursor.getColumnIndex("title");
43 | String title = titleIndex >= 0 ? eventCursor.getString(titleIndex) : null;
44 | int startTimeIndex = eventCursor.getColumnIndex("dtstart");
45 | String start_time = startTimeIndex >= 0 ? eventCursor.getString(startTimeIndex) : null;
46 | int endTimeIndex = eventCursor.getColumnIndex("dtend");
47 | String end_time = endTimeIndex >= 0 ? eventCursor.getString(endTimeIndex) : null;
48 | int eventIdIndex = eventCursor.getColumnIndex("_id");
49 | String event_id = eventIdIndex >= 0 ? eventCursor.getString(eventIdIndex) : null;
50 | if (event_id != null) {
51 | String[] selectionArgs = {Long.toString(Long.parseLong(event_id))};
52 | Cursor query = cr.query(uri, projection, selection, selectionArgs, null);
53 | List remindersBeans = new ArrayList<>();
54 | while (query.moveToNext()) {
55 | int reminder_id = Integer.parseInt(query.getString(query.getColumnIndex("_id")));
56 | int minutes = Integer.parseInt(query.getString(query.getColumnIndex("minutes")));
57 | int method = Integer.parseInt(query.getString(query.getColumnIndex("method")));
58 | remindersBeans.add(new CalendarListBean.RemindersBean(Integer.parseInt(event_id), method, minutes, reminder_id));
59 | }
60 | query.close();
61 | listBeans.add(new CalendarListBean(description == null ? "" : description, end_time, event_id, title, start_time, remindersBeans));
62 | }
63 |
64 | }
65 | }
66 |
67 | if (eventCursor != null) {
68 | eventCursor.close();
69 | }
70 | return listBeans;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/DataCaptureUtil.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/8/13
2 |
3 | import android.content.Context;
4 |
5 | import com.itaem.datacapture.Utils.AddressBookUtil;
6 | import com.itaem.datacapture.bean.AddressBookBean;
7 |
8 | import java.util.List;
9 |
10 |
11 | // 作者:ITAEM 陈金城
12 | public class DataCaptureUtil {
13 | public static void init(Context context){
14 | List addressBookBean = AddressBookUtil.getAddressBookBean(context);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/DataUtil.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/11/9
2 |
3 | import android.content.Context;
4 |
5 | import com.itaem.datacapture.bean.AppListBean;
6 | import com.itaem.datacapture.bean.ShowListBean;
7 |
8 | import java.util.List;
9 |
10 | // 作者:ITAEM 陈金城
11 | public abstract class DataUtil {
12 | public abstract List getData(Context context);
13 | }
14 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/HardwareUtil.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/8/13
2 |
3 | import android.app.Activity;
4 | import android.app.Application;
5 | import android.content.Context;
6 | import android.graphics.Point;
7 | import android.os.Build;
8 | import android.util.DisplayMetrics;
9 | import android.util.Log;
10 | import android.view.WindowManager;
11 |
12 | import com.itaem.datacapture.bean.DeviceInfoBean;
13 | import com.itaem.datacapture.bean.HardwareBean;
14 |
15 | import java.io.BufferedReader;
16 | import java.io.IOException;
17 | import java.io.InputStreamReader;
18 | import java.lang.reflect.Method;
19 |
20 | // 作者:ITAEM 陈金城
21 | public class HardwareUtil {
22 | /**
23 | * 获取硬件信息
24 | */
25 | public static HardwareBean getHardwareBean(Context context) {
26 | String board = Build.BOARD; // 主板
27 | String brand = Build.BRAND;// 设备品牌
28 | String kernelVersion = System.getProperty("os.version");
29 | String cores = String.valueOf(Runtime.getRuntime().availableProcessors());
30 | DisplayMetrics metrics = new DisplayMetrics();
31 | Activity activity = (Activity) context;
32 | activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
33 | int device_height = metrics.heightPixels;// 分辨率高
34 | String device_name = Build.DEVICE; // 获取设备名称
35 | int device_width = metrics.widthPixels;// 分辨率宽
36 | String model = Build.MODEL;// 设备型号
37 | String physical_size = getScreenSizeOfDevice2(context);// 物理尺寸
38 | String production_date = null;
39 | try {
40 | production_date = getProductionDate();// 出厂时间戳
41 | } catch (IOException e) {
42 | e.printStackTrace();
43 | }
44 | String release = Build.VERSION.RELEASE;// 系统版本
45 | String sdk_version = String.valueOf(Build.VERSION.SDK_INT);// SDK版本
46 | String serial_number = getSerialNumbers();// 设备序列号
47 | return new HardwareBean(board, brand, cores, device_height, device_name, device_width,
48 | model, physical_size, production_date, release, sdk_version, serial_number);
49 | }
50 | private static String getScreenSizeOfDevice2(Context context) {
51 | Point point = new Point();
52 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
53 | wm.getDefaultDisplay().getRealSize(point);
54 | DisplayMetrics dm = context.getResources().getDisplayMetrics();
55 | double x = Math.pow(point.x / dm.xdpi, 2);
56 | double y = Math.pow(point.y / dm.ydpi, 2);
57 | double screenInches = Math.sqrt(x + y);
58 | return String.valueOf(screenInches);
59 | }
60 |
61 |
62 | private static String getSerialNumbers() {
63 | String serial = "";
64 | try {
65 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {//9.0+
66 | serial = Build.getSerial();
67 | } else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {//8.0+
68 | serial = Build.SERIAL;
69 | } else {//8.0-
70 | Class> c = Class.forName("android.os.SystemProperties");
71 | Method get = c.getMethod("get", String.class);
72 | serial = (String) get.invoke(c, "ro.serialno");
73 | }
74 | } catch (Exception e) {
75 | e.printStackTrace();
76 | Log.e("e", "读取设备序列号异常:" + e.toString());
77 | }
78 | return serial;
79 | }
80 | /**
81 | * 获取出厂时间戳(设备爆空,后续解决)
82 | */
83 | private static String getProductionDate() throws IOException {
84 | String manufacture = Build.MANUFACTURER;
85 | String device = Build.DEVICE;
86 | String product = Build.PRODUCT;
87 | String model = Build.MODEL;
88 | String command = "";
89 | if (model.equals("Nexus 5X")) {
90 | command = "getprop ro.boot." + manufacture.toLowerCase() + "." + device.toLowerCase() + "." + product.toLowerCase() + "." + "bullhead" + ".date";
91 | } else if (model.equals("Nexus 6P")) {
92 | command = "getprop ro.boot." + manufacture.toLowerCase() + "." + device.toLowerCase() + "." + product.toLowerCase() + "." + "angler" + ".date";
93 | } else {
94 | command = "getprop ro.build.date.utc";
95 | }
96 | Process process = Runtime.getRuntime().exec(command);
97 | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
98 | String dateTime = reader.readLine();
99 | long timestamp = Long.parseLong(dateTime.equals("") ? "0" : dateTime);
100 | System.out.println("出厂时间戳" + timestamp);
101 | return String.valueOf(timestamp);
102 | }
103 |
104 | }
105 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/LocationUtils.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/4/15
2 |
3 | import static android.content.Context.LOCATION_SERVICE;
4 | import static android.content.Context.MODE_PRIVATE;
5 |
6 | import android.Manifest;
7 | import android.annotation.SuppressLint;
8 | import android.content.Context;
9 | import android.content.SharedPreferences;
10 | import android.content.pm.PackageManager;
11 | import android.location.Address;
12 | import android.location.Geocoder;
13 | import android.location.Location;
14 | import android.location.LocationListener;
15 | import android.location.LocationManager;
16 | import android.os.Build;
17 | import android.os.Bundle;
18 | import android.util.Log;
19 |
20 | import androidx.annotation.NonNull;
21 | import androidx.core.app.ActivityCompat;
22 |
23 |
24 | import java.util.List;
25 | import java.util.Locale;
26 |
27 | /**
28 | * 获取经纬度、位置工具类
29 | */
30 | public class LocationUtils {
31 |
32 | @SuppressLint("StaticFieldLeak")
33 | private volatile static LocationUtils uniqueInstance;
34 | private Location location;
35 | private final Context mContext;
36 | private String tag = "";
37 | private SharedPreferences preferences;
38 | private SharedPreferences.Editor edit;
39 | private LocationUtils(Context context) {
40 | mContext = context;
41 | preferences = mContext.getSharedPreferences("locaiton",MODE_PRIVATE);
42 | edit = preferences.edit();
43 | getLocation(context);
44 | }
45 |
46 | //实现单例
47 | public static LocationUtils getInstance(Context context) {
48 | if (uniqueInstance == null) {
49 | synchronized (LocationUtils.class) {
50 | if (uniqueInstance == null) {
51 | uniqueInstance = new LocationUtils(context);
52 | }
53 | }
54 | }
55 | return uniqueInstance;
56 | }
57 |
58 | //获取经纬度location
59 | private void getLocation(Context context) {
60 | //1.获取位置管理器
61 | LocationManager locationManager = (LocationManager) mContext.getSystemService(LOCATION_SERVICE);
62 | //2.获取位置提供器,GPS或是NetWork
63 | List providers = locationManager.getProviders(true);
64 | Log.d("TAG", "打印位置提供器: ");
65 | if (providers!=null&&providers.size()!=0){
66 | for (String proviceder:providers){
67 | if (locationManager.isProviderEnabled(proviceder)) {
68 | Log.d("TAG", "longitude:gps_toOpen" );
69 | // 需要检查权限,否则编译报错,想抽取成方法都不行,还是会报错。只能这样重复 code 了。
70 | if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
71 | Log.d("数据抓取:LocationUtils", "并未申请相关权限");
72 | return;
73 | }
74 | Location location = locationManager.getLastKnownLocation(proviceder);
75 | Log.d("TAG", "getLocation: "+proviceder);
76 | if (location!=null){
77 | setLocation(location);
78 | getAddress(context,location);
79 | }
80 | locationManager.requestLocationUpdates(proviceder, 5000, 3, new LocationListener() {
81 | @Override
82 | public void onLocationChanged(@NonNull Location location) {
83 | if (location!=null){
84 | setLocation(location);
85 | getAddress(context,location);
86 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
87 | locationManager.removeUpdates(this);
88 | }
89 | }
90 | }
91 |
92 | });
93 | }
94 | }
95 | }
96 | }
97 |
98 |
99 |
100 |
101 | private void setLocation(Location location) {
102 | this.location = location;
103 | if(location!=null){
104 | setData();
105 | }
106 | }
107 | private void setData(){
108 | edit.putString("longitude",String.valueOf(location.getLongitude()));
109 | edit.putString("Latitude",String.valueOf(location.getLatitude()));
110 | edit.apply();
111 | }
112 | public String getLongitude(){
113 | Log.d("TAG", "splocation_get"+preferences.getString("longitude",""));
114 | return preferences.getString("longitude","");
115 |
116 |
117 | }
118 | public String getLatitude(){
119 | Log.d("TAG", "splocation_get"+preferences.getString("Latitude",""));
120 | return preferences.getString("Latitude","");
121 | }
122 |
123 | //获取经纬度
124 | public Location showLocation() {
125 | if (location!=null){
126 | Log.d("TAG", "经纬度" + location.getLongitude());
127 | Log.d("TAG", "经纬度" + location.getLatitude());
128 | }
129 | Log.d("TAG", "location_tag" + tag);
130 | return location;
131 | }
132 | private AddressInfo addressInfo = new AddressInfo();
133 | private String address = "";
134 | public AddressInfo getAddressInfo() {
135 | return addressInfo;
136 | }
137 |
138 | public String getAddress() {
139 | return address;
140 | }
141 |
142 | //获取地址信息:城市、街道等信息
143 | public String getAddress(Context context,Location location) {
144 | List result;
145 | try {
146 | if (location != null) {
147 | Geocoder gc = new Geocoder(context, Locale.getDefault());
148 | // 返回一个地址数组,该数组试图描述给定纬度和经度周围的区域。
149 | // 返回的地址应该根据提供给该类构造函数的区域设置进行本地化。
150 | // 结果可以通过网络查找的方式获得,这个方法可能需要一些时间来返回,因此不应该在主线程上调用。
151 | result = gc.getFromLocation(location.getLatitude(),
152 | location.getLongitude(), 1);
153 | for (int i = 0; i < result.size(); i++) {
154 | address = result.get(i).toString();
155 | }
156 | addressInfo.gps_latitude = String.valueOf(result.get(0).getLatitude());
157 | addressInfo.gps_longitude = String.valueOf(result.get(0).getLongitude());
158 | addressInfo.gps_address_street = result.get(0).getAddressLine(2);
159 | addressInfo.gps_address_province = result.get(0).getAdminArea();
160 | addressInfo.gps_address_city = result.get(0).getLocality();
161 | addressInfo.gps_address_country = result.get(0).getAddressLine(0);
162 | addressInfo.gps_address_countryCode = result.get(0).getCountryCode();
163 | }
164 | } catch (Exception e) {
165 | e.printStackTrace();
166 | }
167 | return address;
168 | }
169 |
170 | public static class AddressInfo{
171 | private String gps_longitude;// 经度
172 | private String gps_latitude;// 维度
173 | private String gps_address_street;// 街道
174 | private String gps_address_province;// 省份
175 | private String gps_address_city;// 城市
176 | private String gps_address_country;// 国家
177 | private String gps_address_countryCode;// 国家代码
178 |
179 | public AddressInfo() {}
180 |
181 | public String getGps_address_country() {
182 | return gps_address_country;
183 | }
184 |
185 | public String getGps_address_countryCode() {
186 | return gps_address_countryCode;
187 | }
188 |
189 | public String getGps_longitude() {
190 | return gps_longitude;
191 | }
192 |
193 | public String getGps_latitude() {
194 | return gps_latitude;
195 | }
196 |
197 | public String getGps_address_street() {
198 | return gps_address_street;
199 | }
200 |
201 | public String getGps_address_province() {
202 | return gps_address_province;
203 | }
204 |
205 | public String getGps_address_city() {
206 | return gps_address_city;
207 | }
208 | }
209 | }
210 |
211 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/NetworkBeanUtils.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/8/13
2 |
3 | import android.Manifest;
4 | import android.annotation.SuppressLint;
5 | import android.content.Context;
6 | import android.content.pm.PackageManager;
7 | import android.net.wifi.ScanResult;
8 | import android.net.wifi.WifiConfiguration;
9 | import android.net.wifi.WifiInfo;
10 | import android.net.wifi.WifiManager;
11 | import android.os.Build;
12 | import android.text.format.Formatter;
13 | import android.util.Log;
14 |
15 | import androidx.core.app.ActivityCompat;
16 |
17 | import com.itaem.datacapture.bean.DeviceInfoBean;
18 | import com.itaem.datacapture.bean.NetworkBean;
19 |
20 | import java.io.BufferedReader;
21 | import java.io.FileReader;
22 | import java.io.IOException;
23 | import java.util.ArrayList;
24 | import java.util.List;
25 |
26 | // 作者:ITAEM 陈金城
27 | public class NetworkBeanUtils {
28 | /**
29 | * 获取网路信息
30 | */
31 | @SuppressLint("BlockedPrivateApi")
32 | public static NetworkBean getNetworkBean(Context context) {
33 | if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
34 | &&ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED
35 | ) {
36 | Log.d("数据抓取:NetworkBeanUtils", "并未申请相关权限");
37 | return new NetworkBean();
38 | }
39 | WifiInfo wifiInfo = null;
40 | WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
41 | // 获取WiFi信息对象
42 | wifiInfo = wifiManager.getConnectionInfo();
43 | int ipAddress = wifiInfo.getIpAddress();
44 | // 获取IP地址
45 | System.out.println("mssid" + getMacAddr());
46 | String ip = Formatter.formatIpAddress(wifiManager.getDhcpInfo().ipAddress);
47 | NetworkBean.CurrentWifiBean current_wifi;
48 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
49 | System.out.println("bssid" + wifiInfo.getBSSID());
50 | System.out.println("ssid" + wifiInfo.getSSID());
51 | current_wifi = new NetworkBean.CurrentWifiBean(wifiInfo.getBSSID() == null ? "" : wifiInfo.getBSSID(), wifiInfo.getBSSID() == null ? "" : wifiInfo.getBSSID()
52 | , wifiInfo.getSSID() == null ? "" : wifiInfo.getSSID(), wifiInfo.getSSID() == null ? "" : wifiInfo.getSSID());
53 | } else {
54 | current_wifi = new NetworkBean.CurrentWifiBean(wifiInfo.getBSSID(), wifiInfo.getBSSID(), wifiInfo.getSSID(), wifiInfo.getSSID());
55 | }
56 | List configuredWifiBeans = new ArrayList<>();
57 | List scanResults = wifiManager.getScanResults();
58 | int wifi_count = scanResults.size(); // wifi个数
59 | if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
60 | Log.d("NetworkBeanUtils","没有获取精细定位权限——Manifest.permission.ACCESS_FINE_LOCATION");
61 | return null;
62 | }
63 | List configuredNetworks = wifiManager.getConfiguredNetworks();
64 | int size = 0;
65 | if (scanResults.size()!=0){
66 | for (ScanResult scanResult : scanResults){
67 | // WifiConfiguration config = configuredNetworks.get(size);
68 | configuredWifiBeans.add(new NetworkBean.ConfiguredWifiBean(
69 | scanResult.BSSID, scanResult.BSSID, scanResult.SSID,scanResult.SSID
70 | ));
71 | size++;
72 | }
73 | }
74 | return new NetworkBean(current_wifi, ip,wifi_count,configuredWifiBeans);
75 | }
76 | private static String getMacAddr() {
77 | try {
78 | return loadFileAsString("/sys/class/net/wlan0/address")
79 | .toUpperCase().substring(0, 17);
80 | } catch (IOException e) {
81 | e.printStackTrace();
82 | return "";
83 | }
84 | }
85 | private static String loadFileAsString(String filePath)
86 | throws java.io.IOException {
87 | StringBuffer fileData = new StringBuffer(1000);
88 | BufferedReader reader = new BufferedReader(new FileReader(filePath));
89 | char[] buf = new char[1024];
90 | int numRead = 0;
91 | while ((numRead = reader.read(buf)) != -1) {
92 | String readData = String.valueOf(buf, 0, numRead);
93 | fileData.append(readData);
94 | }
95 | reader.close();
96 | return fileData.toString();
97 | }
98 |
99 | }
100 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/OtherDataUtil.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/8/13
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.net.Uri;
6 | import android.os.Build;
7 | import android.os.SystemClock;
8 | import android.telephony.SignalStrength;
9 | import android.telephony.TelephonyManager;
10 |
11 | import com.itaem.datacapture.bean.OtherDataBean;
12 |
13 | import java.io.File;
14 |
15 | // 作者:ITAEM 陈金城
16 | public class OtherDataUtil {
17 | /**
18 | * 获取其他信息
19 | * int keyboard = 1;// 连接到设备的键盘种类 很迷
20 | */
21 | public static OtherDataBean getOtherDataBean(Context context){
22 | String level = "-1"; // 手机的信号强度 默认值-1
23 | TelephonyManager telephonyManager = (TelephonyManager)context. getSystemService(Context.TELEPHONY_SERVICE);
24 | SignalStrength signalStrength;
25 | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {
26 | signalStrength = telephonyManager.getSignalStrength();
27 | if (signalStrength!=null){
28 | if ((-113 + 2 * signalStrength.getGsmSignalStrength())>0){
29 | level = String.valueOf((-113 + 2 * signalStrength.getGsmSignalStrength())*-1);
30 | }else {
31 | level =String.valueOf((-113 + 2 * signalStrength.getGsmSignalStrength()));// 获取信号强度的单位为dBm
32 | }
33 | }
34 | }
35 | // int keyboard = 1;// 连接到设备的键盘种类
36 | long uptimeMillis = SystemClock.elapsedRealtime();
37 | long currentTimeMillis = System.currentTimeMillis();
38 | long bootTimeMillis = currentTimeMillis - uptimeMillis;
39 | String bootTime = String.valueOf(bootTimeMillis/1000);
40 | String last_boot_time = String.valueOf(getBootTime());// 最后一次启动时间
41 | int root_jailbreak = isRooted()?1:0 ;// 是否root
42 | int simulator = isEmulator(context) ;// 是否是模拟器
43 | return new OtherDataBean(level,last_boot_time.equals("0")?bootTime:last_boot_time, root_jailbreak, simulator);
44 | }
45 |
46 | /**
47 | * 设备是否root
48 | */
49 | public static boolean isRooted() {
50 | boolean isRooted = false;
51 | try {
52 | File file = new File("/system/app/Superuser.apk");
53 | if (file.exists()) {
54 | isRooted = true;
55 | }
56 | } catch (Exception e) {
57 | e.printStackTrace();
58 | }
59 | return isRooted;
60 | }
61 | /**
62 | * 获取最后一次启动时间
63 | */
64 | public static long getBootTime() {
65 | return System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() / 1000000;
66 | }
67 | /**
68 | * 判断是否为模拟器
69 | */
70 | public static int isEmulator(Context context) {
71 | boolean checkProperty = Build.FINGERPRINT.startsWith("generic")
72 | || Build.FINGERPRINT.toLowerCase().contains("vbox")
73 | || Build.FINGERPRINT.toLowerCase().contains("test-keys")
74 | || Build.MODEL.contains("google_sdk")
75 | || Build.MODEL.contains("Emulator")
76 | || Build.MODEL.contains("Android SDK built for x86")
77 | || Build.MANUFACTURER.contains("Genymotion")
78 | || (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic"))
79 | || "google_sdk".equals(Build.PRODUCT);
80 | if (checkProperty) return 1;
81 | String operatorName = "";
82 | TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
83 | if (tm != null) {
84 | String name = tm.getNetworkOperatorName();
85 | if (name != null) {
86 | operatorName = name;
87 | }
88 | }
89 | boolean checkOperatorName = operatorName.toLowerCase().equals("android");
90 | if (checkOperatorName) return 1;
91 | String url = "tel:" + "123456";
92 | Intent intent = new Intent();
93 | intent.setData(Uri.parse(url));
94 | intent.setAction(Intent.ACTION_DIAL);
95 | boolean checkDial = intent.resolveActivity(context.getPackageManager()) == null;
96 | if (checkDial) return 1;
97 | return 0;
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/SDCardUtils.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/4/24
2 |
3 |
4 |
5 | import android.app.ActivityManager;
6 | import android.content.Context;
7 | import android.os.Debug;
8 | import android.os.Environment;
9 | import android.os.StatFs;
10 |
11 |
12 | import com.itaem.datacapture.bean.NewStorageBean;
13 |
14 | import java.io.File;
15 |
16 |
17 | // 获取存储bean类
18 | public class SDCardUtils {
19 | private static NewStorageBean newStorageBean = new NewStorageBean();
20 | private static StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath());
21 |
22 | public static NewStorageBean getNewStorageBean(Context context){
23 | ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
24 | ActivityManager.MemoryInfo info = new ActivityManager.MemoryInfo();
25 | am.getMemoryInfo(info);
26 | // newStorageBean.setActiveMemory(String.valueOf(storageData.ram_total_size));
27 | // newStorageBean.setInActiveMemory(String.valueOf(storageData.ram_total_size-storageData.ram_usable_size));
28 | // newStorageBean.setTotalMemory(String.valueOf(storageData.internal_storage_total+storageData.memory_card_size));// 总内存
29 | // newStorageBean.setUsedMemory(String.valueOf(storageData.memory_card_size_use+storageData.internal_storage_total-storageData.internal_storage_usable));
30 | // newStorageBean.setFreeMemory(String.valueOf(storageData.internal_storage_usable+storageData.memory_card_size-storageData.memory_card_size_use));// 可用
31 | // newStorageBean.setPurgableMemory(String.valueOf(storageData.memory_card_size_use));
32 | // newStorageBean.setWiredMemory(String.valueOf(getReservedMemory()));
33 | newStorageBean.setApp_max_memory(String.valueOf(Runtime.getRuntime().maxMemory()));
34 | newStorageBean.setApp_total_memory(String.valueOf(Runtime.getRuntime().totalMemory()));
35 | newStorageBean.setApp_free_memory(String.valueOf(Runtime.getRuntime().freeMemory()));
36 | newStorageBean.setContain_sd(isSDInner()?"1":"0");// 是否内置内存卡
37 | newStorageBean.setExtra_sd(isSDCardMount()?"0":"1");// 是否外置内存卡
38 | newStorageBean.setInternal_storage_total(String.valueOf(getFsTotalsize())); // 总存储大小 单位Byte)
39 | newStorageBean.setInternal_storage_usable(String.valueOf(getFsAvailableSize()));// 可用存储大小
40 | newStorageBean.setMemory_card_size(String.valueOf(getSDCardSize()));
41 | newStorageBean.setMemory_card_size_use(String.valueOf(getFsUseSize()));
42 | newStorageBean.setMemory_card_free_size(String.valueOf(getFsTotalsize()-getFsUseSize()));
43 | newStorageBean.setMemory_card_usable_size(String.valueOf(getFsTotalsize()-getFsUseSize()));
44 | newStorageBean.setRam_total_size(String.valueOf(info.totalMem));
45 | newStorageBean.setRam_usable_size(String.valueOf(info.availMem));
46 | newStorageBean.setRam_threshold(String.valueOf(info.threshold));
47 |
48 | return newStorageBean;
49 | }
50 | // 获取可用大小
51 | private static long getFsAvailableSize() {
52 | return statFs.getBlockSizeLong() * statFs.getAvailableBlocksLong();
53 | }
54 | // 获取总大小
55 | private static long getFsTotalsize() {
56 | return statFs.getBlockSizeLong() * statFs.getBlockCountLong();
57 | }
58 | private static long getFsUseSize() {
59 | return statFs.getBlockSizeLong() * (statFs.getBlockCountLong() - statFs.getAvailableBlocksLong());
60 | }
61 | public static long getSDCardSize() {
62 | String state = Environment.getExternalStorageState();
63 | if (Environment.MEDIA_MOUNTED.equals(state)) {
64 | String sdCardPath = Environment.getDataDirectory().getPath();
65 | StatFs statFs = new StatFs(sdCardPath);
66 | long blockSize = statFs.getBlockSizeLong();
67 | long totalBlocks = statFs.getBlockCountLong();
68 | long totalSize = blockSize * totalBlocks;
69 | return totalSize;
70 | } else {
71 | return 0; // 存储卡未挂载或不可用
72 | }
73 | }
74 |
75 | /**
76 | * 获取保留内存
77 | */
78 | public static long getReservedMemory() {
79 | Runtime runtime = Runtime.getRuntime();
80 | return runtime.totalMemory() - runtime.freeMemory() + Debug.getNativeHeapAllocatedSize();
81 | }
82 |
83 | /**
84 | * 判断SD是否挂载
85 | */
86 | public static boolean isSDCardMount() {
87 | return Environment.getExternalStorageState().equals(
88 | Environment.MEDIA_MOUNTED);
89 | }
90 |
91 | /**
92 | * 设备是否有内置sd卡
93 | * @return
94 | */
95 | public static boolean isSDInner(){
96 | if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
97 | File internalStorage = Environment.getExternalStorageDirectory();
98 | // 检查内置存储是否可用
99 | if (internalStorage != null && internalStorage.exists()) {
100 | // 设备有内置SD卡
101 | return true;
102 | }
103 | } else {
104 | // 设备没有内置SD卡
105 | return false;
106 | }
107 | return false;
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/SensorListUtil.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/8/13
2 |
3 | import android.content.Context;
4 | import android.hardware.Sensor;
5 | import android.hardware.SensorManager;
6 | import android.os.Build;
7 |
8 | import com.itaem.datacapture.bean.DeviceInfoBean;
9 | import com.itaem.datacapture.bean.GeneralDataBean;
10 | import com.itaem.datacapture.bean.SensorListBean;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 |
15 | // 作者:ITAEM 陈金城
16 | public class SensorListUtil {
17 | public static List getSensorListBean(Context context) {
18 | List sensorListBeans = new ArrayList<>();
19 | SensorManager sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
20 | List sensorList = sensorManager.getSensorList(Sensor.TYPE_ALL);
21 | for (int i = 0; i < sensorList.size(); i++) {
22 | Sensor sensor = sensorList.get(i);
23 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
24 | sensorListBeans.add(new SensorListBean(
25 | String.valueOf(sensor.getId()),String.valueOf(sensor.getMaximumRange()),
26 | String.valueOf(sensor.getMinDelay()), sensor.getName(), String.valueOf(sensor.getPower()),
27 | String.valueOf(sensor.getResolution()), String.valueOf(sensor.getType()),
28 | String.valueOf(sensor.getVendor()), String.valueOf(sensor.getVersion())
29 | ));
30 | }else {
31 | sensorListBeans.add(new SensorListBean(
32 | String.valueOf(-2),String.valueOf(sensor.getMaximumRange()),
33 | String.valueOf(sensor.getMinDelay()), sensor.getName(), String.valueOf(sensor.getPower()),
34 | String.valueOf(sensor.getResolution()), String.valueOf(sensor.getType()),
35 | String.valueOf(sensor.getVendor()), String.valueOf(sensor.getVersion())
36 | ));
37 | }
38 | }
39 | return sensorListBeans;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/Utils/SmsUtil.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.Utils;// 2023/8/13
2 |
3 | import android.Manifest;
4 | import android.annotation.SuppressLint;
5 | import android.content.ContentResolver;
6 | import android.content.Context;
7 | import android.content.pm.PackageManager;
8 | import android.database.Cursor;
9 | import android.provider.Telephony;
10 | import android.util.Log;
11 |
12 | import androidx.core.app.ActivityCompat;
13 |
14 | import com.itaem.datacapture.bean.SmsBean;
15 |
16 | import java.util.ArrayList;
17 | import java.util.List;
18 |
19 | // 作者:ITAEM 陈金城
20 | public class SmsUtil {
21 | /**
22 | * 获取sms列表
23 | */
24 | @SuppressLint("Range")
25 | public static List getSmsList(Context context) {
26 | List smsBeans = new ArrayList<>();
27 | if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_SMS) != PackageManager.PERMISSION_GRANTED) {
28 | Log.d("数据抓取:SmsUtil", "并未申请相关权限");
29 | return smsBeans;
30 | }
31 | ContentResolver contentResolver = context.getContentResolver();
32 | Cursor cursor = contentResolver.query(Telephony.Sms.CONTENT_URI, null, null, null, null);
33 | if (cursor != null && cursor.moveToFirst()) {
34 | do {
35 | int typeSms = cursor.getInt(cursor.getColumnIndex(Telephony.Sms.TYPE));
36 | String date_receive = cursor.getString(cursor.getColumnIndex(Telephony.Sms.DATE));
37 | String date_sent = cursor.getString(cursor.getColumnIndex(Telephony.Sms.DATE_SENT));
38 | String other_phone = cursor.getString(cursor.getColumnIndex(Telephony.Sms.ADDRESS));
39 | String time = "";
40 | String type = "";
41 | if (typeSms==Telephony.Sms.MESSAGE_TYPE_SENT) {
42 | time = date_sent;
43 | type = "2";
44 | } else {
45 | time = date_receive;
46 | type = "1";
47 | }
48 | int read = cursor.getInt(cursor.getColumnIndex(Telephony.Sms.READ));
49 | int seen = cursor.getInt(cursor.getColumnIndex(Telephony.Sms.SEEN));
50 | int status = cursor.getInt(cursor.getColumnIndex(Telephony.Sms.STATUS));
51 | if (status == 32) status = 64;
52 | else if (status == 64) status = 128;
53 | String subject = cursor.getString(cursor.getColumnIndex(Telephony.Sms.SUBJECT));
54 | if (subject == null) {
55 | subject = "";
56 | }
57 | String content = cursor.getString(cursor.getColumnIndex(Telephony.Sms.BODY));
58 | String package_name = "包名";
59 | smsBeans.add(new SmsBean(content, other_phone, package_name, read, seen,
60 | status, subject, time, type));
61 | } while (cursor.moveToNext());
62 | cursor.close();
63 | }
64 | return smsBeans;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/AddressBookBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/13
2 |
3 | import com.bin.david.form.annotation.SmartColumn;
4 | import com.bin.david.form.annotation.SmartTable;
5 |
6 | import java.io.Serializable;
7 |
8 | // 作者:ITAEM 陈金城
9 | @SmartTable(name="通讯录")
10 | public class AddressBookBean implements Serializable {
11 | /**
12 | * contact_display_name : string
13 | * last_time_contacted : 0
14 | * number : string
15 | * times_contacted : 0
16 | * up_time : 0
17 | */
18 | @SmartColumn(id =1,name = "contact_display_name_联系人名称")
19 | private String contact_display_name; // 联系人名称
20 | @SmartColumn(id =2,name = "last_time_contacted_上次通讯时间(毫秒)")
21 | private String last_time_contacted; // 上次通讯时间(毫秒)
22 | @SmartColumn(id =3,name = "number_联系人手机号")
23 | private String number; // 联系人手机号
24 | @SmartColumn(id =4,name = "times_contacted_联系次数")
25 | private int times_contacted; // 联系次数
26 | @SmartColumn(id =5,name = "up_time_编辑时间(毫秒)")
27 | private String up_time; // 编辑时间(毫秒)
28 | @SmartColumn(id =6,name = "type_通话类型")
29 | private String type; // 通话类型
30 |
31 | public AddressBookBean(String contact_display_name, String last_time_contacted, String number, int times_contacted, String up_time,String type) {
32 | this.contact_display_name = contact_display_name;
33 | this.last_time_contacted = last_time_contacted;
34 | this.number = number;
35 | this.times_contacted = times_contacted;
36 | this.up_time = up_time;
37 | this.type = type;
38 | }
39 |
40 | public String getContact_display_name() {
41 | return contact_display_name;
42 | }
43 |
44 | public void setContact_display_name(String contact_display_name) {
45 | this.contact_display_name = contact_display_name;
46 | }
47 |
48 | public String getLast_time_contacted() {
49 | return last_time_contacted;
50 | }
51 |
52 | public void setLast_time_contacted(String last_time_contacted) {
53 | this.last_time_contacted = last_time_contacted;
54 | }
55 |
56 | public String getNumber() {
57 | return number;
58 | }
59 |
60 | public void setNumber(String number) {
61 | this.number = number;
62 | }
63 |
64 | public int getTimes_contacted() {
65 | return times_contacted;
66 | }
67 |
68 | public void setTimes_contacted(int times_contacted) {
69 | this.times_contacted = times_contacted;
70 | }
71 |
72 | public String getUp_time() {
73 | return up_time;
74 | }
75 |
76 | public void setUp_time(String up_time) {
77 | this.up_time = up_time;
78 | }
79 |
80 | public String getType() {
81 | return type;
82 | }
83 |
84 | public void setType(String type) {
85 | this.type = type;
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/AppListBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/13
2 |
3 | import android.graphics.drawable.Drawable;
4 |
5 | import com.bin.david.form.annotation.SmartColumn;
6 | import com.bin.david.form.annotation.SmartTable;
7 |
8 | import java.io.Serializable;
9 |
10 | // 作者:ITAEM 陈金城
11 | @SmartTable(name="应用列表")
12 | public class AppListBean extends ShowListBean implements Serializable {
13 | /**
14 | * app_name : string
15 | * app_type : string
16 | * app_version : string
17 | * in_time : 0
18 | * obtain_time : 0
19 | * package_name : string
20 | * up_time : 0
21 | * version_code : string
22 | */
23 | @SmartColumn(id =1,name = "app_name_APP名称")
24 | private String app_name; // APP名称
25 | @SmartColumn(id =2,name = "app_type_是否系统app(0:非,1:是)")
26 | private String app_type; // 是否系统app 0:非系统app 1:系统app
27 | @SmartColumn(id =3,name = "app_version_APP版本")
28 | private String app_version; // APP版本
29 | @SmartColumn(id =4,name = "in_time_安装时间(毫秒)")
30 | private String in_time; // 安装时间(毫秒)
31 | @SmartColumn(id =5,name = "obtain_time_数据抓取时间(秒)")
32 | private int obtain_time; // 数据抓取时间(秒)
33 | @SmartColumn(id =6,name = "package_name_包名")
34 | private String package_name; // 包名
35 | @SmartColumn(id =7,name = "up_time_更新时间 (毫秒)")
36 | private String up_time; // 更新时间 (毫秒)
37 | @SmartColumn(id =8,name = "version_code_版本号")
38 | private String version_code; // 版本号
39 | @SmartColumn(id =9,name = "app_icon_icon")
40 | private Drawable app_icon; // 版本号
41 | public AppListBean(String app_name, String app_type, String app_version, String in_time, int obtain_time, String package_name, String up_time, String version_code,Drawable app_icon) {
42 | this.app_name = app_name;
43 | this.app_type = app_type;
44 | this.app_version = app_version;
45 | this.in_time = in_time;
46 | this.obtain_time = obtain_time;
47 | this.package_name = package_name;
48 | this.up_time = up_time;
49 | this.version_code = version_code;
50 | this.app_icon = app_icon;
51 | }
52 |
53 | public String getApp_name() {
54 | return app_name;
55 | }
56 |
57 | public void setApp_name(String app_name) {
58 | this.app_name = app_name;
59 | }
60 |
61 | public String getApp_type() {
62 | return app_type;
63 | }
64 |
65 | public void setApp_type(String app_type) {
66 | this.app_type = app_type;
67 | }
68 |
69 | public String getApp_version() {
70 | return app_version;
71 | }
72 |
73 | public void setApp_version(String app_version) {
74 | this.app_version = app_version;
75 | }
76 |
77 | public String getIn_time() {
78 | return in_time;
79 | }
80 |
81 | public void setIn_time(String in_time) {
82 | this.in_time = in_time;
83 | }
84 |
85 | public int getObtain_time() {
86 | return obtain_time;
87 | }
88 |
89 | public void setObtain_time(int obtain_time) {
90 | this.obtain_time = obtain_time;
91 | }
92 |
93 | public String getPackage_name() {
94 | return package_name;
95 | }
96 |
97 | public void setPackage_name(String package_name) {
98 | this.package_name = package_name;
99 | }
100 |
101 | public String getUp_time() {
102 | return up_time;
103 | }
104 |
105 | public void setUp_time(String up_time) {
106 | this.up_time = up_time;
107 | }
108 |
109 | public String getVersion_code() {
110 | return version_code;
111 | }
112 |
113 | public void setVersion_code(String version_code) {
114 | this.version_code = version_code;
115 | }
116 |
117 | public Drawable getApp_icon() {
118 | return app_icon;
119 | }
120 |
121 | public void setApp_icon(Drawable app_icon) {
122 | this.app_icon = app_icon;
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/BatteryStatusBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/13
2 |
3 | import com.bin.david.form.annotation.SmartColumn;
4 | import com.bin.david.form.annotation.SmartTable;
5 |
6 | import java.io.Serializable;
7 |
8 | // 作者:ITAEM 陈金城
9 | @SmartTable(name="电量信息")
10 | public class BatteryStatusBean implements Serializable {
11 | /**
12 | * battery_level : string
13 | * battery_max : string
14 | * battery_pct : 0
15 | * battery_state : 0
16 | * is_ac_charge : 0
17 | * is_charging : 0
18 | * is_usb_charge : 0
19 | */
20 | @SmartColumn(id =1,name = "battery_level_电池电量")
21 | private String battery_level; // 电池电量
22 | @SmartColumn(id =2,name = "battery_max_电池容量")
23 | private String battery_max; // 电池容量
24 | @SmartColumn(id =3,name = "battery_pct_电池百分比")
25 | private int battery_pct; // 电池百分比
26 | @SmartColumn(id =4,name = "battery_state_电池状态 充电0 不充电1")
27 | private int battery_state;// 电池状态 充电0 不充电1
28 | @SmartColumn(id =5,name = "is_ac_charge_是否交流充电(1:yes,0:no)")
29 | private int is_ac_charge; // 是否交流充电(1:yes,0:no)
30 | @SmartColumn(id =6,name = "is_charging_是否正在充电")
31 | private int is_charging; // 是否正在充电
32 | @SmartColumn(id =6,name = "is_usb_charge_是否USB充电(1:yes,0:no)")
33 | private int is_usb_charge;// 是否USB充电(1:yes,0:no)
34 |
35 | public BatteryStatusBean(String battery_level, String battery_max, int battery_pct,int battery_state, int is_ac_charge, int is_charging, int is_usb_charge) {
36 | this.battery_level = battery_level!=null?battery_level:"";
37 | this.battery_max = battery_max!=null?battery_max:"";
38 | this.battery_pct = battery_pct;
39 | this.battery_state = battery_state;
40 | this.is_ac_charge = is_ac_charge;
41 | this.is_charging = is_charging;
42 | this.is_usb_charge = is_usb_charge;
43 | }
44 |
45 | public String getBattery_level() {
46 | return battery_level;
47 | }
48 |
49 | public void setBattery_level(String battery_level) {
50 | this.battery_level = battery_level;
51 | }
52 |
53 | public String getBattery_max() {
54 | return battery_max;
55 | }
56 |
57 | public void setBattery_max(String battery_max) {
58 | this.battery_max = battery_max;
59 | }
60 |
61 | public int getBattery_pct() {
62 | return battery_pct;
63 | }
64 |
65 | public void setBattery_pct(int battery_pct) {
66 | this.battery_pct = battery_pct;
67 | }
68 |
69 | public int getBattery_state() {
70 | return battery_state;
71 | }
72 |
73 | public void setBattery_state(int battery_state) {
74 | this.battery_state = battery_state;
75 | }
76 |
77 | public int getIs_ac_charge() {
78 | return is_ac_charge;
79 | }
80 |
81 | public void setIs_ac_charge(int is_ac_charge) {
82 | this.is_ac_charge = is_ac_charge;
83 | }
84 |
85 | public int getIs_charging() {
86 | return is_charging;
87 | }
88 |
89 | public void setIs_charging(int is_charging) {
90 | this.is_charging = is_charging;
91 | }
92 |
93 | public int getIs_usb_charge() {
94 | return is_usb_charge;
95 | }
96 |
97 | public void setIs_usb_charge(int is_usb_charge) {
98 | this.is_usb_charge = is_usb_charge;
99 | }
100 | }
101 |
102 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/CalendarListBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/13
2 |
3 | import com.bin.david.form.annotation.SmartColumn;
4 | import com.bin.david.form.annotation.SmartTable;
5 |
6 | import java.io.Serializable;
7 | import java.util.List;
8 |
9 | // 作者:ITAEM 陈金城
10 | @SmartTable(name="日历事件")
11 | public class CalendarListBean implements Serializable {
12 | /**
13 | * description : string
14 | * end_time : 0
15 | * event_id : 0
16 | * event_title : string
17 | * reminders : [{"eventId":0,"method":0,"minutes":0,"reminder_id":0}]
18 | * start_time : 0
19 | */
20 | @SmartColumn(id =1,name = "description_事件描述")
21 | private String description; // 事件描述
22 | @SmartColumn(id =2,name = "end_time_事件结束时间(毫秒)")
23 | private String end_time; // 事件结束时间(毫秒)
24 | @SmartColumn(id =3,name = "event_id_事件ID")
25 | private String event_id; // 事件ID
26 | @SmartColumn(id =4,name = "event_title_事件标题")
27 | private String event_title; // 事件标题
28 | @SmartColumn(id =5,name = "start_time_事件开始时间(毫秒)")
29 | private String start_time; // 事件开始时间(毫秒)
30 | @SmartColumn(id =6,name = "reminders_提醒列表")
31 | private List reminders; // 提醒列表
32 |
33 | public CalendarListBean(String description, String end_time, String event_id, String event_title, String start_time, List reminders) {
34 | this.description = description;
35 | this.end_time = end_time;
36 | this.event_id = event_id;
37 | this.event_title = event_title;
38 | this.start_time = start_time;
39 | this.reminders = reminders;
40 | }
41 |
42 | public void setReminders(List reminders) {
43 | this.reminders = reminders;
44 | }
45 |
46 | public static class RemindersBean implements Serializable {
47 | /**
48 | * eventId : 0
49 | * method : 0
50 | * minutes : 0
51 | * reminder_id : 0
52 | */
53 |
54 | private int eventId;
55 | private int method;
56 | private int minutes;
57 | private int reminder_id;
58 |
59 | public RemindersBean(int eventId, int method, int minutes, int reminder_id) {
60 | this.eventId = eventId;
61 | this.method = method;
62 | this.minutes = minutes;
63 | this.reminder_id = reminder_id;
64 | }
65 |
66 | public int getEventId() {
67 | return eventId;
68 | }
69 |
70 | public void setEventId(int eventId) {
71 | this.eventId = eventId;
72 | }
73 |
74 | public int getMethod() {
75 | return method;
76 | }
77 |
78 | public void setMethod(int method) {
79 | this.method = method;
80 | }
81 |
82 | public int getMinutes() {
83 | return minutes;
84 | }
85 |
86 | public void setMinutes(int minutes) {
87 | this.minutes = minutes;
88 | }
89 |
90 | public int getReminder_id() {
91 | return reminder_id;
92 | }
93 |
94 | public void setReminder_id(int reminder_id) {
95 | this.reminder_id = reminder_id;
96 | }
97 | }
98 |
99 | public String getDescription() {
100 | return description;
101 | }
102 |
103 | public void setDescription(String description) {
104 | this.description = description;
105 | }
106 |
107 | public String getEnd_time() {
108 | return end_time;
109 | }
110 |
111 | public void setEnd_time(String end_time) {
112 | this.end_time = end_time;
113 | }
114 |
115 | public String getEvent_id() {
116 | return event_id;
117 | }
118 |
119 | public void setEvent_id(String event_id) {
120 | this.event_id = event_id;
121 | }
122 |
123 | public String getEvent_title() {
124 | return event_title;
125 | }
126 |
127 | public void setEvent_title(String event_title) {
128 | this.event_title = event_title;
129 | }
130 |
131 | public String getStart_time() {
132 | return start_time;
133 | }
134 |
135 | public void setStart_time(String start_time) {
136 | this.start_time = start_time;
137 | }
138 |
139 | public List getReminders() {
140 | return reminders;
141 | }
142 | }
143 |
144 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/GeneralDataBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/13
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 |
6 | // 作者:ITAEM 陈金城
7 | public class GeneralDataBean implements Serializable {
8 | /**
9 | * allowsVOIP : true
10 | * and_id : string
11 | * currentSystemTime : 0
12 | * elapsedRealtime : 0
13 | * gaid : string
14 | * imei : string
15 | * is_usb_debug : string
16 | * is_using_proxy_port : string
17 | * is_using_vpn : string
18 | * language : string
19 | * locale_display_language : string
20 | * locale_iso_3_country : string
21 | * locale_iso_3_language : string
22 | * mac : string
23 | * mobileCountryCode : string
24 | * mobileNetworkCode : string
25 | * network_operator_name : string
26 | * network_type : string
27 | * network_type_new : string
28 | * phone_number : string
29 | * phone_type : 0
30 | * sensor_list : [{"maxRange":"string","minDelay":"string","name":"string","power":"string","resolution":"string","type":"string","vendor":"string","version":"string"}]
31 | * serviceCurrentRadioAccessTechnology : string
32 | * time_zone_id : string
33 | * uptimeMillis : 0
34 | * uuid : string
35 | * wifi_mac : string
36 | */
37 |
38 | private String and_id; // android_id
39 | private String currentSystemTime; // 设备当前时间
40 | private String elapsedRealtime; // 开机时间到现在的毫秒数(包括睡眠时间)
41 | private String gaid; // google advertising id(google 广告 id)
42 | private String imei; // 设备号
43 | private boolean is_usb_debug; // 是否开启debug调试
44 | private boolean is_using_proxy_port; // 是否使用代理
45 | private boolean is_using_vpn; // 是否使用vpn
46 | private String language; // 语言
47 | private String locale_display_language; // 此用户显示的语言环境语言的名称
48 | private String locale_iso_3_country; // 此地区的国家/地区的缩写
49 | private String locale_country; // 此地区的国家
50 | private String locale_iso_3_language; // 语言环境的三字母缩写
51 | private String mac; // mac 地址
52 | private String network_operator_name; // 网络运营商名称
53 | private String network_type; // 网络类型 2G、3G、4G、5G、wifi、other、none
54 | private String phone_number; // 手机号
55 | private int phone_type; // 指示设备电话类型的常量。 这表示用于传输语音呼叫的无线电的类型
56 | // private String serviceCurrentRadioAccessTechnology; // 运营商无线接入技术
57 | private String time_zone_id; // 时区的 ID
58 | private String uptimeMillis; // 从开机到现在的毫秒数(不包括睡眠时间)
59 | private String threadTimeMillis;// 当前线程中运行的毫秒数,在主线程可以说是当前应用程序运行时间
60 | private String uuid; // 唯一标识 UUID.randomUUID().toString().toUpperCase()
61 |
62 | public GeneralDataBean( String and_id, String currentSystemTime, String elapsedRealtime, String gaid, String imei, boolean is_usb_debug, boolean is_using_proxy_port, boolean is_using_vpn, String language, String locale_display_language, String locale_iso_3_country,String locale_country, String locale_iso_3_language, String mac, String network_operator_name, String network_type, String phone_number, int phone_type, String time_zone_id, String uptimeMillis,String threadTimeMillis, String uuid) {
63 | this.and_id = and_id;
64 | this.currentSystemTime = currentSystemTime;
65 | this.elapsedRealtime = elapsedRealtime;
66 | this.gaid = gaid;
67 | this.imei = imei;
68 | this.is_usb_debug = is_usb_debug;
69 | this.is_using_proxy_port = is_using_proxy_port;
70 | this.is_using_vpn = is_using_vpn;
71 | this.language = language;
72 | this.locale_display_language = locale_display_language;
73 | this.locale_iso_3_country = locale_iso_3_country;
74 | this.locale_country = locale_country;
75 | this.locale_iso_3_language = locale_iso_3_language;
76 | this.mac = mac;
77 | this.network_operator_name = network_operator_name;
78 | this.network_type = network_type;
79 | this.phone_number = phone_number;
80 | this.phone_type = phone_type;
81 | // this.serviceCurrentRadioAccessTechnology = serviceCurrentRadioAccessTechnology;
82 | this.time_zone_id = time_zone_id;
83 | this.uptimeMillis = uptimeMillis;
84 | this.threadTimeMillis = threadTimeMillis;
85 | this.uuid = uuid;
86 | }
87 | public String getAnd_id() {
88 | return and_id;
89 | }
90 |
91 | public String getCurrentSystemTime() {
92 | return currentSystemTime;
93 | }
94 |
95 | public String getElapsedRealtime() {
96 | return elapsedRealtime;
97 | }
98 |
99 | public String getGaid() {
100 | return gaid;
101 | }
102 |
103 | public String getImei() {
104 | return imei;
105 | }
106 |
107 | public boolean isIs_usb_debug() {
108 | return is_usb_debug;
109 | }
110 |
111 | public boolean isIs_using_proxy_port() {
112 | return is_using_proxy_port;
113 | }
114 |
115 | public boolean isIs_using_vpn() {
116 | return is_using_vpn;
117 | }
118 |
119 | public String getLanguage() {
120 | return language;
121 | }
122 |
123 | public String getLocale_display_language() {
124 | return locale_display_language;
125 | }
126 |
127 | public String getLocale_iso_3_country() {
128 | return locale_iso_3_country;
129 | }
130 |
131 | public String getLocale_iso_3_language() {
132 | return locale_iso_3_language;
133 | }
134 |
135 | public String getMac() {
136 | return mac;
137 | }
138 |
139 | public String getNetwork_operator_name() {
140 | return network_operator_name;
141 | }
142 |
143 | public String getNetwork_type() {
144 | return network_type;
145 | }
146 |
147 |
148 | public String getThreadTimeMillis() {
149 | return threadTimeMillis;
150 | }
151 |
152 | public String getPhone_number() {
153 | return phone_number;
154 | }
155 |
156 | public int getPhone_type() {
157 | return phone_type;
158 | }
159 |
160 | public String getTime_zone_id() {
161 | return time_zone_id;
162 | }
163 |
164 | public String getUptimeMillis() {
165 | return uptimeMillis;
166 | }
167 |
168 | public String getUuid() {
169 | return uuid;
170 | }
171 |
172 | public String getLocale_country() {
173 | return locale_country;
174 | }
175 | }
176 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/HardwareBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/13
2 |
3 | import java.io.Serializable;
4 |
5 | // 作者:ITAEM 陈金城
6 | public class HardwareBean implements Serializable {
7 | /**
8 | * board : string
9 | * brand : string
10 | * cores : 0
11 | * device_height : 0
12 | * device_name : string
13 | * device_width : 0
14 | * model : string
15 | * physical_size : string
16 | * production_date : 0
17 | * release : string
18 | * sdk_version : string
19 | * serial_number : string
20 | */
21 |
22 | private String board; // 主板
23 | private String brand; // 设备品牌
24 | private String cores; // 设备内核
25 | private int device_height; // 分辨率高
26 | private String device_name; // 设备名称
27 | private int device_width; // 分辨率宽
28 | private String model; // 设备型号
29 | private String physical_size; // 物理尺寸
30 | private String production_date; // 手机出厂时间戳
31 | private String release; // 系统版本
32 | private String sdk_version; // SDK版本
33 | private String serial_number; // 设备序列号
34 |
35 | public HardwareBean(String board, String brand, String cores, int device_height, String device_name, int device_width, String model, String physical_size, String production_date, String release, String sdk_version, String serial_number) {
36 | this.board = board==null?"":board;
37 | this.brand = brand==null?"":brand;
38 | this.cores = cores;
39 | this.device_height = device_height;
40 | this.device_name = device_name==null?"":device_name;
41 | this.device_width = device_width;
42 | this.model = model==null?"":model;
43 | this.physical_size = physical_size ==null?"":physical_size;
44 | this.production_date = production_date ==null?"":production_date;
45 | this.release = release ==null?"":release;
46 | this.sdk_version = sdk_version==null?"":sdk_version;
47 | this.serial_number = serial_number==null?"":serial_number;
48 | }
49 |
50 | public String getBrand() {
51 | return brand;
52 | }
53 |
54 | public int getDevice_height() {
55 | return device_height;
56 | }
57 |
58 | public int getDevice_width() {
59 | return device_width;
60 | }
61 |
62 | public String getBoard() {
63 | return board;
64 | }
65 |
66 | public String getCores() {
67 | return cores;
68 | }
69 |
70 | public String getDevice_name() {
71 | return device_name;
72 | }
73 |
74 | public String getModel() {
75 | return model;
76 | }
77 |
78 | public String getPhysical_size() {
79 | return physical_size;
80 | }
81 |
82 | public String getProduction_date() {
83 | return production_date;
84 | }
85 |
86 | public String getRelease() {
87 | return release;
88 | }
89 |
90 | public String getSdk_version() {
91 | return sdk_version;
92 | }
93 |
94 | public String getSerial_number() {
95 | return serial_number;
96 | }
97 | }
98 |
99 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/NetworkBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/13
2 |
3 | import com.bin.david.form.annotation.SmartColumn;
4 | import com.bin.david.form.annotation.SmartTable;
5 |
6 | import java.io.Serializable;
7 | import java.util.List;
8 |
9 | // 作者:ITAEM 陈金城
10 | @SmartTable(name="网络数据")
11 | public class NetworkBean implements Serializable {
12 | /**
13 | * configured_wifi : [{"bssid":"string","mac":"string","name":"string","ssid":"string"}]
14 | * current_wifi : {"bssid":"string","mac":"string","name":"string","ssid":"string"}
15 | * ip : string
16 | * wifi_count : 0
17 | */
18 | @SmartColumn(id =1,name = "current_wifi_当前WIFI")
19 | private CurrentWifiBean current_wifi; // 当前WIFI
20 | @SmartColumn(id =2,name = "ip_网络IP(内网)")
21 | private String ip; // 网络IP(内网)
22 | @SmartColumn(id =3,name = "wifi_count_wifi 个数")
23 | private int wifi_count; // wifi 个数
24 | @SmartColumn(id =4,name = "configured_wifi_配置WIFI")
25 | private List configured_wifi; // 配置WIFI,附近的wifi
26 |
27 | public NetworkBean() {
28 | }
29 |
30 | public NetworkBean(CurrentWifiBean current_wifi, String ip, int wifi_count, List configured_wifi) {
31 | this.current_wifi = current_wifi;
32 | this.ip = ip;
33 | this.wifi_count = wifi_count;
34 | this.configured_wifi = configured_wifi;
35 | }
36 |
37 | public CurrentWifiBean getCurrent_wifi() {
38 | return current_wifi;
39 | }
40 |
41 | public List getConfigured_wifi() {
42 | return configured_wifi;
43 | }
44 |
45 | public void setCurrent_wifi(CurrentWifiBean current_wifi) {
46 | this.current_wifi = current_wifi;
47 | }
48 |
49 | public String getIp() {
50 | return ip;
51 | }
52 |
53 | public void setIp(String ip) {
54 | this.ip = ip;
55 | }
56 |
57 | public int getWifi_count() {
58 | return wifi_count;
59 | }
60 |
61 | public void setWifi_count(int wifi_count) {
62 | this.wifi_count = wifi_count;
63 | }
64 |
65 | public void setConfigured_wifi(List configured_wifi) {
66 | this.configured_wifi = configured_wifi;
67 | }
68 |
69 | @SmartTable(name="当前wifi详情")
70 | public static class CurrentWifiBean implements Serializable {
71 | /**
72 | * bssid : string
73 | * mac : string
74 | * name : string
75 | * ssid : string
76 | */
77 | @SmartColumn(id =1,name = "bssid")
78 | private String bssid;
79 | @SmartColumn(id =2,name = "mac")
80 | private String mac;
81 | @SmartColumn(id =3,name = "name")
82 | private String name;
83 | @SmartColumn(id =4,name = "ssid")
84 | private String ssid;
85 |
86 | public CurrentWifiBean(String bssid, String mac, String name, String ssid) {
87 | this.bssid = bssid==null||bssid.equals("02:00:00:00:00:00")?"":bssid;
88 | this.mac = mac==null||mac.equals("02:00:00:00:00:00")?"":mac;
89 | this.name = name==null||name.equals("")?"":name;
90 | this.ssid = ssid==null||ssid.equals("")?"":ssid;
91 | }
92 |
93 | public String getBssid() {
94 | return bssid;
95 | }
96 |
97 | public void setBssid(String bssid) {
98 | this.bssid = bssid;
99 | }
100 |
101 | public String getMac() {
102 | return mac;
103 | }
104 |
105 | public void setMac(String mac) {
106 | this.mac = mac;
107 | }
108 |
109 | public String getName() {
110 | return name;
111 | }
112 |
113 | public void setName(String name) {
114 | this.name = name;
115 | }
116 |
117 | public String getSsid() {
118 | return ssid;
119 | }
120 |
121 | public void setSsid(String ssid) {
122 | this.ssid = ssid;
123 | }
124 | }
125 | @SmartTable(name="所有wifi详情")
126 | public static class ConfiguredWifiBean implements Serializable {
127 | /**
128 | * bssid : string
129 | * mac : string
130 | * name : string
131 | * ssid : string
132 | */
133 | @SmartColumn(id =1,name = "bssid")
134 | private String bssid;
135 | @SmartColumn(id =2,name = "mac")
136 | private String mac;
137 | @SmartColumn(id =3,name = "name")
138 | private String name;
139 | @SmartColumn(id =4,name = "ssid")
140 | private String ssid;
141 |
142 | public ConfiguredWifiBean(String bssid, String mac, String name, String ssid) {
143 | this.bssid = bssid==null||bssid.equals("02:00:00:00:00:00")?"":bssid;
144 | this.mac = mac==null||mac.equals("02:00:00:00:00:00")?"":mac;
145 | this.name = name==null||name.equals("")?"":name;
146 | this.ssid = ssid==null||ssid.equals("")?"":ssid;
147 | }
148 |
149 | public String getBssid() {
150 | return bssid;
151 | }
152 |
153 | public void setBssid(String bssid) {
154 | this.bssid = bssid;
155 | }
156 |
157 | public String getMac() {
158 | return mac;
159 | }
160 |
161 | public void setMac(String mac) {
162 | this.mac = mac;
163 | }
164 |
165 | public String getName() {
166 | return name;
167 | }
168 |
169 | public void setName(String name) {
170 | this.name = name;
171 | }
172 |
173 | public String getSsid() {
174 | return ssid;
175 | }
176 |
177 | public void setSsid(String ssid) {
178 | this.ssid = ssid;
179 | }
180 | }
181 | }
182 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/NewStorageBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/13
2 |
3 | import java.io.Serializable;
4 |
5 | // 作者:ITAEM 陈金城
6 | public class NewStorageBean implements Serializable {
7 | /**
8 | * activeMemory : 0
9 | * app_free_memory : string
10 | * app_max_memory : string
11 | * app_total_memory : string
12 | * contain_sd : string
13 | * extra_sd : string
14 | * freeMemory : 0
15 | * inActiveMemory : 0
16 | * internal_storage_total : 0
17 | * internal_storage_usable : 0
18 | * memory_card_free_size : 0
19 | * memory_card_size : 0
20 | * memory_card_size_use : 0
21 | * memory_card_usable_size : 0
22 | * purgableMemory : 0
23 | * ram_total_size : string
24 | * ram_usable_size : string
25 | * totalMemory : 0
26 | * usedMemory : 0
27 | * wiredMemory : 0
28 | */
29 |
30 | // private String activeMemory; // 活动内存 单位Byte)
31 | private String app_free_memory; // app可用内存大小 单位Byte)
32 |
33 | private String app_max_memory; // app最大内存大小 单位Byte)
34 | private String app_total_memory;// app总内存大小 单位Byte)
35 | private String contain_sd; // 是否有内置的SD卡(0否,1是)
36 | private String extra_sd; // 是否有外置的SD卡(0否,1是)
37 | // private String freeMemory; //内存空闲大小 单位Byte)
38 | // private String inActiveMemory; // 不活动内存 单位Byte)
39 | private String internal_storage_total; // 总存储大小 单位Byte)
40 | private String internal_storage_usable; // 可用存储大小 单位Byte)
41 | private String memory_card_free_size; // 内存卡剩余使用量 单位Byte)
42 | private String memory_card_size; // 内存卡大小 单位Byte)
43 | private String memory_card_size_use; // 内存卡已使用量 单位Byte)
44 | private String memory_card_usable_size; // 内存卡可使用量 单位Byte)
45 | // private String purgableMemory; // 可清理内存 单位Byte)
46 | private String ram_total_size; // 总内存大小( 单位Byte)
47 | private String ram_usable_size; // 内存可用大小 单位Byte)
48 | private String ram_threshold;// 低内存阙值
49 | // private String totalMemory; // 总内存大小( 单位Byte)
50 | // private String usedMemory; // 已用内存 单位Byte)
51 | // private String wiredMemory; // 保留内存 单位Byte)
52 |
53 |
54 |
55 | public String getInternal_storage_total() {
56 | return internal_storage_total;
57 | }
58 |
59 | public String getInternal_storage_usable() {
60 | return internal_storage_usable;
61 | }
62 |
63 | public String getApp_free_memory() {
64 | return app_free_memory;
65 | }
66 |
67 | public String getApp_max_memory() {
68 | return app_max_memory;
69 | }
70 |
71 | public String getApp_total_memory() {
72 | return app_total_memory;
73 | }
74 |
75 | public String getContain_sd() {
76 | return contain_sd;
77 | }
78 |
79 | public String getExtra_sd() {
80 | return extra_sd;
81 | }
82 |
83 | public String getMemory_card_free_size() {
84 | return memory_card_free_size;
85 | }
86 |
87 | public String getMemory_card_size() {
88 | return memory_card_size;
89 | }
90 |
91 | public String getMemory_card_size_use() {
92 | return memory_card_size_use;
93 | }
94 |
95 | public String getMemory_card_usable_size() {
96 | return memory_card_usable_size;
97 | }
98 |
99 | public String getRam_total_size() {
100 | return ram_total_size;
101 | }
102 |
103 | public String getRam_usable_size() {
104 | return ram_usable_size;
105 | }
106 |
107 | public String getRam_threshold() {
108 | return ram_threshold;
109 | }
110 |
111 | public void setApp_free_memory(String app_free_memory) {
112 | this.app_free_memory = app_free_memory;
113 | }
114 |
115 | public void setApp_max_memory(String app_max_memory) {
116 | this.app_max_memory = app_max_memory;
117 | }
118 |
119 | public void setApp_total_memory(String app_total_memory) {
120 | this.app_total_memory = app_total_memory;
121 | }
122 |
123 |
124 | public void setInternal_storage_total(String internal_storage_total) {
125 | this.internal_storage_total = internal_storage_total;
126 | }
127 |
128 | public void setInternal_storage_usable(String internal_storage_usable) {
129 | this.internal_storage_usable = internal_storage_usable;
130 | }
131 |
132 | public void setExtra_sd(String extra_sd) {
133 | this.extra_sd = extra_sd;
134 | }
135 |
136 | public void setRam_total_size(String ram_total_size) {
137 | this.ram_total_size = ram_total_size;
138 | }
139 |
140 | public void setRam_usable_size(String ram_usable_size) {
141 | this.ram_usable_size = ram_usable_size;
142 | }
143 |
144 | public void setContain_sd(String contain_sd) {
145 | this.contain_sd = contain_sd;
146 | }
147 |
148 | public void setMemory_card_free_size(String memory_card_free_size) {
149 | this.memory_card_free_size = memory_card_free_size;
150 | }
151 |
152 | public void setMemory_card_size(String memory_card_size) {
153 | this.memory_card_size = memory_card_size;
154 | }
155 |
156 | public void setMemory_card_size_use(String memory_card_size_use) {
157 | this.memory_card_size_use = memory_card_size_use;
158 | }
159 |
160 | public void setMemory_card_usable_size(String memory_card_usable_size) {
161 | this.memory_card_usable_size = memory_card_usable_size;
162 | }
163 |
164 | public void setRam_threshold(String ram_threshold) {
165 | this.ram_threshold = ram_threshold;
166 | }
167 | }
168 |
169 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/OtherDataBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/13
2 |
3 | import java.io.Serializable;
4 |
5 | // 作者:ITAEM 陈金城
6 | public class OtherDataBean implements Serializable {
7 | /**
8 | * dbm : string
9 | * dbmClass : 0
10 | * keyboard : 0
11 | * last_boot_time : 0
12 | * root_jailbreak : 0
13 | * simulator : 0
14 | */
15 |
16 | private String dbm; // 手机的信号强度 默认值-1
17 | // private int dbmClass;
18 | // private int keyboard; // 连接到设备的键盘种类
19 | private String last_boot_time; // 最后一次启动时间
20 | private int root_jailbreak; // 是否 root
21 | private int simulator; // 是否为模拟器
22 |
23 | public OtherDataBean(String dbm, String last_boot_time, int root_jailbreak, int simulator) {
24 | this.dbm = dbm;
25 | // dbmClass = 0;
26 | // this.keyboard = keyboard;
27 | this.last_boot_time = last_boot_time;
28 | this.root_jailbreak = root_jailbreak;
29 | this.simulator = simulator;
30 | }
31 |
32 | public String getDbm() {
33 | return dbm;
34 | }
35 |
36 | public String getLast_boot_time() {
37 | return last_boot_time;
38 | }
39 |
40 | public int getRoot_jailbreak() {
41 | return root_jailbreak;
42 | }
43 |
44 | public int getSimulator() {
45 | return simulator;
46 | }
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/PhotoInfosBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/13
2 |
3 | import com.bin.david.form.annotation.SmartColumn;
4 | import com.bin.david.form.annotation.SmartTable;
5 |
6 | import java.io.Serializable;
7 |
8 | // 作者:ITAEM 陈金城
9 | @SmartTable(name="照片数据")
10 | public class PhotoInfosBean implements Serializable {
11 | /**
12 | * addTime : 0
13 | * author : string
14 | * createTime : string
15 | * date : string
16 | * flash : string
17 | * focal_length : string
18 | * gps_altitude : string
19 | * gps_processing_method : string
20 | * height : string
21 | * latitude : 0
22 | * lens_make : string
23 | * lens_model : string
24 | * longitude : 0
25 | * model : string
26 | * name : string
27 | * orientation : string
28 | * save_time : string
29 | * software : string
30 | * take_time : string
31 | * updateTime : 0
32 | * width : string
33 | * x_resolution : string
34 | * y_resolution : string
35 | */
36 | @SmartColumn(id =1,name = "addTime_添加数据库时间(保存)")
37 | private String addTime; //
38 | @SmartColumn(id =2,name = "author_照片作者")
39 | private String author; // 照片作者,获取不到传空字符串
40 | @SmartColumn(id =3,name = "createTime_照片读取时间(毫秒数时间戳),即当前时间")
41 | private String createTime; // 照片读取时间(毫秒数时间戳),即当前时间
42 | @SmartColumn(id =4,name = "date_拍照时间(毫秒数时间戳)")
43 | private String date; // 拍照时间(毫秒数时间戳),获取不到传空字符串
44 | @SmartColumn(id =5,name = "flash_闪光灯")
45 | private String flash; // 闪光灯,获取不到传空字符串
46 | @SmartColumn(id =6,name = "focal_length_镜头的实际焦距")
47 | private String focal_length; // 镜头的实际焦距,获取不到传空字符串
48 | @SmartColumn(id =7,name = "gps_altitude_海拔高度,获取方法传默认值getAltitude(0.0)")
49 | private String gps_altitude; // 海拔高度,获取方法传默认值getAltitude(0.0)
50 | @SmartColumn(id =8,name = "gps_processing_method_定位的方法名称")
51 | private String gps_processing_method; // 定位的方法名称,获取不到传空字符串
52 | @SmartColumn(id =8,name = "height_照片高度")
53 | private String height; // 照片高度,获取不到传空字符串
54 | @SmartColumn(id =9,name = "latitude_照片拍摄时的经度")
55 | private int latitude; // 照片拍摄时的经度,获取不到传null
56 | @SmartColumn(id =10,name = "lens_make_ 镜头制造商")
57 | private String lens_make; // 镜头制造商,获取不到传空字符串
58 | @SmartColumn(id =11,name = "lens_model_ 镜头的序列号")
59 | private String lens_model; // 镜头的序列号,获取不到传空字符串
60 | @SmartColumn(id =12,name = "longitude_照片拍摄时的纬度")
61 | private int longitude; // 照片拍摄时的纬度,获取不到传null
62 | @SmartColumn(id =13,name = "model_拍照机型")
63 | private String model; // 拍照机型,获取不到传空字符串
64 | @SmartColumn(id =14,name = "name_照片名称")
65 | private String name; // 照片名称,获取不到传空字符串
66 | @SmartColumn(id =15,name = "orientation_照片方向")
67 | private String orientation; // 照片方向,获取不到传空字符串
68 | @SmartColumn(id =16,name = "save_time_照片修改时间(毫秒数时间戳)")
69 | private String save_time; // 照片修改时间(毫秒数时间戳),获取不到传空字符串
70 | @SmartColumn(id =17,name = "software_生成图像的相机或图像输入设备的软件或固件的名称和版本")
71 | private String software; // 生成图像的相机或图像输入设备的软件或固件的名称和版本,获取不到传空字符串
72 | @SmartColumn(id =18,name = "take_time_创建时间(毫秒数时间戳)")
73 | private String take_time; // 创建时间(毫秒数时间戳),获取不到传空字符串
74 | @SmartColumn(id =19,name = "path_路径")
75 | private String path; //
76 | @SmartColumn(id =20,name = "updateTime_编辑时间")
77 | private String updateTime; //
78 | @SmartColumn(id =21,name = "width_照片宽度")
79 | private String width; // 照片宽度,获取不到传空字符串
80 | @SmartColumn(id =22,name = "x_resolution_X方向上每个分辨率的像素数")
81 | private String x_resolution; // X方向上每个分辨率的像素数,获取不到传空字符串
82 | @SmartColumn(id =23,name = "y_resolution_Y方向上每个分辨率的像素数")
83 | private String y_resolution; // Y方向上每个分辨率的像素数,获取不到传空字符串
84 |
85 | public PhotoInfosBean(String addTime,String updateTime,String author, String createTime, String date, String gps_processing_method,
86 | String height, int latitude, int longitude, String width, String name, String model,
87 | String orientation, String save_time, String take_time) {
88 | this.addTime = addTime;
89 | this.updateTime = updateTime;
90 | this.author = author;
91 | this.createTime = createTime;
92 | this.date = date;
93 | this.gps_processing_method = gps_processing_method;
94 | this.height = height;
95 | this.latitude = latitude;
96 | this.longitude = longitude;
97 | this.width = width;
98 | this.name = name;
99 | this.model = model;
100 | this.orientation = orientation;
101 | this.save_time = save_time;
102 | this.take_time = take_time;
103 | }
104 |
105 | public void setFlash(String flash) {
106 | this.flash = flash;
107 | }
108 |
109 | public void setFocal_length(String focal_length) {
110 | this.focal_length = focal_length;
111 | }
112 | public void setLens_make(String lens_make) {
113 | this.lens_make = lens_make;
114 | }
115 |
116 | public void setLens_model(String lens_model) {
117 | this.lens_model = lens_model;
118 | }
119 |
120 | public void setSoftware(String software) {
121 | this.software = software;
122 | }
123 |
124 | public void setX_resolution(String x_resolution) {
125 | this.x_resolution = x_resolution;
126 | }
127 |
128 | public void setY_resolution(String y_resolution) {
129 | this.y_resolution = y_resolution;
130 | }
131 |
132 | public void setGps_altitude(String gps_altitude) {
133 | this.gps_altitude = gps_altitude;
134 | }
135 |
136 | public void setAuthor(String author) {
137 | this.author = author;
138 | }
139 |
140 | public String getPath() {
141 | return path;
142 | }
143 |
144 | public void setPath(String path) {
145 | this.path = path;
146 | }
147 |
148 | public String getAddTime() {
149 | return addTime;
150 | }
151 |
152 | public void setAddTime(String addTime) {
153 | this.addTime = addTime;
154 | }
155 |
156 | public String getAuthor() {
157 | return author;
158 | }
159 |
160 | public String getCreateTime() {
161 | return createTime;
162 | }
163 |
164 | public void setCreateTime(String createTime) {
165 | this.createTime = createTime;
166 | }
167 |
168 | public String getDate() {
169 | return date;
170 | }
171 |
172 | public void setDate(String date) {
173 | this.date = date;
174 | }
175 |
176 | public String getFlash() {
177 | return flash;
178 | }
179 |
180 | public String getFocal_length() {
181 | return focal_length;
182 | }
183 |
184 | public String getGps_altitude() {
185 | return gps_altitude;
186 | }
187 |
188 | public String getGps_processing_method() {
189 | return gps_processing_method;
190 | }
191 |
192 | public void setGps_processing_method(String gps_processing_method) {
193 | this.gps_processing_method = gps_processing_method;
194 | }
195 |
196 | public String getHeight() {
197 | return height;
198 | }
199 |
200 | public void setHeight(String height) {
201 | this.height = height;
202 | }
203 |
204 | public int getLatitude() {
205 | return latitude;
206 | }
207 |
208 | public void setLatitude(int latitude) {
209 | this.latitude = latitude;
210 | }
211 |
212 | public String getLens_make() {
213 | return lens_make;
214 | }
215 |
216 | public String getLens_model() {
217 | return lens_model;
218 | }
219 |
220 | public int getLongitude() {
221 | return longitude;
222 | }
223 |
224 | public void setLongitude(int longitude) {
225 | this.longitude = longitude;
226 | }
227 |
228 | public String getModel() {
229 | return model;
230 | }
231 |
232 | public void setModel(String model) {
233 | this.model = model;
234 | }
235 |
236 | public String getName() {
237 | return name;
238 | }
239 |
240 | public void setName(String name) {
241 | this.name = name;
242 | }
243 |
244 | public String getOrientation() {
245 | return orientation;
246 | }
247 |
248 | public void setOrientation(String orientation) {
249 | this.orientation = orientation;
250 | }
251 |
252 | public String getSave_time() {
253 | return save_time;
254 | }
255 |
256 | public void setSave_time(String save_time) {
257 | this.save_time = save_time;
258 | }
259 |
260 | public String getSoftware() {
261 | return software;
262 | }
263 |
264 | public String getTake_time() {
265 | return take_time;
266 | }
267 |
268 | public void setTake_time(String take_time) {
269 | this.take_time = take_time;
270 | }
271 |
272 | public String getUpdateTime() {
273 | return updateTime;
274 | }
275 |
276 | public void setUpdateTime(String updateTime) {
277 | this.updateTime = updateTime;
278 | }
279 |
280 | public String getWidth() {
281 | return width;
282 | }
283 |
284 | public void setWidth(String width) {
285 | this.width = width;
286 | }
287 |
288 | public String getX_resolution() {
289 | return x_resolution;
290 | }
291 |
292 | public String getY_resolution() {
293 | return y_resolution;
294 | }
295 | }
296 |
297 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/SensorListBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/27
2 |
3 | import com.bin.david.form.annotation.SmartColumn;
4 | import com.bin.david.form.annotation.SmartTable;
5 |
6 | import java.io.Serializable;
7 |
8 | // 作者:ITAEM 陈金城
9 | @SmartTable(name="传感器信息")
10 | public class SensorListBean implements Serializable {
11 | /**
12 | * maxRange : string //传感器单元中传感器的最大量程
13 | * minDelay : string //
14 | * name : string
15 | * power : string
16 | * resolution : string
17 | * type : string
18 | * vendor : string
19 | * version : string
20 | */
21 | @SmartColumn(id =1,name = "id_传感器id,0不支持功能,-1即其类型和名称的组合在系统中唯一标识。-2获取活到")
22 | private String id;
23 | @SmartColumn(id =2,name = "maxRange_最大量程")
24 | private String maxRange;
25 | @SmartColumn(id =3,name = "minDelay_最小延迟")
26 | private String minDelay;
27 | @SmartColumn(id =4,name = "name_传感器名称")
28 | private String name;
29 | @SmartColumn(id =5,name = "power_使用时功率")
30 | private String power;
31 | @SmartColumn(id =6,name = "resolution_分辨率")
32 | private String resolution;
33 | @SmartColumn(id =7,name = "type_通用类型")
34 | private String type;
35 | @SmartColumn(id =8,name = "vendor_厂商字符串")
36 | private String vendor;
37 | @SmartColumn(id =9,name = "version_版本")
38 | private String version;
39 | @SmartColumn(id =10,name = "RequiredPermission_访问所需权限")
40 | private String RequiredPermission;
41 |
42 | public SensorListBean(String id,String maxRange, String minDelay, String name, String power, String resolution, String type, String vendor, String version) {
43 | this.id = id;
44 | this.maxRange = maxRange;
45 | this.minDelay = minDelay;
46 | this.name = name;
47 | this.power = power;
48 | this.resolution = resolution;
49 | this.type = type;
50 | this.vendor = vendor;
51 | this.version = version;
52 | }
53 |
54 | public String getId() {
55 | return id;
56 | }
57 |
58 | public void setId(String id) {
59 | this.id = id;
60 | }
61 |
62 | public String getMaxRange() {
63 | return maxRange;
64 | }
65 |
66 | public void setMaxRange(String maxRange) {
67 | this.maxRange = maxRange;
68 | }
69 |
70 | public String getMinDelay() {
71 | return minDelay;
72 | }
73 |
74 | public void setMinDelay(String minDelay) {
75 | this.minDelay = minDelay;
76 | }
77 |
78 | public String getName() {
79 | return name;
80 | }
81 |
82 | public void setName(String name) {
83 | this.name = name;
84 | }
85 |
86 | public String getPower() {
87 | return power;
88 | }
89 |
90 | public void setPower(String power) {
91 | this.power = power;
92 | }
93 |
94 | public String getResolution() {
95 | return resolution;
96 | }
97 |
98 | public void setResolution(String resolution) {
99 | this.resolution = resolution;
100 | }
101 |
102 | public String getType() {
103 | return type;
104 | }
105 |
106 | public void setType(String type) {
107 | this.type = type;
108 | }
109 |
110 | public String getVendor() {
111 | return vendor;
112 | }
113 |
114 | public void setVendor(String vendor) {
115 | this.vendor = vendor;
116 | }
117 |
118 | public String getVersion() {
119 | return version;
120 | }
121 |
122 | public void setVersion(String version) {
123 | this.version = version;
124 | }
125 |
126 | public String getRequiredPermission() {
127 | return RequiredPermission;
128 | }
129 |
130 | public void setRequiredPermission(String requiredPermission) {
131 | RequiredPermission = requiredPermission;
132 | }
133 | }
134 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/ShowListBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/11/9
2 |
3 | // 作者:ITAEM 陈金城
4 | public abstract class ShowListBean {
5 | }
6 |
--------------------------------------------------------------------------------
/DataCapture/src/main/java/com/itaem/datacapture/bean/SmsBean.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.bean;// 2023/8/13
2 |
3 | import com.bin.david.form.annotation.SmartColumn;
4 | import com.bin.david.form.annotation.SmartTable;
5 |
6 | import java.io.Serializable;
7 |
8 | // 作者:ITAEM 陈金城
9 | @SmartTable(name="短信")
10 | public class SmsBean implements Serializable {
11 | /**
12 | * content : string
13 | * other_phone : string
14 | * package_name : string
15 | * read : 0
16 | * seen : 0
17 | * status : 0
18 | * subject : string
19 | * time : string
20 | * type : string
21 | */
22 | @SmartColumn(id =1,name = "content_短信消息体")
23 | private String content; // 短信消息体
24 | @SmartColumn(id =2,name = "other_phone_收件⼈/发件⼈⼿机号")
25 | private String other_phone; // 收件⼈/发件⼈⼿机号
26 | @SmartColumn(id =3,name = "package_name_包名")
27 | private String package_name; // 包名
28 | @SmartColumn(id =4,name = "read_短信状态 0-未读,1-已读")
29 | private int read; // 短信状态 0-未读,1-已读
30 | @SmartColumn(id =5,name = "seen_短信是否被用户看到 0-尚未查看,1-已查看")
31 | private int seen; // 短信是否被用户看到 0-尚未查看,1-已查看
32 | @SmartColumn(id =6,name = "status_短信状态:-1表示接收,0-complete,64-pending,128-failed")
33 | private int status; // 短信状态:-1表示接收,0-complete,64-pending,128-failed
34 | @SmartColumn(id =7,name = "subject_短信主题")
35 | private String subject; // 短信主题
36 | @SmartColumn(id =8,name = "time_收到短信的时间戳(毫秒),long型")
37 | private String time; // 收到短信的时间戳(毫秒),long型
38 | @SmartColumn(id =9,name = "type_短信类型:1-接收短信,2-已发出短信")
39 | private String type; // 短信类型:1-接收短信,2-已发出短信
40 |
41 | public SmsBean(String content, String other_phone, String package_name, int read, int seen, int status, String subject, String time, String type) {
42 | this.content = content;
43 | this.other_phone = other_phone;
44 | this.package_name = package_name;
45 | this.read = read;
46 | this.seen = seen;
47 | this.status = status;
48 | this.subject = subject;
49 | this.time = time;
50 | this.type = type;
51 | }
52 |
53 | public String getContent() {
54 | return content;
55 | }
56 |
57 | public void setContent(String content) {
58 | this.content = content;
59 | }
60 |
61 | public String getOther_phone() {
62 | return other_phone;
63 | }
64 |
65 | public void setOther_phone(String other_phone) {
66 | this.other_phone = other_phone;
67 | }
68 |
69 | public String getPackage_name() {
70 | return package_name;
71 | }
72 |
73 | public void setPackage_name(String package_name) {
74 | this.package_name = package_name;
75 | }
76 |
77 | public int getRead() {
78 | return read;
79 | }
80 |
81 | public void setRead(int read) {
82 | this.read = read;
83 | }
84 |
85 | public int getSeen() {
86 | return seen;
87 | }
88 |
89 | public void setSeen(int seen) {
90 | this.seen = seen;
91 | }
92 |
93 | public int getStatus() {
94 | return status;
95 | }
96 |
97 | public void setStatus(int status) {
98 | this.status = status;
99 | }
100 |
101 | public String getSubject() {
102 | return subject;
103 | }
104 |
105 | public void setSubject(String subject) {
106 | this.subject = subject;
107 | }
108 |
109 | public String getTime() {
110 | return time;
111 | }
112 |
113 | public void setTime(String time) {
114 | this.time = time;
115 | }
116 |
117 | public String getType() {
118 | return type;
119 | }
120 |
121 | public void setType(String type) {
122 | this.type = type;
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/DataCapture/src/test/java/com/itaem/datacapture/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DataCapture
2 | 对手机设备的信息数据抓取,目前支持在子线程抓取数据,因为有些数据量过于庞大会阻塞线程,可抓取数据有:
3 |
4 | 习惯性上图展示:
5 |
6 | 
7 |
8 | 体验demo:(密码:aoc8)
9 |
10 | 
11 |
12 | 1.通讯录集合数据
13 | | 字段名 | 详情 |
14 | |--|--|
15 | | contact_display_name |联系人名称|
16 | | last_time_contacted | 上次通讯时间(毫秒) |
17 | | number |联系人手机号 |
18 | | times_contacted |联系次数|
19 | | up_time | 编辑时间(毫秒)) |
20 | | type |通话类型|
21 |
22 | 2.应用列表集合数据
23 | | 字段名 | 详情 |
24 | |--|--|
25 | | app_name |APP名称|
26 | | app_type | 是否系统app 0:非系统app 1:系统app |
27 | | app_version |APP版本 |
28 | | in_time |安装时间(毫秒)|
29 | | obtain_time | 数据抓取时间(秒)) |
30 | | package_name |包名|
31 | | up_time |更新时间 (毫秒)|
32 | | version_code | 版本号 |
33 |
34 | 3.日历事件信息数据
35 | | 字段名 | 详情 |
36 | |--|--|
37 | | description |事件描述|
38 | | end_time | 事件结束时间(毫秒) |
39 | | event_id |事件ID |
40 | | event_title |事件标题|
41 | | start_time | 事件开始时间(毫秒)) |
42 | | reminders |提醒列表|
43 |
44 | 4.电量信息数据
45 | | 字段名 | 详情 |
46 | |--|--|
47 | | battery_level |电池电量|
48 | | battery_max |电池容量 |
49 | | battery_pct |电池百分比 |
50 | | battery_state |电池状态 充电0 不充电1|
51 | | is_ac_charge | 是否交流充电(1:yes,0:no) |
52 | | is_charging |是否正在充电|
53 | | is_usb_charge |是否USB充电(1:yes,0:no)|
54 |
55 | 5.sms短信信息数据
56 | | 字段名 | 详情 |
57 | |--|--|
58 | | content |短信消息体|
59 | | other_phone |收件⼈/发件⼈⼿机号 |
60 | | package_name |包名 |
61 | | read | 短信状态 0-未读,1-已读|
62 | | seen | 短信是否被用户看到 0-尚未查看,1-已查看 |
63 | | status |短信状态:-1表示接收,0-complete,64-pending,128-failed|
64 | | subject |短信主题|
65 | | time |收到短信的时间戳(毫秒),long型|
66 | | type |短信类型:1-接收短信,2-已发出短信|
67 |
68 | 6.照片集合信息数据
69 | | 字段名 | 详情 |
70 | |--|--|
71 | | addTime |添加数据库时间(保存)|
72 | | author |照片作者 |
73 | | createTime |照片读取时间(毫秒数时间戳),即当前时间 |
74 | | date | 拍照时间(毫秒数时间戳)|
75 | | flash | 闪光灯 |
76 | | focal_length |镜头的实际焦距|
77 | | gps_altitude |海拔高度|
78 | | gps_processing_method | 定位的方法名称|
79 | | height | 照片高度|
80 | | latitude | 照片拍摄时的经度 |
81 | | lens_make |镜头制造商|
82 | | lens_model |镜头的序列号|
83 | | longitude | 照片拍摄时的纬度|
84 | | model | 拍照机型|
85 | | name | 照片名称|
86 | | orientation | 照片方向|
87 | | save_time | 照片修改时间|
88 | | software | 生成图像的相机或图像输入设备的软件或固件的名称和版本|
89 | | take_time | 创建时间(毫秒数时间戳)|
90 | | updateTime | 编辑时间|
91 | | width | 照片宽度|
92 | | x_resolution | X方向上每个分辨率的像素数|
93 | | y_resolution | Y方向上每个分辨率的像素数|
94 |
95 | 7.传感器信息数据
96 | | 字段名 | 详情 |
97 | |--|--|
98 | | id |传感器id,0不支持功能,-1即其类型和名称的组合在系统中唯一标识。-2获取不到|
99 | | maxRange |传感器单元中传感器的最大量程|
100 | | minDelay |两个事件之间允许的最小延迟(以微秒为单位),如果此传感器仅在其测量的数据发生变化时返回值,则为零|
101 | | name | 传感器名称|
102 | | power | 使用时功率 |
103 | | resolution |传感器单元中传感器的分辨率|
104 | | type |该传感器的通用类型|
105 | | name | 传感器名称|
106 | | vendor | 厂商字符串 |
107 | | version |版本|
108 |
109 | 8.wifi信息数据
110 | | 字段名 | 详情 |
111 | |--|--|
112 | | current_wifi |当前WIFI详情|
113 | | ip |网络IP(内网)|
114 | | wifi_count | wifi 个数|
115 | | configured_wifi | 配置WIFI,附近的wifi|
116 |
117 | 8.1 wifi详情
118 | | 字段名 | 详情 |
119 | |--|--|
120 | | bssid |bssid|
121 | | mac |mac|
122 | | name | name|
123 | | ssid | ssid|
124 |
125 | 9.硬件信息数据
126 | | 字段名 | 详情 |
127 | |--|--|
128 | | board |主板|
129 | | brand |设备品牌|
130 | | cores |设备内核|
131 | | device_height |分辨率高|
132 | | device_name | 设备名称 |
133 | | device_width |分辨率宽|
134 | | model |设备型号|
135 | | physical_size | 物理尺寸|
136 | | production_date | 手机出厂时间戳 |
137 | | release |系统版本|
138 | | sdk_version | SDK版本|
139 | | serial_number | 设备序列号 |
140 |
141 | 10.定位信息数据
142 | | 字段名 | 详情 |
143 | |--|--|
144 | | gps_longitude |经度|
145 | | gps_latitude |维度|
146 | | gps_address_street |街道|
147 | | gps_address_province |省份|
148 | | gps_address_city | 城市 |
149 | | gps_address_country |国家|
150 | | gps_address_countryCode |国家代码|
151 |
152 | 11.其他信息数据
153 | | 字段名 | 详情 |
154 | |--|--|
155 | | dbm |手机的信号强度 默认值-1|
156 | | last_boot_time |最后一次启动时间,毫秒|
157 | | root_jailbreak |是否root,true:1,false:0|
158 | | simulator |是否为模拟器,true:1,false:0|
159 |
160 | 12.内存信息数据
161 | | 字段名 | 详情 |
162 | |--|--|
163 | | app_free_memory | app可用内存大小 单位Byte)|
164 | | app_max_memory |app最大内存大小 单位Byte)|
165 | | app_total_memory |app总内存大小 单位Byte)|
166 | | contain_sd |是否有内置的SD卡(0否,1是)|
167 | | extra_sd | 是否有外置的SD卡(0否,1是)|
168 | | internal_storage_total | 总存储大小 单位Byte)|
169 | | internal_storage_usable |可用存储大小 单位Byte)|
170 | | memory_card_free_size |内存卡剩余使用量 单位Byte)|
171 | | memory_card_size |内存卡大小 单位Byte)|
172 | | memory_card_size_use | 内存卡已使用量 单位Byte)|
173 | | memory_card_usable_size | 内存卡可使用量 单位Byte)|
174 | | ram_total_size |总内存大小( 单位Byte)|
175 | | ram_usable_size |内存可用大小 单位Byte)|
176 | | ram_threshold |低内存阙值|
177 |
178 | 13.通用信息数据
179 | | 字段名 | 详情 |
180 | |--|--|
181 | | and_id | android_id|
182 | | currentSystemTime |设备当前时间|
183 | | elapsedRealtime |开机时间到现在的毫秒数(包括睡眠时间)|
184 | | gaid | google advertising id(google 广告 id)|
185 | | imei | 设备号|
186 | | is_usb_debug | 是否开启debug调试|
187 | | is_using_proxy_port |是否使用代理|
188 | | is_using_vpn |是否使用vpn|
189 | | language |语言|
190 | | locale_display_language | 此用户显示的语言环境语言的名称|
191 | | locale_iso_3_country | 此地区的国家/地区的缩写|
192 | | locale_country |此地区的国家|
193 | | locale_iso_3_language |语言环境的三字母缩写|
194 | | mac |mac 地址|
195 | | network_operator_name |网络运营商名称|
196 | | network_type |网络类型 2G、3G、4G、5G、wifi、other、none|
197 | | phone_number |手机号|
198 | | phone_type | 指示设备电话类型的常量。 这表示用于传输语音呼叫的无线电的类型|
199 | | time_zone_id | 时区的 ID|
200 | | uptimeMillis | 从开机到现在的毫秒数(不包括睡眠时间)|
201 | | uuid |唯一标识|
202 |
203 | 导入依赖方式:
204 |
205 | allprojects {
206 | repositories {
207 | ...
208 | maven { url 'https://jitpack.io' }
209 | }
210 | }
211 | dependencies {
212 | implementation 'com.github.Android5730:DataCapture:v0.4'
213 | }
214 |
215 | 获取信息方法
216 | ```java
217 | // 获取通讯录
218 | List addressBookBean = AddressBookUtil.getAddressBookBean(getBaseContext());
219 | // 获取应用列表
220 | List appListBean = AppListUtil.getAppListBean(this);
221 | // 获取日历事件
222 | List calendarListBean = CalendarListUtil.getCalendarListBean(this);
223 | // 获取电量信息
224 | BatteryStatusBean batteryState = BatteryStatusUtil.getBatteryState(this);
225 | // 获取wifi信息
226 | NetworkBean networkBean = NetworkBeanUtils.getNetworkBean(this);
227 | // 获取wifi信息详情
228 | NetworkBean.CurrentWifiBean current_wifi = NetworkBeanUtils.getNetworkBean(this).getCurrent_wifi();
229 | // 获取附近wifi集合
230 | List configured_wifi = networkBean.getConfigured_wifi();
231 | // 获取sms短信信息
232 | List smsList = SmsUtil.getSmsList(this);
233 | // 获取照片集合信息
234 | List photoInfosBean = PhotoInfosUtil.getPhotoInfosBean(this,
235 | LocationUtils.getInstance(this).showLocation());
236 | // 获取传感器集合信息
237 | List sensorListBean = SensorListUtil.getSensorListBean(this);
238 | // 获取硬件信息
239 | HardwareBean hardwareBean = HardwareUtil.getHardwareBean(this);
240 | // 获取定位信息
241 | LocationUtils instance = LocationUtils.getInstance(this); // 定位工具类单例对象
242 | LocationUtils.AddressInfo addressInfo = instance.getAddressInfo(); // bean信息
243 | String address = instance.getAddress();// bean类整合信息
244 | // 获取其他信息
245 | OtherDataBean otherDataBean = OtherDataUtil.getOtherDataBean(this);
246 | // 获取内存信息
247 | NewStorageBean newStorageBean = SDCardUtils.getNewStorageBean(this);
248 | // 获取通用信息
249 | GeneralDataBean generalData = GeneralDataUtil.getGeneralData(this);
250 |
251 |
252 |
253 |
254 | ```
255 | 若是大家感兴趣,我后续会更新此库,方便大家获取更多的数据
256 | 这个是本人的博客:https://blog.csdn.net/weixin_63088467?spm=1011.2415.3001.5343
257 | https://juejin.cn/user/4156615587280125 欢迎持续关注
258 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | namespace 'com.itaem.datacapture'
7 | compileSdk 34
8 |
9 | defaultConfig {
10 | applicationId "com.itaem.datacapture"
11 | minSdk 21
12 | targetSdk 34
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | compileOptions {
26 | sourceCompatibility JavaVersion.VERSION_1_8
27 | targetCompatibility JavaVersion.VERSION_1_8
28 | }
29 | viewBinding {
30 | enabled = true
31 | }
32 | }
33 |
34 | dependencies {
35 |
36 | implementation 'androidx.appcompat:appcompat:1.6.1'
37 | implementation 'com.google.android.material:material:1.6.1'
38 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
39 | implementation project(path: ':DataCapture')
40 | testImplementation 'junit:junit:4.13.2'
41 | androidTestImplementation 'androidx.test.ext:junit:1.1.3'
42 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
43 | // 颜色选择器
44 | implementation "com.github.skydoves:colorpickerview:2.3.0"
45 | implementation 'com.github.getActivity:XXPermissions:18.2'
46 | implementation 'com.github.huangyanbin:SmartTable:2.2.0'
47 | // glide
48 | implementation 'com.github.bumptech.glide:glide:4.14.2'
49 | annotationProcessor 'com.github.bumptech.glide:compiler:4.14.2'
50 | }
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/itaem/datacapture/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.itaem.datacapture", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
40 |
43 |
46 |
47 |
48 |
51 |
52 |
53 |
56 |
59 |
60 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/app/src/main/java/com/itaem/datacapture/Constant.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture;// 2023/11/15
2 |
3 | // 作者:ITAEM 陈金城
4 | public class Constant {
5 | public final static int RECYCLER_CARD = 1;
6 | public final static int RECYCLER_LINEAR = 0;
7 | }
8 |
--------------------------------------------------------------------------------
/app/src/main/java/com/itaem/datacapture/dialog/AppBeanDialog.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.dialog;// 2023/11/4
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.net.Uri;
7 | import android.os.Handler;
8 | import android.os.Looper;
9 | import android.os.Message;
10 | import android.provider.Settings;
11 | import android.view.View;
12 | import android.view.animation.AnimationUtils;
13 |
14 | import androidx.annotation.NonNull;
15 |
16 | import com.bumptech.glide.Glide;
17 | import com.itaem.datacapture.R;
18 | import com.itaem.datacapture.bean.AppListBean;
19 | import com.itaem.datacapture.databinding.DialogAppbeanBinding;
20 | import com.itaem.datacapture.utils.MarketUtils;
21 |
22 | import java.text.SimpleDateFormat;
23 | import java.util.Date;
24 |
25 | // 作者:ITAEM 陈金城
26 | public class AppBeanDialog extends Dialog {
27 | private boolean isMiss = true;
28 | private String AppInTime;
29 | private String AppUpTime;
30 | DialogAppbeanBinding binding;
31 | public AppBeanDialog(@NonNull Context context,AppListBean bean) {
32 | super(context, R.style.DialogBaseStyle);
33 | binding = DialogAppbeanBinding.inflate(getLayoutInflater());
34 | setContentView(binding.getRoot());
35 | initView(bean);
36 | }
37 |
38 | private void initClick(AppListBean appListBean) {
39 | binding.dialogToDetails.setOnClickListener(new View.OnClickListener() {
40 | @Override
41 | public void onClick(View view) {
42 | Intent intent = new Intent();
43 | intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
44 | Uri uri = Uri.fromParts("package", appListBean.getPackage_name(), null);
45 | intent.setData(uri);
46 | getContext().startActivity(intent);
47 | }
48 | });
49 | binding.dialogToPlayShop.setOnClickListener(new View.OnClickListener() {
50 | @Override
51 | public void onClick(View v) {
52 | MarketUtils.getTools().startMarket(getContext(),appListBean.getPackage_name());
53 | }
54 | });
55 | binding.dialogIvTimeStyle.setOnClickListener(new View.OnClickListener() {
56 | @Override
57 | public void onClick(View v) {
58 | binding.dialogIvTimeStyle.setAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.anim_timestyle));
59 | if (isMiss){
60 | binding.dialogTvTimeStyle.setText("时间类型为:年月日");
61 | AppInTime = "APP安装时间(in_time):" + SimpleDateFormat.getInstance()
62 | .format(new Date(Long.parseLong(appListBean.getIn_time())));
63 | AppUpTime = "APP更新时间(up_time):" + SimpleDateFormat.getInstance()
64 | .format(new Date(Long.parseLong(appListBean.getUp_time())));
65 | // binding.dialogAppInTime.setText(new StringBuilder("APP安装时间(in_time):").append(SimpleDateFormat.getInstance()
66 | // .format(new Date(Long.parseLong(appListBean.getIn_time())))));
67 | // binding.dialogAppUptime.setText(new StringBuilder("更新时间(up_time):").append(SimpleDateFormat.getInstance()
68 | // .format(new Date(Long.parseLong(appListBean.getUp_time())))));
69 | }else {
70 | binding.dialogTvTimeStyle.setText("时间类型为:毫秒");
71 | AppUpTime = "APP安装时间(in_time):" + appListBean.getIn_time();
72 | AppUpTime = "APP更新时间(up_time):" + appListBean.getUp_time();
73 | // binding.dialogAppInTime.setText(new StringBuilder("APP安装时间(in_time):").append(appListBean.getIn_time()));
74 | // binding.dialogAppUptime.setText(new StringBuilder("更新时间(up_time):").append(appListBean.getUp_time()));
75 | }
76 | StartThread(AppInTime,0);
77 | StartThread(AppUpTime,1);
78 | isMiss = !isMiss;
79 | }
80 | });
81 | }
82 |
83 | private void initView(AppListBean appListBean) {
84 | binding.dialogName.setText(new StringBuilder("APP名称(app_name):").append(appListBean.getApp_name()));
85 | binding.dialogAppType.setText(new StringBuilder("是否系统app(app_type):").append(appListBean.getApp_type().equals("1")?"是":"否"));
86 | binding.dialogAppVersion.setText(new StringBuilder("APP版本(app_version):").append(appListBean.getApp_version()));
87 | binding.dialogAppInTime.setText(new StringBuilder("APP安装时间(in_time):").append(appListBean.getIn_time()));
88 | binding.dialogAppUptime.setText(new StringBuilder("更新时间(up_time):").append(appListBean.getUp_time()));
89 | binding.dialogAppPackageName.setText(new StringBuilder("包名(package_name):").append(appListBean.getPackage_name()));
90 | binding.dialogAppVersionCode.setText(new StringBuilder("版本号(version_code):").append(appListBean.getVersion_code()));
91 | Glide.with(getContext()).load(appListBean.getApp_icon())
92 | .placeholder(R.drawable.placeholder_load)
93 | .error(R.drawable.glide_error)
94 | .into(binding.dialogIcon);
95 | initClick(appListBean);
96 |
97 | }
98 | private void StartThread(String string,int type){
99 | new Thread(new Runnable() {
100 | @Override
101 | public void run() {
102 | for(int i=0; i addressBookBean = AddressBookUtil.getAddressBookBean(getBaseContext());
84 | table.setData(addressBookBean);
85 | break;
86 | case "AppList":
87 | progressBar.setVisibility(View.VISIBLE);
88 | new Thread(new Runnable() {
89 | @Override
90 | public void run() {
91 | // List appListBean = AppListUtil.getAppListBean(DataListShowActivity.this);
92 | List appListBean = new Factory().getDataUtil(AppListUtil.class).getData(DataListShowActivity.this);
93 | runOnUiThread(new Runnable() {
94 | @Override
95 | public void run() {
96 | progressBar.setVisibility(View.GONE);
97 | table.setData(appListBean);
98 | }
99 | });
100 | }
101 | }).start();
102 | break;
103 | case "CalendarList":
104 | List calendarListBean = CalendarListUtil.getCalendarListBean(this);
105 | table.setData(calendarListBean);
106 | break;
107 | case "BatteryStatusBean":
108 | BatteryStatusBean batteryState = BatteryStatusUtil.getBatteryState(this);
109 | table.setData(Collections.singletonList(batteryState));
110 | break;
111 | case "NetworkBean":
112 | NetworkBean networkBean = NetworkBeanUtils.getNetworkBean(this);
113 | table.setData(networkBean.getConfigured_wifi());
114 | networkClick(networkBean);
115 | break;
116 | case "SMSBean":
117 | List smsList = SmsUtil.getSmsList(this);
118 | table.setData(smsList);
119 | break;
120 | case "PhotoBean":
121 | List photoInfosBean = PhotoInfosUtil.getPhotoInfosBean(this, LocationUtils.getInstance(this).showLocation());
122 | recyclerView_list.setLayoutManager(new GridLayoutManager(this,2));
123 | table.setData(photoInfosBean);
124 | break;
125 | case "SensorBean":
126 | List sensorListBean = SensorListUtil.getSensorListBean(this);
127 | table.setData(sensorListBean);
128 | break;
129 | }
130 | }
131 |
132 | private void networkClick(NetworkBean networkBean){
133 | table.setOnColumnClickListener(new OnColumnClickListener() {
134 | @Override
135 | public void onClick(ColumnInfo columnInfo) {
136 | Column column = columnInfo.column;
137 | if (column.getColumnName().equals("current_wifi_当前WIFI")){
138 | // 识别当前是否为wifi状态
139 | table.setData(Collections.singletonList(networkBean.getCurrent_wifi()));
140 | table.notifyDataChanged();
141 | }else if (column.getColumnName().equals("configured_wifi_配置WIFI")){
142 | table.setData(networkBean.getConfigured_wifi());
143 | table.notifyDataChanged();
144 | }
145 | }
146 | });
147 | }
148 |
149 | @Override
150 | public boolean onCreateOptionsMenu(Menu menu) {
151 | MenuInflater inflater = getMenuInflater();
152 | inflater.inflate(R.menu.menu_list_data,menu);
153 | return super.onCreateOptionsMenu(menu);
154 | }
155 |
156 | @Override
157 | public boolean onOptionsItemSelected(@NonNull MenuItem item) {
158 | switch (item.getItemId()){
159 | case R.id.menu_change_layout:
160 | if (isTable){
161 | table.setVisibility(View.GONE);
162 | recyclerView_list.setVisibility(View.VISIBLE);
163 | listAdapter.setList(table.getTableData().getT(),data_type);
164 | isTable = false;
165 | }else {
166 | table.setVisibility(View.VISIBLE);
167 | recyclerView_list.setVisibility(View.GONE);
168 | isTable = true;
169 | }
170 | isMenuClick = true;
171 | break;
172 | case Constant.RECYCLER_CARD:
173 | if(listAdapter.getLayoutType()==Constant.RECYCLER_CARD){
174 | listAdapter.setLayout(Constant.RECYCLER_LINEAR);
175 | item.setTitle("切换卡片布局");
176 | }else {
177 | listAdapter.setLayout(Constant.RECYCLER_CARD);
178 | item.setTitle("切换线性布局");
179 | }
180 |
181 | break;
182 |
183 | }
184 | return super.onOptionsItemSelected(item);
185 | }
186 |
187 |
188 | @Override
189 | public boolean onPrepareOptionsMenu(Menu menu) {
190 | if (isMenuClick){
191 | if (isTable){
192 | menu.removeItem(Constant.RECYCLER_CARD);
193 | menu.findItem(R.id.menu_change_layout).setTitle("切换列表布局");
194 | }else {
195 | menu.add(Menu.NONE,Constant.RECYCLER_CARD,Menu.NONE,listAdapter.getLayoutType()==0?"切换卡片布局":"切换列表布局");
196 | menu.findItem(R.id.menu_change_layout).setTitle("切换表格布局");
197 | }
198 | isMenuClick = !isMenuClick;
199 | }
200 |
201 | return super.onPrepareOptionsMenu(menu);
202 | }
203 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/itaem/datacapture/utils/MarketUtils.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture.utils;// 2023/11/13
2 |
3 |
4 | import android.content.ActivityNotFoundException;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.content.pm.PackageInfo;
8 | import android.content.pm.PackageManager;
9 | import android.net.Uri;
10 | import android.text.TextUtils;
11 | import android.util.Log;
12 |
13 | import androidx.annotation.NonNull;
14 |
15 | /**
16 | /* @anthor:njb
17 | /* @date: 2020-04-29 00:15
18 | /* @desc:
19 | **/
20 | public class MarketUtils {
21 | private static MarketUtils tools;
22 | private static final String schemaUrl = "market://details?id=";
23 | public static MarketUtils getTools() {
24 | if (null == tools) {
25 | tools = new MarketUtils();
26 | }
27 | return tools;
28 | }
29 | /***
30 | /* 不指定包名
31 | /* @param mContext
32 | */
33 | public void startMarket(Context mContext) {
34 | String packageName = mContext.getPackageName();//得到包名
35 | startMarket(mContext, packageName);
36 | }
37 | /**
38 | /* 指定包名
39 | /*
40 | /* @param mContext
41 | /* @param packageName
42 | */
43 | public boolean startMarket(Context mContext, String packageName) {
44 | try {
45 | String deviceBrand = getDeviceBrand();//获得手机厂商
46 | //根据厂商获取对应市场的包名
47 | String brandName = deviceBrand.toUpperCase();//大写
48 | if (TextUtils.isEmpty(brandName)) {
49 | Log.e("MarketUtils", "没有读取到手机厂商~~");
50 | return false;
51 | }
52 | String marketPackageName = getBrandName(brandName);
53 | if (null == marketPackageName || "".equals(marketPackageName)) {
54 | //手机不再列表里面,去尝试寻找
55 | //检测百度和应用宝是否在手机上安装,如果安装,则跳转到这两个市场的其中一个
56 | boolean isExit1 = isCheckBaiduOrYYB(mContext, PACKAGE_NAME.BAIDU_PACKAGE_NAME);
57 | if (isExit1) {
58 | startMarket(mContext, packageName, PACKAGE_NAME.BAIDU_PACKAGE_NAME);
59 | return true;
60 | }
61 | boolean isExit2 = isCheckBaiduOrYYB(mContext, PACKAGE_NAME.TENCENT_PACKAGE_NAME);
62 | if (isExit2) {
63 | startMarket(mContext, packageName, PACKAGE_NAME.TENCENT_PACKAGE_NAME);
64 | return true;
65 | }
66 | }
67 | startMarket(mContext, packageName, marketPackageName);
68 | return true;
69 | } catch (ActivityNotFoundException anf) {
70 | Log.e("MarketUtils", "要跳转的应用市场不存在!");
71 | } catch (Exception e) {
72 | Log.e("MarketUtils", "其他错误:" + e.getMessage());
73 | }
74 | return false;
75 | }
76 | /***
77 | /* 指定包名,指定市场
78 | /* @param mContext
79 | /* @param packageName
80 | /* @param marketPackageName
81 | */
82 | public void startMarket(Context mContext, String packageName, String marketPackageName) {
83 | try {
84 | openMarket(mContext, packageName, marketPackageName);
85 | } catch (ActivityNotFoundException anf) {
86 | Log.e("MarketUtils", "要跳转的应用市场不存在!");
87 | } catch (Exception e) {
88 | Log.e("MarketUtils", "其他错误:" + e.getMessage());
89 | }
90 | }
91 | /***
92 | /* 打开应用市场
93 | /* @param mContext
94 | /* @param packageName
95 | /* @param marketPackageName
96 | */
97 | private void openMarket(Context mContext, String packageName, String marketPackageName) {
98 | try {
99 | Uri uri = Uri.parse(schemaUrl + packageName);
100 | Intent intent = new Intent(Intent.ACTION_VIEW, uri);
101 | intent.setPackage(marketPackageName);
102 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
103 | mContext.startActivity(intent);
104 | } catch (ActivityNotFoundException anf) {
105 | Log.e("MarketUtils", "要跳转的应用市场不存在!");
106 | } catch (Exception e) {
107 | Log.e("MarketUtils", "其他错误:" + e.getMessage());
108 | }
109 | }
110 | /***
111 | /* 检测是否是应用宝或者是百度市场
112 | /* @param mContext
113 | /* @param packageName
114 | /* @return
115 | */
116 | private boolean isCheckBaiduOrYYB(Context mContext, String packageName) {
117 | boolean installed = isInstalled(packageName, mContext);
118 | return installed;
119 | }
120 | /****
121 | /* 检查APP是否安装成功
122 | /* @param packageName
123 | /* @param context
124 | /* @return
125 | */
126 | private boolean isInstalled(@NonNull String packageName, Context context) {
127 | if ("".equals(packageName) || packageName.length() <= 0) {
128 | return false;
129 | }
130 | PackageInfo packageInfo;
131 | try {
132 | packageInfo = context.getPackageManager().getPackageInfo(packageName, 0);
133 | } catch (PackageManager.NameNotFoundException e) {
134 | packageInfo = null;
135 | }
136 | if (packageInfo == null) {
137 | return false;
138 | } else {
139 | return true;
140 | }
141 | }
142 | private String getBrandName(String brandName) {
143 | if (BRAND.HUAWEI_BRAND.equals(brandName)) {
144 | //华为
145 | return PACKAGE_NAME.HUAWEI_PACKAGE_NAME;
146 | } else if (BRAND.OPPO_BRAND.equals(brandName)) {
147 | //oppo
148 | return PACKAGE_NAME.OPPO_PACKAGE_NAME;
149 | } else if (BRAND.VIVO_BRAND.equals(brandName)) {
150 | //vivo
151 | return PACKAGE_NAME.VIVO_PACKAGE_NAME;
152 | } else if (BRAND.XIAOMI_BRAND.equals(brandName)) {
153 | //小米
154 | return PACKAGE_NAME.XIAOMI_PACKAGE_NAME;
155 | } else if (BRAND.LENOVO_BRAND.equals(brandName)) {
156 | //联想
157 | return PACKAGE_NAME.LIANXIANG_PACKAGE_NAME;
158 | } else if (BRAND.QH360_BRAND.equals(brandName)) {
159 | //360
160 | return PACKAGE_NAME.QH360_PACKAGE_NAME;
161 | } else if (BRAND.MEIZU_BRAND.equals(brandName)) {
162 | //魅族
163 | return PACKAGE_NAME.MEIZU_PACKAGE_NAME;
164 | } else if (BRAND.HONOR_BRAND.equals(brandName)) {
165 | //华为
166 | return PACKAGE_NAME.HUAWEI_PACKAGE_NAME;
167 | } else if (BRAND.XIAOLAJIAO_BRAND.equals(brandName)) {
168 | //小辣椒
169 | return PACKAGE_NAME.ZHUOYI_PACKAGE_NAME;
170 | } else if (BRAND.ZTE_BRAND.equals(brandName)) {
171 | //zte
172 | return PACKAGE_NAME.ZTE_PACKAGE_NAME;
173 | } else if (BRAND.NIUBIA_BRAND.equals(brandName)) {
174 | //努比亚
175 | return PACKAGE_NAME.NIUBIA_PACKAGE_NAME;
176 | } else if (BRAND.ONE_PLUS_BRAND.equals(brandName)) {
177 | //OnePlus
178 | return PACKAGE_NAME.OPPO_PACKAGE_NAME;
179 | } else if (BRAND.MEITU_BRAND.equals(brandName)) {
180 | //美图
181 | return PACKAGE_NAME.MEITU_PACKAGE_NAME;
182 | } else if (BRAND.SONY_BRAND.equals(brandName)) {
183 | //索尼
184 | return PACKAGE_NAME.GOOGLE_PACKAGE_NAME;
185 | } else if (BRAND.GOOGLE_BRAND.equals(brandName)) {
186 | //google
187 | return PACKAGE_NAME.GOOGLE_PACKAGE_NAME;
188 | }
189 | return "";
190 | }
191 | /**
192 | /* 获取手机厂商
193 | */
194 | private String getDeviceBrand() {
195 | return android.os.Build.BRAND;
196 | }
197 | public static class BRAND {
198 | public static final String HUAWEI_BRAND = "HUAWEI";//HUAWEI_PACKAGE_NAME
199 | public static final String HONOR_BRAND = "HONOR";//HUAWEI_PACKAGE_NAME
200 | public static final String OPPO_BRAND = "OPPO";//OPPO_PACKAGE_NAME
201 | public static final String MEIZU_BRAND = "MEIZU";//MEIZU_PACKAGE_NAME
202 | public static final String VIVO_BRAND = "VIVO";//VIVO_PACKAGE_NAME
203 | public static final String XIAOMI_BRAND = "XIAOMI";//XIAOMI_PACKAGE_NAME
204 | public static final String LENOVO_BRAND = "LENOVO";//LIANXIANG_PACKAGE_NAME //Lenovo
205 | public static final String ZTE_BRAND = "ZTE";//ZTE_PACKAGE_NAME
206 | public static final String XIAOLAJIAO_BRAND = "XIAOLAJIAO";//ZHUOYI_PACKAGE_NAME
207 | public static final String QH360_BRAND = "360";//QH360_PACKAGE_NAME
208 | public static final String NIUBIA_BRAND = "NUBIA";//NIUBIA_PACKAGE_NAME
209 | public static final String ONE_PLUS_BRAND = "ONEPLUS";//OPPO_PACKAGE_NAME
210 | public static final String MEITU_BRAND = "MEITU";//MEITU_PACKAGE_NAME
211 | public static final String SONY_BRAND = "SONY";//GOOGLE_PACKAGE_NAME
212 | public static final String GOOGLE_BRAND = "GOOGLE";//GOOGLE_PACKAGE_NAME
213 | public static final String HTC_BRAND = "HTC";//未知应用商店包名
214 | public static final String ZUK_BRAND = "ZUK";//未知应用商店包名
215 | }
216 | /** Redmi*/
217 | /**
218 | /* 华为,oppo,vivo,小米,360,联想,魅族,安智,百度,阿里,应用宝,goog,豌豆荚,pp助手
219 | **/
220 | public static class PACKAGE_NAME {
221 | public static final String OPPO_PACKAGE_NAME = "com.oppo.market";//oppo
222 | public static final String VIVO_PACKAGE_NAME = "com.bbk.appstore";//vivo
223 | public static final String HUAWEI_PACKAGE_NAME = "com.huawei.appmarket";//华为
224 | public static final String QH360_PACKAGE_NAME = "com.qihoo.appstore";//360
225 | public static final String XIAOMI_PACKAGE_NAME = "com.xiaomi.market";//小米
226 | public static final String MEIZU_PACKAGE_NAME = "com.meizu.mstore";//,魅族
227 | public static final String LIANXIANG_PACKAGE_NAME = "com.lenovo.leos.appstore";//联想
228 | public static final String ZTE_PACKAGE_NAME = "zte.com.market";//zte
229 | public static final String ZHUOYI_PACKAGE_NAME = "com.zhuoyi.market";//卓易
230 | public static final String GOOGLE_PACKAGE_NAME = "com.android.vending";//google
231 | public static final String NIUBIA_PACKAGE_NAME = "com.nubia.neostore";//努比亚
232 | public static final String MEITU_PACKAGE_NAME = "com.android.mobile.appstore";//美图
233 | public static final String BAIDU_PACKAGE_NAME = "com.baidu.appsearch";//baidu
234 | public static final String TENCENT_PACKAGE_NAME = "com.tencent.android.qqdownloader";//应用宝
235 | public static final String PPZHUSHOU_PACKAGE_NAME = "com.pp.assistant";//pp助手
236 | public static final String ANZHI_PACKAGE_NAME = "com.goapk.market";//安智市场
237 | public static final String WANDOUJIA_PACKAGE_NAME = "com.wandoujia.phonenix2";//豌豆荚
238 | // public static final String SUONI_PACKAGE_NAME = "com.android.vending";//索尼
239 | }
240 | /**
241 | /* 启动到应用商店app详情界面
242 | /* @param appPkg 目标App的包名
243 | /* @param marketPkg 应用商店包名 ,如果为"" 则由系统弹出应用商店
244 | /* 列表供用户选择,否则调转到目标市场的应用详情界面,某些应用商店可能会失败
245 | */
246 | public static void launchAppDetail(Context context, String appPkg, String marketPkg) {
247 | try {
248 | if (TextUtils.isEmpty(appPkg)) return;
249 | Uri uri = Uri.parse("market://details?id=" + appPkg);
250 | Intent intent = new Intent(Intent.ACTION_VIEW, uri);
251 | if (!TextUtils.isEmpty(marketPkg)) {
252 | intent.setPackage(marketPkg);
253 | }
254 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
255 | context.startActivity(intent);
256 | } catch (Exception e) {
257 | e.printStackTrace();
258 | }
259 | }
260 | }
261 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/anim_timestyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/glide_error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/drawable-v24/glide_error.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/item_img1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/drawable-v24/item_img1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/placeholder_load.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/drawable-v24/placeholder_load.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/time.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/drawable-v24/time.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_apps_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_local_phone_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_search_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_data_bean.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
15 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_data_show.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
14 |
20 |
29 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
14 |
18 |
23 |
29 |
30 |
34 |
39 |
45 |
46 |
50 |
55 |
61 |
62 |
66 |
71 |
77 |
78 |
82 |
87 |
93 |
94 |
98 |
103 |
109 |
110 |
114 |
119 |
125 |
126 |
130 |
135 |
141 |
142 |
143 |
147 |
152 |
158 |
159 |
163 |
168 |
174 |
175 |
179 |
184 |
190 |
191 |
195 |
200 |
206 |
207 |
211 |
216 |
222 |
223 |
224 |
225 |
226 |
227 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_appbean.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
16 |
28 |
39 |
50 |
61 |
72 |
73 |
84 |
95 |
106 |
115 |
124 |
135 |
144 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_bean.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_addressbook.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
16 |
26 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_app.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
13 |
23 |
32 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_app_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
12 |
19 |
26 |
36 |
45 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_photo.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
12 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_data.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_list_data.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | DataCapture
3 | 数据颜色
4 | 搜索
5 | 切换布局
6 | 提交
7 | 取消
8 | 切换列表布局
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/style.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/src/test/java/com/itaem/datacapture/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.itaem.datacapture;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | plugins {
3 | id 'com.android.application' version '7.3.1' apply false
4 | id 'com.android.library' version '7.3.1' apply false
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Enables namespacing of each library's R class so that its R class includes only the
19 | # resources declared in the library itself and none from the library's dependencies,
20 | # thereby reducing the size of the R class for that library
21 | android.nonTransitiveRClass=true
22 | android.enableJetifier = true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Android5730/DataCapture/5437a6b601daa072b4df1e98dd9f1d8d7e0b6154/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Aug 13 14:59:36 CST 2023
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | gradlePluginPortal()
4 | google()
5 | mavenCentral()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 | maven { url 'https://www.jitpack.io' }
14 |
15 | }
16 | }
17 | rootProject.name = "DataCapture"
18 | include ':app'
19 | include ':DataCapture'
20 |
--------------------------------------------------------------------------------