Compare commits

..

14 Commits

8 changed files with 252 additions and 63 deletions

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sun Dec 07 23:58:27 HKT 2025
stageCount=2
#Tue Dec 09 10:37:45 HKT 2025
stageCount=7
libraryProject=
baseVersion=15.12
publishVersion=15.12.1
publishVersion=15.12.6
buildCount=0
baseBetaVersion=15.12.2
baseBetaVersion=15.12.7

View File

@@ -1,21 +1,143 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\tools\adt-bundle-windows-x86_64-20131030\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# ============================== 基础通用规则 ==============================
# 保留系统组件
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
# 保留 WinBoLL 核心包及子类(合并简化规则)
-keep class cc.winboll.studio.** { *; }
-keepclassmembers class cc.winboll.studio.** { *; }
# 保留所有类中的 public static final String TAG 字段(便于日志定位)
-keepclassmembers class * {
public static final java.lang.String TAG;
}
# 保留序列化类避免Parcelable/Gson解析异常
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
# 保留 R 文件避免资源ID混淆
-keepclassmembers class **.R$* {
public static <fields>;
}
# 保留 native 方法避免JNI调用失败
-keepclasseswithmembernames class * {
native <methods>;
}
# 保留注解和泛型(避免反射/序列化异常)
-keepattributes *Annotation*
-keepattributes Signature
# 屏蔽 Java 8+ 警告(适配 Java 7 语法)
-dontwarn java.lang.invoke.*
-dontwarn android.support.v8.renderscript.*
-dontwarn java.util.function.**
# ============================== 第三方框架专项规则 ==============================
# OkHttp 4.4.1米盟广告请求依赖完善Lambda兼容
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-keep class okhttp3.internal.** { *; }
-keep class okio.** { *; }
-dontwarn okhttp3.internal.platform.**
-dontwarn okio.**
# ============================== 必要补充规则 ==============================
# OkHttp 4.4.1 补充规则Java 7 兼容)
-keep class okhttp3.internal.concurrent.** { *; }
-keep class okhttp3.internal.connection.** { *; }
-dontwarn okhttp3.internal.concurrent.TaskRunner
-dontwarn okhttp3.internal.connection.RealCall
# Glide 4.9.0(米盟广告图片加载依赖)
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$ImageType {
**[] $VALUES;
public *;
}
-keepclassmembers class * implements com.bumptech.glide.module.AppGlideModule {
<init>();
}
-dontwarn com.bumptech.glide.**
# Gson 2.8.5(米盟广告数据序列化依赖)
-keep class com.google.gson.** { *; }
-keep interface com.google.gson.** { *; }
-keepclassmembers class * {
@com.google.gson.annotations.SerializedName <fields>;
}
# 米盟 SDK(核心广告组件,完整保留避免加载失败)
-keep class com.miui.zeus.** { *; }
-keep interface com.miui.zeus.** { *; }
# 保留米盟日志字段(便于广告加载失败排查)
-keepclassmembers class com.miui.zeus.mimo.sdk.** {
public static final java.lang.String TAG;
}
# RecyclerView 1.0.0(米盟广告布局渲染依赖)
-keep class androidx.recyclerview.** { *; }
-keep interface androidx.recyclerview.** { *; }
-keepclassmembers class androidx.recyclerview.widget.RecyclerView$Adapter {
public *;
}
# 其他第三方框架(按引入依赖保留,无则可删除)
# XXPermissions 18.63
-keep class com.hjq.permissions.** { *; }
-keep interface com.hjq.permissions.** { *; }
# ZXing 二维码(核心解析组件)
-keep class com.google.zxing.** { *; }
-keep class com.journeyapps.zxing.** { *; }
# Jsoup HTML解析
-keep class org.jsoup.** { *; }
# Pinyin4j 拼音搜索
-keep class net.sourceforge.pinyin4j.** { *; }
# JSch SSH组件
-keep class com.jcraft.jsch.** { *; }
# AndroidX 基础组件
-keep class androidx.appcompat.** { *; }
-keep interface androidx.appcompat.** { *; }
# ============================== 优化与调试配置 ==============================
# 优化级别(平衡混淆效果与性能)
-optimizationpasses 5
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
# 调试辅助(保留行号便于崩溃定位)
-verbose
-dontpreverify
-dontusemixedcaseclassnames
-keepattributes SourceFile,LineNumberTable

View File

@@ -4,6 +4,8 @@ import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
@@ -19,14 +21,15 @@ import androidx.core.content.ContextCompat;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.libaes.utils.AESThemeUtil;
import cc.winboll.studio.libaes.utils.DevelopUtils;
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
import cc.winboll.studio.libaes.views.ADsBannerView;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.positions.R;
import cc.winboll.studio.positions.activities.LocationActivity;
import cc.winboll.studio.positions.activities.SettingsActivity;
import cc.winboll.studio.positions.activities.WinBoLLActivity;
import cc.winboll.studio.positions.utils.AppConfigsUtil;
import cc.winboll.studio.positions.utils.ServiceUtil;
import android.widget.LinearLayout;
/**
* 主页面:仅负责
@@ -102,8 +105,22 @@ public class MainActivity extends WinBoLLActivity implements IWinBoLLActivity {
mADsBannerView = findViewById(R.id.adsbanner);
setLLMainBackgroundColor();
}
// 在 Activity 的 onCreate() 或需要获取颜色的方法中调用
private void setLLMainBackgroundColor() {
// 1. 定义要解析的主题属性(这里是 colorAccent
TypedArray a = getTheme().obtainStyledAttributes(new int[]{android.R.attr.colorAccent});
// 2. 获取对应的颜色值(默认值可设为你需要的 fallback 颜色,如 Color.GRAY
int colorAccent = a.getColor(0, Color.GRAY);
// 3. 必须回收,避免内存泄漏
a.recycle();
LinearLayout llmain = findViewById(R.id.llmain);
llmain.setBackgroundColor(colorAccent);
}
@Override
protected void onDestroy() {
super.onDestroy();
@@ -151,7 +168,7 @@ public class MainActivity extends WinBoLLActivity implements IWinBoLLActivity {
mManagePositionsButton = (Button) findViewById(R.id.btn_manage_positions);
mManagePositionsButton.setEnabled(mServiceSwitch.isChecked());
// Java 7 用匿名内部类实现 CompoundButton.OnCheckedChangeListener
mServiceSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
@@ -199,7 +216,7 @@ public class MainActivity extends WinBoLLActivity implements IWinBoLLActivity {
recreate();
} if (DevelopUtils.onDevelopItemSelected(this, item)) {
LogUtils.d(TAG, String.format("onOptionsItemSelected item.getItemId() %d ", item.getItemId()));
} else if (item.getItemId() == R.id.item_settings) {
} else if (menuItemId == R.id.item_settings) {
Intent intent = new Intent();
intent.setClass(this, SettingsActivity.class);
startActivity(intent);
@@ -231,14 +248,6 @@ public class MainActivity extends WinBoLLActivity implements IWinBoLLActivity {
startActivity(new Intent(MainActivity.this, LocationActivity.class));
}
/**
* 跳转至“日志页LogActivity按钮点击触发需在布局中设置 android:onClick="onLog"
* 无服务状态限制,直接跳转
*/
public void onLog(View view) {
WinBoLLActivityManager.getInstance().startLogActivity(this); // 调用LogActivity静态方法跳转保留原逻辑
}
// ---------------------- 新增位置权限处理适配Java7 + 后台GPS权限 ----------------------
/**
* 检查是否拥有「前台+后台」位置权限适配Android版本差异

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 禁用状态:仅此处自定义(灰化样式) -->
<item android:state_enabled="false">
<shape android:shape="rectangle">
<solid android:color="#E0E0E0" /> <!-- 禁用背景灰(浅灰,贴近系统禁用色) -->
<stroke android:width="1px" android:color="#CCCCCC" /> <!-- 禁用边框灰 -->
<corners android:radius="2dp" /> <!-- 匹配系统按钮圆角弧度 -->
</shape>
</item>
<!-- 启用状态:直接复用系统默认按钮样式(与普通按钮完全一致) -->
<item android:state_enabled="true" android:drawable="@android:drawable/btn_default" />
</selector>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 禁用状态:文字灰(系统默认禁用文字色) -->
<item android:state_enabled="false" android:color="#9E9E9E" />
<!-- 启用状态:复用系统默认按钮文字色(与普通按钮一致) -->
<item android:state_enabled="true" android:color="@android:color/black" />
</selector>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> <!-- 矩形形状(匹配 LinearLayout -->
<!-- 1px 边框关键stroke 标签控制边框) -->
<stroke
android:width="2px"
android:color="?attr/colorAccent" /> <!-- 边框颜色(替换为你的颜色,如 #CCCCCC -->
<!-- 可选:设置 LinearLayout 背景色(若需要) -->
<solid android:color="#00000000" /> <!-- 内部填充色,默认透明可删除 -->
<!-- 可选:设置圆角(不需要圆角可删除) -->
<corners android:radius="0dp" />
</shape>

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:id="@+id/llmain">
<cc.winboll.studio.libaes.views.ASupportToolbar
android:layout_width="match_parent"
@@ -13,40 +13,61 @@
android:gravity="center_vertical"/>
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:background="#00000000"
android:layout_weight="1.0">
<Switch
android:id="@+id/switch_service_control"
android:layout_margin="16dp"
android:text="GPS服务开关"
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="match_parent"
android:background="@drawable/activity_background"
android:layout_margin="0dp">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:onClick="onPositions"
android:text="位置与任务管理"
android:id="@+id/btn_manage_positions"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:layout_weight="1.0">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:onClick="onLog"
android:text="查看应用日志"/>
<Switch
android:id="@+id/switch_service_control"
android:text="GPS服务开关"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="120dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:background="@drawable/shape_2px_border"
android:paddingLeft="10dp"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:onClick="onPositions"
android:text="位置与任务管理"
android:id="@+id/btn_manage_positions"
android:background="@drawable/btn_selector"
android:textColor="@drawable/btn_text_selector"
android:padding="12dp"/>
</LinearLayout>
<cc.winboll.studio.libaes.views.ADsBannerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/adsbanner"
android:layout_alignParentBottom="true"/>
</LinearLayout>
</LinearLayout>
<cc.winboll.studio.libaes.views.ADsBannerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/adsbanner"
android:layout_alignParentBottom="true"/>
</LinearLayout>