分支合并修整
This commit is contained in:
		| @@ -18,18 +18,18 @@ def genVersionName(def versionName){ | ||||
| } | ||||
|  | ||||
| android { | ||||
|     compileSdkVersion 30 | ||||
|     buildToolsVersion "30.0.3" | ||||
|     compileSdkVersion 32 | ||||
|     buildToolsVersion "32.0.0" | ||||
|  | ||||
|     defaultConfig { | ||||
|         applicationId "cc.winboll.studio.mymessagemanager" | ||||
|         minSdkVersion 26 | ||||
|         minSdkVersion 24 | ||||
|         targetSdkVersion 29 | ||||
|         versionCode 8 | ||||
|         // versionName 更新后需要手动设置  | ||||
|         // .winboll/winbollBuildProps.properties 文件的 stageCount=0 | ||||
|         // Gradle编译环境下合起来的 versionName 就是 "${versionName}.0" | ||||
|         versionName "4.1"  | ||||
|         versionName "15.2"  | ||||
|         if(true) { | ||||
|             versionName = genVersionName("${versionName}") | ||||
|         } | ||||
| @@ -44,26 +44,27 @@ android { | ||||
| } | ||||
|  | ||||
| dependencies { | ||||
| 	api 'cc.winboll.studio:winboll-shared:1.6.4' | ||||
|     api 'io.github.medyo:android-about-page:2.0.0' | ||||
|     api fileTree(dir: 'libs', include: ['*.jar']) | ||||
|     api 'cc.winboll.studio:libaes:15.6.0' | ||||
|     api 'cc.winboll.studio:libapputils:15.3.4' | ||||
|     api 'cc.winboll.studio:libappbase:15.7.6' | ||||
|      | ||||
| 	api 'io.github.medyo:android-about-page:2.0.0' | ||||
|     api 'com.github.getActivity:ToastUtils:10.5' | ||||
|     api 'com.jcraft:jsch:0.1.55' | ||||
|     api 'org.jsoup:jsoup:1.13.1' | ||||
|     api 'com.squareup.okhttp3:okhttp:4.4.1' | ||||
|      | ||||
|     api 'androidx.appcompat:appcompat:1.0.0' | ||||
|     api 'androidx.fragment:fragment:1.0.0' | ||||
|     api 'com.google.android.material:material:1.0.0' | ||||
|      | ||||
|     // 权限请求框架:https://github.com/getActivity/XXPermissions | ||||
|     api 'com.github.getActivity:XXPermissions:18.63' | ||||
|     api 'com.baoyz.pullrefreshlayout:library:1.2.0' | ||||
|      | ||||
|     api 'androidx.appcompat:appcompat:1.0.0' | ||||
|     api 'androidx.fragment:fragment:1.0.0' | ||||
|     // AndroidX 类库 | ||||
|     api 'androidx.appcompat:appcompat:1.1.0' | ||||
|     api 'com.google.android.material:material:1.4.0' | ||||
|     //api 'androidx.viewpager:viewpager:1.0.0' | ||||
|     //api 'androidx.vectordrawable:vectordrawable:1.1.0' | ||||
|     //api 'androidx.vectordrawable:vectordrawable-animated:1.1.0' | ||||
|     //api 'androidx.fragment:fragment:1.1.0' | ||||
|     api 'com.google.android.material:material:1.0.0' | ||||
|      | ||||
|     api 'cc.winboll.studio:libaes:7.6.0' | ||||
|      | ||||
|     api fileTree(dir: 'libs', include: ['*.jar']) | ||||
| } | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| #Created by .winboll/winboll_app_build.gradle | ||||
| #Tue Feb 25 10:52:41 GMT 2025 | ||||
| stageCount=14 | ||||
| #Sat May 03 12:49:28 GMT 2025 | ||||
| stageCount=5 | ||||
| libraryProject= | ||||
| baseVersion=4.1 | ||||
| publishVersion=4.1.13 | ||||
| buildCount=5 | ||||
| baseBetaVersion=4.1.14 | ||||
| baseVersion=15.2 | ||||
| publishVersion=15.2.4 | ||||
| buildCount=14 | ||||
| baseBetaVersion=15.2.5 | ||||
|   | ||||
| @@ -53,30 +53,28 @@ | ||||
|     </queries> | ||||
|  | ||||
|     <application | ||||
|         android:name=".GlobalApplication" | ||||
|         android:name=".App" | ||||
|         android:allowBackup="true" | ||||
|         android:icon="@drawable/ic_launcher" | ||||
|         android:roundIcon="@drawable/ic_launcher" | ||||
|         android:label="@string/app_name" | ||||
|         android:theme="@style/WinBoll.SupportThemeNoActionBar" | ||||
|         android:theme="@style/MyAppTheme" | ||||
|         android:persistent="true" | ||||
|         android:resizeableActivity="true" | ||||
|         android:supportsRtl="true" | ||||
|         android:requestLegacyExternalStorage="true"> | ||||
|         android:requestLegacyExternalStorage="true" | ||||
|         android:networkSecurityConfig="@xml/network_security_config"> | ||||
|  | ||||
|         <activity | ||||
|             android:name=".activitys.SMSActivity" | ||||
|             android:process=":sms"/> | ||||
|             android:name=".activitys.SMSActivity"/> | ||||
|  | ||||
|         <activity | ||||
|             android:name=".activitys.SMSReceiveRuleActivity" | ||||
|             android:process=":smsars"> | ||||
|             android:name=".activitys.SMSReceiveRuleActivity"> | ||||
|  | ||||
|         </activity> | ||||
|  | ||||
|         <activity | ||||
|             android:name=".activitys.SharedJSONReceiveActivity" | ||||
|             android:process=":smssjr" | ||||
|             android:exported="true"> | ||||
|  | ||||
|             <intent-filter> | ||||
| @@ -98,17 +96,14 @@ | ||||
|         </activity> | ||||
|  | ||||
|         <activity | ||||
|             android:name=".activitys.TTSPlayRuleActivity" | ||||
|             android:process=":ttsrule"/> | ||||
|             android:name=".activitys.TTSPlayRuleActivity"/> | ||||
|  | ||||
|         <activity | ||||
|             android:name=".activitys.AboutActivity" | ||||
|             android:process=":about"/> | ||||
|             android:name=".activitys.AboutActivity"/> | ||||
|  | ||||
|         <activity | ||||
|             android:name=".activitys.MainActivity" | ||||
|             android:exported="true" | ||||
|             android:process=":main"> | ||||
|             android:exported="true"> | ||||
|  | ||||
|             <intent-filter> | ||||
|  | ||||
| @@ -122,8 +117,7 @@ | ||||
|  | ||||
|         <activity | ||||
|             android:name=".activitys.ComposeSMSActivity" | ||||
|             android:exported="true" | ||||
|             android:process=":csms"> | ||||
|             android:exported="true"> | ||||
|  | ||||
|             <intent-filter> | ||||
|  | ||||
| @@ -226,6 +220,8 @@ | ||||
|  | ||||
|         <activity android:name="cc.winboll.studio.mymessagemanager.activitys.SMSRecycleActivity"/> | ||||
|  | ||||
|         <activity android:name="cc.winboll.studio.mymessagemanager.unittest.UnitTestActivity"/> | ||||
|  | ||||
|     </application> | ||||
|  | ||||
| </manifest> | ||||
|   | ||||
| @@ -0,0 +1,46 @@ | ||||
| package cc.winboll.studio.mymessagemanager; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen@QQ.COM | ||||
|  * @Date 2023/07/24 01:46:59 | ||||
|  * @Describe 全局应用类 | ||||
|  */ | ||||
| import android.view.Gravity; | ||||
| import cc.winboll.studio.libappbase.GlobalApplication; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import com.hjq.toast.ToastUtils; | ||||
| import java.io.File; | ||||
|  | ||||
| public class App extends GlobalApplication { | ||||
|  | ||||
|     public static final String TAG = "GlobalApplication"; | ||||
|  | ||||
|     static String _mszAppExternalFilesDir; | ||||
|     static String _mszConfigUtilFileName = "ConfigUtil.json"; | ||||
|     static String _mszConfigUtilPath; | ||||
|     static String _mszSMSReceiveRuleUtilFileName = "SMSReceiveRuleUtil.json"; | ||||
|     static String _mszSMSReceiveRuleUtilPath; | ||||
|  | ||||
|     public static final int USER_ID = -1; | ||||
|     Long mszVersionName = 1L; | ||||
|     Long mszDataVersionName = 1L; | ||||
|  | ||||
|  | ||||
|     @Override | ||||
|     public void onCreate() { | ||||
|         super.onCreate(); | ||||
|  | ||||
|         // 初始化 Toast 框架 | ||||
|         ToastUtils.init(this); | ||||
|         // 设置 Toast 布局样式 | ||||
|         ToastUtils.setView(R.layout.toast_custom_view); | ||||
|         //ToastUtils.setStyle(new WhiteToastStyle()); | ||||
|         ToastUtils.setGravity(Gravity.BOTTOM, 0, 200); | ||||
|  | ||||
|         //LogUtils.d(TAG, "BuildConfig.DEBUG " + Boolean.toString(BuildConfig.DEBUG)); | ||||
|  | ||||
|         _mszAppExternalFilesDir = getExternalFilesDir(TAG).toString(); | ||||
|         _mszConfigUtilPath = _mszAppExternalFilesDir + File.separator + _mszConfigUtilFileName; | ||||
|         _mszSMSReceiveRuleUtilPath = _mszAppExternalFilesDir + File.separator + _mszSMSReceiveRuleUtilFileName; | ||||
|     } | ||||
| } | ||||
| @@ -3,72 +3,89 @@ package cc.winboll.studio.mymessagemanager.activitys; | ||||
| /** | ||||
|  * @Author ZhanGSKen<zhangsken@188.com> | ||||
|  * @Date 2024/07/14 13:20:33 | ||||
|  * @Describe 应用关于对话窗口 | ||||
|  * @Describe 应用介绍窗口 | ||||
|  */ | ||||
| import android.os.Bundle; | ||||
| import android.view.Menu; | ||||
| import android.view.MenuItem; | ||||
| import androidx.appcompat.widget.Toolbar; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.shared.app.WinBollActivity; | ||||
| import cc.winboll.studio.shared.app.WinBollActivityManager; | ||||
| import com.hjq.toast.ToastUtils; | ||||
| import cc.winboll.studio.libaes.utils.AESThemeUtil; | ||||
| import android.app.Activity; | ||||
| import android.content.Context; | ||||
| import android.os.Bundle; | ||||
| import android.view.ViewGroup; | ||||
| import android.widget.LinearLayout; | ||||
| import androidx.appcompat.widget.Toolbar; | ||||
| import cc.winboll.studio.libaes.winboll.APPInfo; | ||||
| import cc.winboll.studio.libaes.winboll.AboutView; | ||||
| import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity; | ||||
| import cc.winboll.studio.mymessagemanager.App; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
|  | ||||
| final public class AboutActivity extends WinBollActivity { | ||||
| public class AboutActivity extends WinBollActivity implements IWinBoLLActivity { | ||||
|  | ||||
|     public static final String TAG = "AboutActivity"; | ||||
|  | ||||
|     Context mContext; | ||||
|      | ||||
|     Toolbar mToolbar; | ||||
|  | ||||
|     @Override | ||||
|     public Activity getActivity() { | ||||
|         return this; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getTag() { | ||||
|         return TAG; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     protected boolean isEnableDisplayHomeAsUp() { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     protected void onCreate(Bundle savedInstanceState) { | ||||
|         setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext())); | ||||
|         super.onCreate(savedInstanceState); | ||||
|         mContext = this; | ||||
|         setContentView(R.layout.activity_about); | ||||
|         mContext = getApplicationContext(); | ||||
|  | ||||
|         mToolbar = findViewById(R.id.toolbar); | ||||
|         setSupportActionBar(mToolbar); | ||||
|         mToolbar.setSubtitle(TAG); | ||||
|         getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||||
|  | ||||
|         AboutView aboutView = CreateAboutView(); | ||||
|         // 在 Activity 的 onCreate 或其他生命周期方法中调用 | ||||
| //        LinearLayout layout = new LinearLayout(this); | ||||
| //        layout.setOrientation(LinearLayout.VERTICAL); | ||||
| //        // 创建布局参数(宽度和高度) | ||||
| //        ViewGroup.LayoutParams params = new ViewGroup.LayoutParams( | ||||
| //            ViewGroup.LayoutParams.MATCH_PARENT, | ||||
| //            ViewGroup.LayoutParams.MATCH_PARENT | ||||
| //        ); | ||||
| //        addContentView(aboutView, params); | ||||
|  | ||||
|         LinearLayout layout = findViewById(R.id.aboutviewroot_ll); | ||||
|         // 创建布局参数(宽度和高度) | ||||
|         ViewGroup.LayoutParams params = new ViewGroup.LayoutParams( | ||||
|             ViewGroup.LayoutParams.MATCH_PARENT, | ||||
|             ViewGroup.LayoutParams.MATCH_PARENT | ||||
|         ); | ||||
|         layout.addView(aboutView, params); | ||||
|  | ||||
|         App.getWinBoLLActivityManager().add(this); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     protected void onPostCreate(Bundle savedInstanceState) { | ||||
|         super.onPostCreate(savedInstanceState); | ||||
|         setTitle(mContext.getString(R.string.text_about) + mContext.getString(R.string.app_name)); | ||||
|     protected void onDestroy() { | ||||
|         super.onDestroy(); | ||||
|         App.getWinBoLLActivityManager().registeRemove(this); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     protected boolean isAddWinBollToolBar() { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     protected Toolbar initToolBar() { | ||||
|         return findViewById(R.id.activityaboutASupportToolbar1); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean onCreateOptionsMenu(Menu menu) { | ||||
|         getMenuInflater().inflate(R.menu.toolbar_about, menu); | ||||
|         return super.onCreateOptionsMenu(menu); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean onOptionsItemSelected(MenuItem item) { | ||||
|         /*if (item.getItemId() == R.id.item_help) { | ||||
|             ToastUtils.show("R.id.item_help"); | ||||
|         } else */if (item.getItemId() == android.R.id.home) { | ||||
|             WinBollActivityManager.getInstance(getApplicationContext()).finish(this); | ||||
|         } | ||||
|         return super.onOptionsItemSelected(item); | ||||
|     public AboutView CreateAboutView() { | ||||
|         String szBranchName = "mymessagemanager"; | ||||
|         APPInfo appInfo = new APPInfo(); | ||||
|         appInfo.setAppName(getString(R.string.app_name)); | ||||
|         appInfo.setAppIcon(cc.winboll.studio.libaes.R.drawable.ic_winboll); | ||||
|         appInfo.setAppDescription(getString(R.string.app_description)); | ||||
|         appInfo.setAppGitName("APP"); | ||||
|         appInfo.setAppGitOwner("Studio"); | ||||
|         appInfo.setAppGitAPPBranch(szBranchName); | ||||
|         appInfo.setAppGitAPPSubProjectFolder(szBranchName); | ||||
|         appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=MyMessageManager"); | ||||
|         appInfo.setAppAPKName("MyMessageManager"); | ||||
|         appInfo.setAppAPKFolderName("MyMessageManager"); | ||||
|         return new AboutView(mContext, appInfo); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -17,6 +17,8 @@ import cc.winboll.studio.libaes.views.AToolbar; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.utils.AppConfigUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.PermissionUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.NotificationHelper; | ||||
| import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog; | ||||
|  | ||||
| public class AppSettingsActivity extends BaseActivity { | ||||
|  | ||||
| @@ -96,4 +98,18 @@ public class AppSettingsActivity extends BaseActivity { | ||||
|             Toast.makeText(getApplication(), "应用已获得所需权限。", Toast.LENGTH_SHORT).show(); | ||||
|         } | ||||
|     } | ||||
|      | ||||
|     public void onCleanOldChannels(View view) { | ||||
|         YesNoAlertDialog.show(this, "通知设置清理", "是否清理旧的通知设置?", new YesNoAlertDialog.OnDialogResultListener(){ | ||||
|                 @Override | ||||
|                 public void onNo() { | ||||
|                 } | ||||
|  | ||||
|                 @Override | ||||
|                 public void onYes() { | ||||
|                     NotificationHelper notificationHelper = new NotificationHelper(AppSettingsActivity.this); | ||||
|                     notificationHelper.cleanOldChannels(); | ||||
|                 } | ||||
|             }); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| package cc.winboll.studio.mymessagemanager.activitys; | ||||
|  | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import android.os.Bundle; | ||||
| import android.os.Handler; | ||||
| import android.os.Message; | ||||
| @@ -8,9 +7,8 @@ import android.view.Menu; | ||||
| import android.view.MenuItem; | ||||
| import androidx.appcompat.app.AppCompatActivity; | ||||
| import cc.winboll.studio.libaes.utils.AESThemeUtil; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
| import com.hjq.toast.ToastUtils; | ||||
| import cc.winboll.studio.libaes.beans.AESThemeBean; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
|  | ||||
| abstract public class BaseActivity extends AppCompatActivity { | ||||
|  | ||||
| @@ -103,7 +101,7 @@ abstract public class BaseActivity extends AppCompatActivity { | ||||
|             AESThemeUtil.saveThemeStyleID(this, R.style.MyTaoAESTheme); | ||||
|             recreate(); | ||||
|         } else if (R.id.item_defaulttheme == item.getItemId()) { | ||||
|             AESThemeUtil.saveThemeStyleID(this, R.style.MyDefaultAESTheme); | ||||
|             AESThemeUtil.saveThemeStyleID(this, R.style.MyAppTheme); | ||||
|             recreate(); | ||||
|         } | ||||
|         //ToastUtils.show("nThemeStyleID " + Integer.toString(nThemeStyleID)); | ||||
|   | ||||
| @@ -10,7 +10,6 @@ import android.widget.ListView; | ||||
| import android.widget.RelativeLayout; | ||||
| import android.widget.SimpleAdapter; | ||||
| import android.widget.TextView; | ||||
| import android.widget.Toast; | ||||
| import android.widget.Toolbar; | ||||
| import cc.winboll.studio.libaes.views.AOHPCTCSeekBar; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
|   | ||||
| @@ -10,28 +10,25 @@ import android.view.MenuItem; | ||||
| import android.view.View; | ||||
| import android.widget.Button; | ||||
| import android.widget.ScrollView; | ||||
| import cc.winboll.studio.libaes.views.AToolbar; | ||||
| import androidx.appcompat.widget.Toolbar; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.libappbase.LogView; | ||||
| import cc.winboll.studio.mymessagemanager.App; | ||||
| import cc.winboll.studio.mymessagemanager.BuildConfig; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.MainActivity; | ||||
| import cc.winboll.studio.mymessagemanager.adapters.PhoneArrayAdapter; | ||||
| import cc.winboll.studio.mymessagemanager.services.MainService; | ||||
| import cc.winboll.studio.mymessagemanager.unittest.UnitTestActivity; | ||||
| import cc.winboll.studio.mymessagemanager.utils.AppConfigUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.AppGoToSettingsUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.NotificationUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.PermissionUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.SMSUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.ThemeUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.ViewUtil; | ||||
| import cc.winboll.studio.mymessagemanager.views.ConfirmSwitchView; | ||||
| import cc.winboll.studio.mymessagemanager.views.PhoneListViewForScrollView; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
| import cc.winboll.studio.shared.log.LogView; | ||||
| import com.baoyz.widget.PullRefreshLayout; | ||||
| import java.util.ArrayList; | ||||
| import cc.winboll.studio.libaes.utils.AESThemeUtil; | ||||
| import cc.winboll.studio.libaes.views.ASupportToolbar; | ||||
| import androidx.appcompat.widget.Toolbar; | ||||
|  | ||||
| public class MainActivity extends BaseActivity { | ||||
|  | ||||
| @@ -45,7 +42,7 @@ public class MainActivity extends BaseActivity { | ||||
|     public static final int MY_PERMISSIONS_REQUEST = 0; | ||||
|  | ||||
|     static MainActivity _mMainActivity; | ||||
|     LogView mLogView; | ||||
|     //LogView mLogView; | ||||
|     AppConfigUtil mAppConfigUtil; | ||||
|     ConfirmSwitchView msvEnableService; | ||||
|     ConfirmSwitchView msvOnlyReceiveContacts; | ||||
| @@ -121,8 +118,8 @@ public class MainActivity extends BaseActivity { | ||||
|     // | ||||
|     void initView() { | ||||
|         // 设置调试日志 | ||||
|         mLogView = findViewById(R.id.logview); | ||||
|         mLogView.start(); | ||||
| //        mLogView = findViewById(R.id.logview); | ||||
| //        mLogView.start(); | ||||
|  | ||||
|         // 设置消息处理函数 | ||||
|         setOnActivityMessageReceived(mIOnActivityMessageReceived); | ||||
| @@ -131,12 +128,7 @@ public class MainActivity extends BaseActivity { | ||||
|         mToolbar = findViewById(R.id.activitymainASupportToolbar1); | ||||
|         mToolbar.setSubtitle(getString(R.string.activity_name_main)); | ||||
|         setSupportActionBar(mToolbar); | ||||
|  | ||||
|         // 创建通知频道 | ||||
|         NotificationUtil nu = new NotificationUtil(); | ||||
|         nu.createServiceNotificationChannel(MainActivity.this); | ||||
|         nu.createSMSNotificationChannel(MainActivity.this); | ||||
|  | ||||
|          | ||||
|         boolean isEnableService = mAppConfigUtil.mAppConfigBean.isEnableService(); | ||||
|         msvEnableService = findViewById(R.id.activitymainSwitchView1); | ||||
|         msvEnableService.setChecked(isEnableService); | ||||
| @@ -270,7 +262,7 @@ public class MainActivity extends BaseActivity { | ||||
|     protected void onResume() { | ||||
|         super.onResume(); | ||||
|         reloadSMS(); | ||||
|         mLogView.start(); | ||||
|         //mLogView.start(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
| @@ -303,27 +295,33 @@ public class MainActivity extends BaseActivity { | ||||
| 		int nItemId = item.getItemId(); | ||||
|         if (nItemId == R.id.app_ttsrule) { | ||||
| 			Intent i = new Intent(MainActivity.this, TTSPlayRuleActivity.class); | ||||
| 			i.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
| 			i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
| 			startActivity(i); | ||||
| 		} else if (nItemId == R.id.app_smsrule) { | ||||
| 			Intent i = new Intent(MainActivity.this, SMSReceiveRuleActivity.class); | ||||
| 			i.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
| 			i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
| 			startActivity(i); | ||||
| 		} else if (nItemId == R.id.app_appsettings) { | ||||
|             Intent i = new Intent(MainActivity.this, AppSettingsActivity.class); | ||||
|             i.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
|             i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
|             startActivity(i); | ||||
| 		} else if (nItemId ==  R.id.app_crashtest) { | ||||
| 		} else if (nItemId ==  R.id.app_log) { | ||||
|             App.getWinBoLLActivityManager().startLogActivity(this); | ||||
|         } else if (nItemId ==  R.id.app_unittest) { | ||||
|             Intent i = new Intent(MainActivity.this, UnitTestActivity.class); | ||||
|             i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
| 			startActivity(i); | ||||
|         } else if (nItemId ==  R.id.app_crashtest) { | ||||
|             for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) { | ||||
|                 getString(i); | ||||
|             } | ||||
|         } else if (nItemId ==  R.id.app_about) { | ||||
|             Intent i = new Intent(MainActivity.this, AboutActivity.class); | ||||
|             i.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
|             i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
|             startActivity(i); | ||||
|         } else if (nItemId ==  R.id.app_smsrecycle) { | ||||
|             Intent i = new Intent(MainActivity.this, SMSRecycleActivity.class); | ||||
|             i.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
|             i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
|             startActivity(i); | ||||
|         } | ||||
|          | ||||
|   | ||||
| @@ -18,10 +18,10 @@ import cc.winboll.studio.libaes.views.AOHPCTCSeekBar; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.SMSActivity; | ||||
| import cc.winboll.studio.mymessagemanager.adapters.SMSArrayAdapter; | ||||
| import cc.winboll.studio.mymessagemanager.utils.AddressUtils; | ||||
| import cc.winboll.studio.mymessagemanager.utils.SMSUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.ViewUtil; | ||||
| import cc.winboll.studio.mymessagemanager.views.SMSListViewForScrollView; | ||||
| import cc.winboll.studio.mymessagemanager.views.SMSView; | ||||
| import java.lang.ref.WeakReference; | ||||
|  | ||||
| public class SMSActivity extends BaseActivity { | ||||
| @@ -102,7 +102,7 @@ public class SMSActivity extends BaseActivity { | ||||
|  | ||||
|         // 初始化标题栏 | ||||
|         mToolbar = findViewById(R.id.activitysmsASupportToolbar1); | ||||
|         mToolbar.setSubtitle(getString(R.string.activity_name_smsinphone) + " < Phone : " + mszPhoneTo + " >"); | ||||
|         mToolbar.setSubtitle(getString(R.string.activity_name_smsinphone) + " < Phone : " + AddressUtils.getFormattedAddress(mszPhoneTo) + " >"); | ||||
|         setActionBar(mToolbar); | ||||
|  | ||||
|         // 初始化滚动窗口 | ||||
|   | ||||
| @@ -21,7 +21,7 @@ import android.widget.Toast; | ||||
| import androidx.appcompat.widget.Toolbar; | ||||
| import androidx.recyclerview.widget.LinearLayoutManager; | ||||
| import androidx.recyclerview.widget.RecyclerView; | ||||
| import cc.winboll.studio.mymessagemanager.GlobalApplication; | ||||
| import cc.winboll.studio.mymessagemanager.App; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.SMSReceiveRuleActivity; | ||||
| import cc.winboll.studio.mymessagemanager.adapters.SMSAcceptRuleArrayAdapter; | ||||
| @@ -114,7 +114,7 @@ public class SMSReceiveRuleActivity extends BaseActivity { | ||||
|     } | ||||
|  | ||||
|     void initSMSAcceptRuleBeanAdd() { | ||||
|         mSMSAcceptRuleBeanAdd = new SMSAcceptRuleBean(GlobalApplication.USER_ID, "", true, SMSAcceptRuleBean.RuleType.REFUSE, true); | ||||
|         mSMSAcceptRuleBeanAdd = new SMSAcceptRuleBean(App.USER_ID, "", true, SMSAcceptRuleBean.RuleType.REFUSE, true); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|   | ||||
| @@ -8,16 +8,16 @@ package cc.winboll.studio.mymessagemanager.activitys; | ||||
| import android.os.Bundle; | ||||
| import android.view.Menu; | ||||
| import android.view.MenuItem; | ||||
| import androidx.appcompat.widget.Toolbar; | ||||
| import androidx.recyclerview.widget.LinearLayoutManager; | ||||
| import androidx.recyclerview.widget.RecyclerView; | ||||
| import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.SMSRecycleActivity; | ||||
| import cc.winboll.studio.mymessagemanager.adapters.SMSRecycleAdapter; | ||||
| import cc.winboll.studio.mymessagemanager.utils.SMSRecycleUtil; | ||||
| import cc.winboll.studio.shared.view.YesNoAlertDialog; | ||||
| import com.baoyz.widget.PullRefreshLayout; | ||||
| import java.io.File; | ||||
| import androidx.appcompat.widget.Toolbar; | ||||
|  | ||||
| public class SMSRecycleActivity extends BaseActivity { | ||||
|  | ||||
|   | ||||
| @@ -0,0 +1,60 @@ | ||||
| package cc.winboll.studio.mymessagemanager.activitys; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen@AliYun.Com | ||||
|  * @Date 2025/03/31 01:31:17 | ||||
|  * @Describe 应用活动窗口基类 | ||||
|  */ | ||||
| import android.app.Activity; | ||||
| import android.os.Bundle; | ||||
| import android.view.MenuItem; | ||||
| import androidx.appcompat.app.AppCompatActivity; | ||||
| import cc.winboll.studio.libaes.beans.AESThemeBean; | ||||
| import cc.winboll.studio.libaes.utils.AESThemeUtil; | ||||
| import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity; | ||||
|  | ||||
| public class WinBollActivity extends AppCompatActivity implements IWinBoLLActivity { | ||||
|  | ||||
|     public static final String TAG = "WinBollActivity"; | ||||
|  | ||||
|     protected volatile AESThemeBean.ThemeType mThemeType; | ||||
|  | ||||
|     @Override | ||||
|     public Activity getActivity() { | ||||
|         return this; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getTag() { | ||||
|         return TAG; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     protected void onCreate(Bundle savedInstanceState) { | ||||
|         mThemeType = getThemeType(); | ||||
|         setThemeStyle(); | ||||
|         super.onCreate(savedInstanceState); | ||||
|     } | ||||
|  | ||||
|     AESThemeBean.ThemeType getThemeType() { | ||||
|         /*SharedPreferences sharedPreferences = getSharedPreferences( | ||||
|          SHAREDPREFERENCES_NAME, MODE_PRIVATE); | ||||
|          return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))]; | ||||
|          */ | ||||
|         return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(getApplicationContext())); | ||||
|     } | ||||
|  | ||||
|     void setThemeStyle() { | ||||
|         //setTheme(AESThemeBean.getThemeStyle(getThemeType())); | ||||
|         setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext())); | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public boolean onOptionsItemSelected(MenuItem item) { | ||||
|         if(item.getItemId() == android.R.id.home) { | ||||
|             finish(); | ||||
|             return true; | ||||
|         } | ||||
|         return super.onOptionsItemSelected(item); | ||||
|     } | ||||
| } | ||||
| @@ -9,13 +9,14 @@ import android.view.ViewGroup; | ||||
| import android.widget.BaseAdapter; | ||||
| import android.widget.LinearLayout; | ||||
| import android.widget.TextView; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.SMSActivity; | ||||
| import cc.winboll.studio.mymessagemanager.beans.PhoneBean; | ||||
| import cc.winboll.studio.mymessagemanager.beans.SMSBean; | ||||
| import cc.winboll.studio.mymessagemanager.utils.AddressUtils; | ||||
| import cc.winboll.studio.mymessagemanager.utils.PhoneUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.SMSUtil; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| @@ -74,9 +75,9 @@ public class PhoneArrayAdapter extends BaseAdapter { | ||||
|             viewHolder = (ViewHolder) convertView.getTag(); | ||||
|         } | ||||
|  | ||||
| 		String szAddress = ((SMSBean)getItem(position)).getAddress(); | ||||
| 		final String szAddress = ((SMSBean)getItem(position)).getAddress(); | ||||
|  | ||||
| 		viewHolder.tvAddress.setText(szAddress); | ||||
| 		viewHolder.tvAddress.setText(AddressUtils.getFormattedAddress(szAddress)); | ||||
| 		viewHolder.tvName.setText(getName(szAddress)); | ||||
|  | ||||
|         //Drawable drawableFrame = AppCompatResources.getDrawable(mContext, R.drawable.bg_frame); | ||||
| @@ -87,7 +88,7 @@ public class PhoneArrayAdapter extends BaseAdapter { | ||||
|  | ||||
|                     //Toast.makeText(mContext, tv.getText(), Toast.LENGTH_SHORT).show(); | ||||
|                     Intent intent = new Intent(mContext, SMSActivity.class); | ||||
|                     intent.putExtra(SMSActivity.EXTRA_PHONE, viewHolder.tvAddress.getText()); | ||||
|                     intent.putExtra(SMSActivity.EXTRA_PHONE, szAddress); | ||||
|                     mContext.startActivity(intent); | ||||
|                 } | ||||
|  | ||||
|   | ||||
| @@ -18,7 +18,6 @@ import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.TTSPlayRuleActivity; | ||||
| import cc.winboll.studio.mymessagemanager.beans.SMSBean; | ||||
| import cc.winboll.studio.mymessagemanager.dialogs.YesNoAlertDialog; | ||||
| import cc.winboll.studio.mymessagemanager.utils.NotificationUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.SMSReceiveRuleUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.SMSRecycleUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.SMSUtil; | ||||
| @@ -28,6 +27,7 @@ import cc.winboll.studio.mymessagemanager.views.SMSView; | ||||
| import com.hjq.toast.ToastUtils; | ||||
| import java.util.ArrayList; | ||||
| import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean; | ||||
| import cc.winboll.studio.mymessagemanager.utils.NotificationHelper; | ||||
|  | ||||
| public class SMSArrayAdapter extends BaseAdapter { | ||||
|  | ||||
| @@ -54,7 +54,8 @@ public class SMSArrayAdapter extends BaseAdapter { | ||||
|  | ||||
|     public void cancelMessageNotification() { | ||||
|         for (SMSBean bean : mData) { | ||||
|             NotificationUtil.cancelNotification(mContext, bean.getId()); | ||||
|             NotificationHelper notificationHelper = new NotificationHelper(mContext); | ||||
|             notificationHelper.cancelNotification(bean.getId()); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -34,6 +34,7 @@ import cc.winboll.studio.mymessagemanager.views.DateAgoTextView; | ||||
| import cc.winboll.studio.mymessagemanager.views.SMSView; | ||||
| import com.hjq.toast.ToastUtils; | ||||
| import java.util.ArrayList; | ||||
| import cc.winboll.studio.mymessagemanager.utils.AddressUtils; | ||||
|  | ||||
| public class SMSRecycleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | ||||
|  | ||||
| @@ -154,7 +155,7 @@ public class SMSRecycleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol | ||||
|         final SMSRecycleBean item = mDataList.get(position); | ||||
|         if (holder.getItemViewType() == 0) { | ||||
|             SimpleViewHolder viewHolder = (SimpleViewHolder) holder; | ||||
|             viewHolder.mtvAddress.setText(item.getAddress()); | ||||
|             viewHolder.mtvAddress.setText(AddressUtils.getFormattedAddress(item.getAddress())); | ||||
|             viewHolder.mbtnViewBody.setOnClickListener(new View.OnClickListener(){ | ||||
|                     @Override | ||||
|                     public void onClick(View v) { | ||||
| @@ -179,7 +180,7 @@ public class SMSRecycleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol | ||||
|                 viewHolder.mvRight.setVisibility(View.GONE); | ||||
|                 viewHolder.mSMSView.setSMSType(SMSView.SMSType.SEND); | ||||
|             } | ||||
|             viewHolder.mtvAddress.setText(item.getAddress()); | ||||
|             viewHolder.mtvAddress.setText(AddressUtils.getFormattedAddress(item.getAddress())); | ||||
|             viewHolder.mdatvDeleteDate.setDate(item.getDeleteDate()); | ||||
|             viewHolder.mdatvDate.setDate(item.getDate()); | ||||
|             if(mAppConfigUtil.mAppConfigBean.isSMSRecycleProtectMode()) { | ||||
|   | ||||
| @@ -7,8 +7,7 @@ package cc.winboll.studio.mymessagemanager.beans; | ||||
|  */ | ||||
| import android.util.JsonReader; | ||||
| import android.util.JsonWriter; | ||||
| import cc.winboll.studio.mymessagemanager.utils.ThemeUtil; | ||||
| import cc.winboll.studio.shared.app.BaseBean; | ||||
| import cc.winboll.studio.libappbase.BaseBean; | ||||
| import java.io.IOException; | ||||
|  | ||||
| public class AppConfigBean extends BaseBean { | ||||
|   | ||||
| @@ -7,7 +7,7 @@ package cc.winboll.studio.mymessagemanager.beans; | ||||
|  */ | ||||
| import android.util.JsonReader; | ||||
| import android.util.JsonWriter; | ||||
| import cc.winboll.studio.shared.app.BaseBean; | ||||
| import cc.winboll.studio.libappbase.BaseBean; | ||||
| import java.io.IOException; | ||||
|  | ||||
| public class SMSAcceptRuleBean extends BaseBean { | ||||
|   | ||||
| @@ -34,7 +34,7 @@ package cc.winboll.studio.mymessagemanager.beans; | ||||
| import android.content.ContentValues; | ||||
| import android.util.JsonReader; | ||||
| import android.util.JsonWriter; | ||||
| import cc.winboll.studio.shared.app.BaseBean; | ||||
| import cc.winboll.studio.libappbase.BaseBean; | ||||
| import java.io.IOException; | ||||
| import java.text.Collator; | ||||
| import java.util.ArrayList; | ||||
|   | ||||
| @@ -7,7 +7,7 @@ package cc.winboll.studio.mymessagemanager.beans; | ||||
|  */ | ||||
| import android.util.JsonReader; | ||||
| import android.util.JsonWriter; | ||||
| import cc.winboll.studio.shared.app.BaseBean; | ||||
| import cc.winboll.studio.libappbase.BaseBean; | ||||
| import java.io.IOException; | ||||
| import java.text.Collator; | ||||
| import java.util.ArrayList; | ||||
|   | ||||
| @@ -7,7 +7,7 @@ package cc.winboll.studio.mymessagemanager.beans; | ||||
|  */ | ||||
| import android.util.JsonReader; | ||||
| import android.util.JsonWriter; | ||||
| import cc.winboll.studio.shared.app.BaseBean; | ||||
| import cc.winboll.studio.libappbase.BaseBean; | ||||
| import java.io.IOException; | ||||
|  | ||||
| public class TTSPlayRuleBean extends BaseBean { | ||||
|   | ||||
| @@ -8,8 +8,8 @@ package cc.winboll.studio.mymessagemanager.beans; | ||||
| import android.content.Context; | ||||
| import android.util.JsonReader; | ||||
| import android.util.JsonWriter; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.utils.FileUtil; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
| import java.io.IOException; | ||||
| import java.io.StringReader; | ||||
| import java.io.StringWriter; | ||||
|   | ||||
| @@ -10,9 +10,9 @@ import android.content.BroadcastReceiver; | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import android.os.Build; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.services.MainService; | ||||
| import cc.winboll.studio.mymessagemanager.utils.AppConfigUtil; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
|  | ||||
| public class MainReceiver extends BroadcastReceiver { | ||||
|  | ||||
|   | ||||
| @@ -4,17 +4,17 @@ import android.content.BroadcastReceiver; | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import androidx.localbroadcastmanager.content.LocalBroadcastManager; | ||||
| import cc.winboll.studio.mymessagemanager.GlobalApplication; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.App; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.SMSActivity; | ||||
| import cc.winboll.studio.mymessagemanager.beans.SMSBean; | ||||
| import cc.winboll.studio.mymessagemanager.utils.AppConfigUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.NotificationUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.PhoneUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.SMSReceiveRuleUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.SMSRecycleUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.SMSUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.TTSPlayRuleUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.RegexPPiUtils; | ||||
| import cc.winboll.studio.mymessagemanager.utils.NotificationHelper; | ||||
|  | ||||
| public class SMSRecevier extends BroadcastReceiver { | ||||
|  | ||||
| @@ -36,34 +36,20 @@ public class SMSRecevier extends BroadcastReceiver { | ||||
|  | ||||
|         String szAction = intent.getAction(); | ||||
|         if (szAction.equals(ACTION_SMS_RECEIVED)) { | ||||
|             //LogUtils.d(TAG, "ACTION_SMS_RECEIVED"); | ||||
|             LogUtils.d(TAG, "ACTION_SMS_RECEIVED"); | ||||
|             String szSmsBody = SMSUtil.getSmsBody(intent); | ||||
|             String szSmsAddress = SMSUtil.getSmsAddress(intent); | ||||
|             PhoneUtil phoneUtil = new PhoneUtil(context); | ||||
|             boolean isPhoneInContacts = phoneUtil.isPhoneInContacts(szSmsAddress); | ||||
|             AppConfigUtil configUtil = AppConfigUtil.getInstance(context); | ||||
|             boolean isOnlyReceiveContacts = configUtil.mAppConfigBean.isEnableOnlyReceiveContacts(); | ||||
|             boolean isEnableTTS = configUtil.mAppConfigBean.isEnableTTS(); | ||||
|             boolean isEnableTTSAnalyzeMode = configUtil.mAppConfigBean.isEnableTTSRuleMode(); | ||||
|             boolean isInSMSAcceptRule = SMSReceiveRuleUtil.getInstance(context, false).checkIsSMSAcceptInRule(context, szSmsBody); | ||||
|             //LogUtils.d(TAG, "isInSMSAcceptRule is : " + Boolean.toString(isInSMSAcceptRule)); | ||||
|  | ||||
|             if (!isPhoneInContacts) { | ||||
|                 GlobalApplication.showApplicationMessage(" The phone number " + szSmsAddress + " is not in contacts."); | ||||
|                 if (isOnlyReceiveContacts) { | ||||
|                     GlobalApplication.showApplicationMessage("Close the \"Only Receive Contacts\" switch will be receive The " + szSmsAddress + "'s message in future."); | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             if ((!isOnlyReceiveContacts) | ||||
|                 || isPhoneInContacts | ||||
|                 || isInSMSAcceptRule) { | ||||
|             if (checkIsSMSOK(context, szSmsBody, szSmsAddress)) { | ||||
|                 int nResultId = SMSUtil.saveReceiveSms(context, szSmsAddress, szSmsBody, "0", System.currentTimeMillis(), "inbox"); | ||||
|                 if (nResultId >= 0) { | ||||
|                     NotificationUtil nu = new NotificationUtil(); | ||||
|                     nu.sendSMSReceivedMessage(context, nResultId, szSmsAddress, szSmsBody); | ||||
|                     NotificationHelper notificationHelper = new NotificationHelper(context); | ||||
|                     notificationHelper.sendSMSReceivedMessage(nResultId, szSmsAddress, szSmsBody); | ||||
|                     LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(SMSActivity.ACTION_NOTIFY_SMS_CHANGED)); | ||||
|                     GlobalApplication.showApplicationMessage("<" + szSmsAddress + "> : ( " + szSmsBody + " ) [SAVED]"); | ||||
|                     LogUtils.d(TAG, "<" + szSmsAddress + "> : ( " + szSmsBody + " ) [SAVED]"); | ||||
|                     if (isEnableTTS) { | ||||
|                         if (isEnableTTSAnalyzeMode) { | ||||
|                             TTSPlayRuleUtil ttsPlayRuleUtil = TTSPlayRuleUtil.getInstance(context); | ||||
| @@ -81,12 +67,41 @@ public class SMSRecevier extends BroadcastReceiver { | ||||
|                 SMSRecycleUtil.addSMSRecycleItem(context, bean); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|  | ||||
|  | ||||
|     } | ||||
|  | ||||
|     // | ||||
|     // 检查短信是否在接收设定规则内 | ||||
|     // | ||||
|     public static boolean checkIsSMSOK(Context context, String szSmsBody, String szSmsAddress) { | ||||
|         PhoneUtil phoneUtil = new PhoneUtil(context); | ||||
|         boolean isPhoneInContacts = phoneUtil.isPhoneInContacts(szSmsAddress); | ||||
|         LogUtils.d(TAG, String.format("isPhoneInContacts %s", isPhoneInContacts)); | ||||
|  | ||||
|         boolean isPhoneByDigit = phoneUtil.isPhoneByDigit(szSmsAddress); | ||||
|         LogUtils.d(TAG, String.format("isPhoneByDigit %s", isPhoneByDigit)); | ||||
|  | ||||
|         AppConfigUtil configUtil = AppConfigUtil.getInstance(context); | ||||
|         boolean isOnlyReceiveContacts = configUtil.mAppConfigBean.isEnableOnlyReceiveContacts(); | ||||
|         LogUtils.d(TAG, String.format("isOnlyReceiveContacts %s", isOnlyReceiveContacts)); | ||||
|  | ||||
|         boolean isInSMSAcceptRule = SMSReceiveRuleUtil.getInstance(context, false).checkIsSMSAcceptInRule(context, szSmsBody); | ||||
|         LogUtils.d(TAG, String.format("isInSMSAcceptRule %s", isInSMSAcceptRule)); | ||||
|  | ||||
|         // 启用了只接受通讯录,通讯录里有记录 | ||||
|         if (isOnlyReceiveContacts && isPhoneInContacts) { | ||||
|             return true; | ||||
|         } | ||||
|         // 如果不是数字通讯地址,但是在通讯录内 | ||||
|         if (!isPhoneByDigit && isPhoneInContacts) { | ||||
|             return true; | ||||
|         } | ||||
|         // 通讯地址是数字,并且在短信接收规则内。 | ||||
|         if (isPhoneByDigit && isInSMSAcceptRule) { | ||||
|             return true; | ||||
|         } | ||||
|          | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
|      | ||||
|      | ||||
|   | ||||
| @@ -5,6 +5,7 @@ package cc.winboll.studio.mymessagemanager.services; | ||||
|  * @Date 2024/07/19 14:30:57 | ||||
|  * @Describe 应用主要服务组件类 | ||||
|  */ | ||||
| import android.app.Notification; | ||||
| import android.app.Service; | ||||
| import android.content.ComponentName; | ||||
| import android.content.Context; | ||||
| @@ -12,20 +13,24 @@ import android.content.Intent; | ||||
| import android.content.IntentFilter; | ||||
| import android.content.ServiceConnection; | ||||
| import android.os.IBinder; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.MainActivity; | ||||
| import cc.winboll.studio.mymessagemanager.beans.MessageNotificationBean; | ||||
| import cc.winboll.studio.mymessagemanager.receivers.SMSRecevier; | ||||
| import cc.winboll.studio.mymessagemanager.services.MainService; | ||||
| import cc.winboll.studio.mymessagemanager.utils.AppConfigUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.NotificationUtil; | ||||
| import cc.winboll.studio.mymessagemanager.utils.NotificationHelper; | ||||
| import cc.winboll.studio.mymessagemanager.utils.ServiceUtil; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
| import com.hjq.toast.ToastUtils; | ||||
|  | ||||
| public class MainService extends Service { | ||||
|  | ||||
|     public static String TAG = "ManagerService"; | ||||
|  | ||||
|     // 前台服务通知工具 | ||||
|     NotificationHelper mNotificationHelper; | ||||
|     Notification notification; | ||||
|     AppConfigUtil mConfigUtil; | ||||
|     //MyBinder mMyBinder; | ||||
|     MyServiceConnection mMyServiceConnection; | ||||
| @@ -73,17 +78,12 @@ public class MainService extends Service { | ||||
|                 mSMSRecevier = new SMSRecevier(); | ||||
|                 registerReceiver(mSMSRecevier, localIntentFilter); | ||||
|  | ||||
|  | ||||
|                 // 显示前台通知栏 | ||||
|                 MessageNotificationBean notificationMessage = createNotificationMessage(); | ||||
|                 NotificationUtil nu = new NotificationUtil(); | ||||
|                 nu.sendForegroundNotification(MainService.this, notificationMessage); | ||||
|                 NotificationHelper helper = new NotificationHelper(this); | ||||
|                 Intent intent = new Intent(this, MainActivity.class); | ||||
|                 notification = helper.showForegroundNotification(intent, getString(R.string.app_name), getString(R.string.text_aboutservernotification)); | ||||
|                 startForeground(NotificationHelper.FOREGROUND_NOTIFICATION_ID, notification); | ||||
|  | ||||
|                 /*if (mConfigUtil.isEnableTTS()) { | ||||
|                  TTSPlayRuleUtil.speakText(ManagerService.this, getString(R.string.text_iamhere), 0); | ||||
|                  GlobalApplication.showApplicationMessage(getString(R.string.text_iamhere)); | ||||
|                  }*/ | ||||
|                   | ||||
|                 ToastUtils.show("Service is start."); | ||||
|                 LogUtils.i(TAG, "Service is start."); | ||||
|             } | ||||
| @@ -101,13 +101,6 @@ public class MainService extends Service { | ||||
|  | ||||
|     } | ||||
|  | ||||
|     private MessageNotificationBean createNotificationMessage() { | ||||
|         String szTitle = getApplicationContext().getString(R.string.app_name); | ||||
|         String szContent = getString(R.string.text_aboutservernotification); | ||||
|         return new MessageNotificationBean(NotificationUtil.ID_MSG_SERVICE, "", szTitle, szContent); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public int onStartCommand(Intent intent, int flags, int startId) { | ||||
|         //return super.onStartCommand(intent, flags, startId); | ||||
| @@ -116,12 +109,12 @@ public class MainService extends Service { | ||||
|         return mConfigUtil.mAppConfigBean.isEnableService() ? Service.START_STICKY: super.onStartCommand(intent, flags, startId); | ||||
|     } | ||||
|  | ||||
|    /*private class MyBinder extends IMyAidlInterface.Stub { | ||||
|         @Override | ||||
|         public String getServiceName() { | ||||
|             return MainService.class.getSimpleName(); | ||||
|         } | ||||
|     }*/ | ||||
|     /*private class MyBinder extends IMyAidlInterface.Stub { | ||||
|      @Override | ||||
|      public String getServiceName() { | ||||
|      return MainService.class.getSimpleName(); | ||||
|      } | ||||
|      }*/ | ||||
|  | ||||
|     // 主进程与守护进程连接时需要用到此类 | ||||
|     // | ||||
|   | ||||
| @@ -0,0 +1,28 @@ | ||||
| package cc.winboll.studio.mymessagemanager.unittest; | ||||
| import android.content.Context; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.utils.AddressUtils; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen@AliYun.Com | ||||
|  * @Date 2025/03/01 13:07:32 | ||||
|  * @Describe AddressUtils Test | ||||
|  */ | ||||
| public class AddressUtils_Test { | ||||
|  | ||||
|     public static final String TAG = "AddressUtils_Test"; | ||||
|  | ||||
|     public static void main(Context context) { | ||||
|         String szSmsBody = "无影无迹"; | ||||
|         String szSmsAddress = "无名小辈"; | ||||
|         LogUtils.d(TAG, String.format("szSmsAddress %s\n getFormattedAddress : %s", szSmsAddress, AddressUtils.getFormattedAddress(szSmsAddress))); | ||||
|         szSmsAddress = "13172887736"; | ||||
|         LogUtils.d(TAG, String.format("szSmsAddress %s\n getFormattedAddress : %s", szSmsAddress, AddressUtils.getFormattedAddress(szSmsAddress))); | ||||
|         szSmsAddress = "+8613172887736"; | ||||
|         LogUtils.d(TAG, String.format("szSmsAddress %s\n getFormattedAddress : %s", szSmsAddress, AddressUtils.getFormattedAddress(szSmsAddress))); | ||||
|         szSmsAddress = "8613172887736"; | ||||
|         LogUtils.d(TAG, String.format("szSmsAddress %s\n getFormattedAddress : %s", szSmsAddress, AddressUtils.getFormattedAddress(szSmsAddress))); | ||||
|          | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,56 @@ | ||||
| package cc.winboll.studio.mymessagemanager.unittest; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen@AliYun.Com | ||||
|  * @Date 2025/02/25 19:02:15 | ||||
|  * @Describe SMSRecevier 测试类 | ||||
|  */ | ||||
| import android.content.Context; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.receivers.SMSRecevier; | ||||
|  | ||||
| public class SMSRecevier_Test { | ||||
|  | ||||
|     public static final String TAG = "SMSRecevier_Test"; | ||||
|  | ||||
|     public static void main(Context context) { | ||||
|         String szSmsBody = "无影无迹"; | ||||
|         String szSmsAddress = "无名小辈"; | ||||
|         test1(context, szSmsBody, szSmsAddress); | ||||
|          | ||||
|         szSmsBody = "无影无迹"; | ||||
|         szSmsAddress = "淘宝物流"; | ||||
|         test1(context, szSmsBody, szSmsAddress); | ||||
|          | ||||
|         szSmsBody = "无影无迹"; | ||||
|         szSmsAddress = "1?0"; | ||||
|         test1(context, szSmsBody, szSmsAddress); | ||||
|          | ||||
|         szSmsBody = "无影无迹"; | ||||
|         szSmsAddress = "10000"; | ||||
|         test1(context, szSmsBody, szSmsAddress); | ||||
|          | ||||
|         szSmsBody = "【UC】无影无迹"; | ||||
|         szSmsAddress = "无名小辈"; | ||||
|         test1(context, szSmsBody, szSmsAddress); | ||||
|          | ||||
|         szSmsBody = "【UC】无影无迹"; | ||||
|         szSmsAddress = "10000"; | ||||
|         test1(context, szSmsBody, szSmsAddress); | ||||
|          | ||||
|         szSmsBody = "【UC】无影无迹"; | ||||
|         szSmsAddress = "13172887736"; | ||||
|         test1(context, szSmsBody, szSmsAddress); | ||||
|          | ||||
|         szSmsBody = "【UC】无影无迹"; | ||||
|         szSmsAddress = "+8613172887736"; | ||||
|         test1(context, szSmsBody, szSmsAddress); | ||||
|          | ||||
|     } | ||||
|      | ||||
|     public static void test1(Context context, String szSmsBody, String szSmsAddress) { | ||||
|          | ||||
|         boolean isSMSOK = SMSRecevier.checkIsSMSOK(context, szSmsBody, szSmsAddress); | ||||
|         LogUtils.d(TAG, String.format("szSmsBody : %s\nszSmsAddress : %s\nisSMSOK : %s", szSmsBody, szSmsAddress, isSMSOK)); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,36 @@ | ||||
| package cc.winboll.studio.mymessagemanager.unittest; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen@AliYun.Com | ||||
|  * @Date 2025/02/25 19:00:10 | ||||
|  * @Describe 应用单元测试窗口 | ||||
|  */ | ||||
| import android.app.Activity; | ||||
| import android.os.Bundle; | ||||
| import android.view.View; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.libappbase.LogView; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
|  | ||||
| public class UnitTestActivity extends Activity { | ||||
|  | ||||
|     public static final String TAG = "UnitTestActivity"; | ||||
|  | ||||
|     LogView mLogView; | ||||
|      | ||||
|     @Override | ||||
|     protected void onCreate(Bundle savedInstanceState) { | ||||
|         super.onCreate(savedInstanceState); | ||||
|         setContentView(R.layout.activity_unittest); | ||||
|          | ||||
|         mLogView = findViewById(R.id.logview); | ||||
|         mLogView.start(); | ||||
|     } | ||||
|  | ||||
|     public void onMain(View view) { | ||||
|         LogUtils.d(TAG, "SMSRecevier_Test"); | ||||
|         SMSRecevier_Test.main(this); | ||||
|         LogUtils.d(TAG, "AddressUtils_Test"); | ||||
|         AddressUtils_Test.main(this); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,20 @@ | ||||
| package cc.winboll.studio.mymessagemanager.utils; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen@AliYun.Com | ||||
|  * @Date 2025/03/01 13:03:16 | ||||
|  * @Describe 通信录地址工具 | ||||
|  */ | ||||
| public class AddressUtils { | ||||
|      | ||||
|     public static final String TAG = "AddressUtils"; | ||||
|      | ||||
|     public static String getFormattedAddress(String address) { | ||||
|         if (address != null && address.matches("[+]?\\d+")) { | ||||
|             return address; | ||||
|         } else { | ||||
|             return "【" + address + "】"; | ||||
|         } | ||||
|     } | ||||
|      | ||||
| } | ||||
| @@ -10,7 +10,7 @@ import android.content.Intent; | ||||
| import android.content.res.AssetManager; | ||||
| import android.net.Uri; | ||||
| import androidx.core.content.FileProvider; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import java.io.File; | ||||
| import java.io.FileInputStream; | ||||
| import java.io.FileOutputStream; | ||||
|   | ||||
| @@ -0,0 +1,202 @@ | ||||
| package cc.winboll.studio.mymessagemanager.utils; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen@AliYun.Com | ||||
|  * @Date 2025/04/01 14:10:35 | ||||
|  * @Describe 应用通知工具类 | ||||
|  */ | ||||
| import android.app.Notification; | ||||
| import android.app.NotificationChannel; | ||||
| import android.app.NotificationManager; | ||||
| import android.app.PendingIntent; | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import android.graphics.BitmapFactory; | ||||
| import android.os.Build; | ||||
| import android.widget.RemoteViews; | ||||
| import androidx.annotation.RequiresApi; | ||||
| import androidx.core.app.NotificationCompat; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.SMSActivity; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| public class NotificationHelper { | ||||
|     public static final String TAG = "NotificationHelper"; | ||||
|  | ||||
|     // 渠道ID和名称 | ||||
|     private static final String CHANNEL_ID_FOREGROUND = "foreground_channel"; | ||||
|     private static final String CHANNEL_NAME_FOREGROUND = "Foreground Service"; | ||||
|     private static final String CHANNEL_ID_TEMPORARY = "temporary_channel"; | ||||
|     private static final String CHANNEL_NAME_TEMPORARY = "Temporary Notifications"; | ||||
|  | ||||
|     // 通知ID | ||||
|     public static final int FOREGROUND_NOTIFICATION_ID = 1001; | ||||
|     public static final int TEMPORARY_NOTIFICATION_ID = 2001; | ||||
|  | ||||
|     private final Context mContext; | ||||
|     private final NotificationManager mNotificationManager; | ||||
|  | ||||
|     // 示例:维护当前使用的渠道ID列表 | ||||
|     // 键:渠道ID,值:渠道重要性级别 | ||||
|     Map<String, Integer> activeChannelConfigs = new HashMap<>(); | ||||
|  | ||||
|     public NotificationHelper(Context context) { | ||||
|         mContext = context; | ||||
|         mNotificationManager = context.getSystemService(NotificationManager.class); | ||||
|  | ||||
|         // 初始化配置 | ||||
|         activeChannelConfigs.put( | ||||
|             CHANNEL_ID_FOREGROUND, | ||||
|             NotificationManager.IMPORTANCE_HIGH | ||||
|         ); | ||||
|         activeChannelConfigs.put( | ||||
|             CHANNEL_ID_TEMPORARY, | ||||
|             NotificationManager.IMPORTANCE_DEFAULT | ||||
|         ); | ||||
|  | ||||
|         createNotificationChannels(); | ||||
|     } | ||||
|  | ||||
|     @RequiresApi(api = Build.VERSION_CODES.O) | ||||
|     private void createNotificationChannels() { | ||||
|         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||||
|             createForegroundChannel(); | ||||
|             createTemporaryChannel(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @RequiresApi(api = Build.VERSION_CODES.O) | ||||
|     private void createForegroundChannel() { | ||||
|         NotificationChannel channel = new NotificationChannel( | ||||
|             CHANNEL_ID_FOREGROUND, | ||||
|             CHANNEL_NAME_FOREGROUND, | ||||
|             NotificationManager.IMPORTANCE_LOW | ||||
|         ); | ||||
|         channel.setDescription("Persistent service notifications"); | ||||
|         channel.setSound(null, null); | ||||
|         channel.enableVibration(false); | ||||
|         mNotificationManager.createNotificationChannel(channel); | ||||
|     } | ||||
|  | ||||
|     @RequiresApi(api = Build.VERSION_CODES.O) | ||||
|     private void createTemporaryChannel() { | ||||
|         NotificationChannel channel = new NotificationChannel( | ||||
|             CHANNEL_ID_TEMPORARY, | ||||
|             CHANNEL_NAME_TEMPORARY, | ||||
|             NotificationManager.IMPORTANCE_HIGH | ||||
|         ); | ||||
|         channel.setDescription("Temporary alert notifications"); | ||||
|         channel.setSound(null, null); | ||||
|         channel.enableVibration(true); | ||||
|         channel.setVibrationPattern(new long[]{100, 200, 300, 400}); | ||||
|         channel.setBypassDnd(true); | ||||
|         mNotificationManager.createNotificationChannel(channel); | ||||
|     } | ||||
|  | ||||
|     // 显示常驻通知(通常用于前台服务) | ||||
|     public Notification showForegroundNotification(Intent intent, String title, String content) { | ||||
|         PendingIntent pendingIntent = createPendingIntent(intent); | ||||
|  | ||||
|         Notification notification = new NotificationCompat.Builder(mContext, CHANNEL_ID_FOREGROUND) | ||||
|             .setSmallIcon(R.drawable.ic_launcher) | ||||
|             .setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(), R.drawable.ic_launcher)) | ||||
|             //.setContentTitle(title) | ||||
|             .setContentTitle(content) | ||||
|             //.setContentText(content) | ||||
|             .setContentIntent(pendingIntent) | ||||
|             .setPriority(NotificationCompat.PRIORITY_LOW) | ||||
|             .setOngoing(true) | ||||
|             .build(); | ||||
|  | ||||
|         mNotificationManager.notify(FOREGROUND_NOTIFICATION_ID, notification); | ||||
|         return notification; | ||||
|     } | ||||
|  | ||||
|     // 显示临时通知(自动消失) | ||||
|     public void showTemporaryNotification(Intent intent, String title, String content) { | ||||
|         showTemporaryNotification(intent, TEMPORARY_NOTIFICATION_ID, title, content); | ||||
|     } | ||||
|  | ||||
|     // 显示临时通知(自动消失) | ||||
|     public void showTemporaryNotification(Intent intent, int notificationID, String title, String content) { | ||||
|         PendingIntent pendingIntent = createPendingIntent(intent); | ||||
|  | ||||
|         Notification notification = new NotificationCompat.Builder(mContext, CHANNEL_ID_TEMPORARY) | ||||
|             .setSmallIcon(R.drawable.ic_launcher) | ||||
|             .setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(), R.drawable.ic_launcher)) | ||||
|             .setContentTitle(title) | ||||
|             .setContentText(content) | ||||
|             .setContentIntent(pendingIntent) | ||||
|             .setPriority(NotificationCompat.PRIORITY_HIGH) | ||||
|             .setAutoCancel(true) | ||||
|             .setVibrate(new long[]{100, 200, 300, 400}) | ||||
|             .build(); | ||||
|  | ||||
|         mNotificationManager.notify(notificationID, notification); | ||||
|     } | ||||
|  | ||||
|     // 创建自定义布局通知(可扩展) | ||||
|     public void showCustomNotification(Intent intent, RemoteViews contentView, RemoteViews bigContentView) { | ||||
|         PendingIntent pendingIntent = createPendingIntent(intent); | ||||
|  | ||||
|         Notification notification = new NotificationCompat.Builder(mContext, CHANNEL_ID_TEMPORARY) | ||||
|             .setSmallIcon(R.drawable.ic_launcher) | ||||
|             .setContentIntent(pendingIntent) | ||||
|             .setContent(contentView) | ||||
|             .setCustomBigContentView(bigContentView) | ||||
|             .setPriority(NotificationCompat.PRIORITY_HIGH) | ||||
|             .setAutoCancel(true) | ||||
|             .build(); | ||||
|  | ||||
|         mNotificationManager.notify(TEMPORARY_NOTIFICATION_ID + 1, notification); | ||||
|     } | ||||
|  | ||||
|     // 取消所有通知 | ||||
|     public void cancelAllNotifications() { | ||||
|         mNotificationManager.cancelAll(); | ||||
|     } | ||||
|  | ||||
|     // 取消指定通知 | ||||
|     public void cancelNotification(int notificationID) { | ||||
|         mNotificationManager.cancel(notificationID); | ||||
|     } | ||||
|  | ||||
|     // 创建PendingIntent(兼容不同API版本) | ||||
|     private PendingIntent createPendingIntent(Intent intent) { | ||||
|         int flags = PendingIntent.FLAG_UPDATE_CURRENT; | ||||
| //        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { | ||||
| //            flags |= PendingIntent.FLAG_IMMUTABLE; | ||||
| //        } | ||||
|         return PendingIntent.getActivity( | ||||
|             mContext, | ||||
|             0, | ||||
|             intent, | ||||
|             flags | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     public void sendSMSReceivedMessage(int notificationID, String szPhone, String szBody) { | ||||
|         Intent intent = new Intent(mContext, SMSActivity.class); | ||||
| 		intent.putExtra(SMSActivity.EXTRA_PHONE, szPhone); | ||||
|         String szTitle = mContext.getString(R.string.text_smsfrom)  + "<" + szPhone + ">"; | ||||
|         String szContent = "[ " + szBody + " ]"; | ||||
|         showTemporaryNotification(intent, notificationID, szTitle, szContent); | ||||
|     } | ||||
|  | ||||
|     public void cleanOldChannels() { | ||||
|         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||||
|             List<NotificationChannel> allChannels = mNotificationManager.getNotificationChannels(); | ||||
|             for (NotificationChannel channel : allChannels) { | ||||
|                 LogUtils.d(TAG, "Clean channel : " + channel.getId()); | ||||
|                 if (!activeChannelConfigs.containsKey(channel.getId())) { | ||||
|                     // 安全删除渠道 | ||||
|                     mNotificationManager.deleteNotificationChannel(channel.getId()); | ||||
|                     LogUtils.d(TAG, String.format("Deleted Channel %s", channel.getId())); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| package cc.winboll.studio.mymessagemanager.utils; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen@QQ.COM | ||||
|  * @Date 2024/07/19 14:30:57 | ||||
|  * @Describe 应用通知栏工具类 | ||||
|  */ | ||||
| import android.app.Notification; | ||||
| import android.app.NotificationChannel; | ||||
| import android.app.NotificationManager; | ||||
| import android.app.PendingIntent; | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import android.graphics.BitmapFactory; | ||||
| import android.graphics.Color; | ||||
| import android.media.RingtoneManager; | ||||
| import android.widget.RemoteViews; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.MainActivity; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.SMSActivity; | ||||
| import cc.winboll.studio.mymessagemanager.beans.MessageNotificationBean; | ||||
| import cc.winboll.studio.mymessagemanager.services.MainService; | ||||
|  | ||||
| public class NotificationUtil_Bck { | ||||
|  | ||||
|     public static final String TAG = "NotificationUtil"; | ||||
|     public static final int ID_MSG_SERVICE = 10000; | ||||
|  | ||||
|     static final String szSMSChannelID = "1"; | ||||
|  | ||||
|     static final String szServiceChannelID = "0"; | ||||
|  | ||||
|  | ||||
|     //static int mNumSendForegroundNotification = 10000; | ||||
|     //static int mNumSendSMSNotification = 20000; | ||||
|  | ||||
|     public NotificationManager createServiceNotificationChannel(Context context) { | ||||
|         //创建通知渠道ID | ||||
| 		String channelId = szServiceChannelID; | ||||
| 		//创建通知渠道名称 | ||||
| 		String channelName = "Service Message"; | ||||
| 		//创建通知渠道重要性 | ||||
| 		int importance = NotificationManager.IMPORTANCE_MIN; | ||||
| 		NotificationChannel channel = new NotificationChannel(channelId, channelName, importance); | ||||
| 		channel.setSound(null, null); | ||||
| 		NotificationManager notificationManager = (NotificationManager) context.getSystemService( | ||||
| 			Context.NOTIFICATION_SERVICE); | ||||
| 		notificationManager.createNotificationChannel(channel); | ||||
| 		return notificationManager; | ||||
|     } | ||||
|  | ||||
|     public NotificationManager createSMSNotificationChannel(Context context) { | ||||
|         //创建通知渠道ID | ||||
| 		String channelId = szSMSChannelID; | ||||
| 		//创建通知渠道名称 | ||||
| 		String channelName = "SMS Message"; | ||||
| 		//创建通知渠道重要性 | ||||
| 		int importance = NotificationManager.IMPORTANCE_HIGH; | ||||
| 		NotificationChannel channel = new NotificationChannel(channelId, channelName, importance); | ||||
| 		channel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE), Notification.AUDIO_ATTRIBUTES_DEFAULT); | ||||
| 		NotificationManager notificationManager = (NotificationManager) context.getSystemService( | ||||
| 			Context.NOTIFICATION_SERVICE); | ||||
| 		notificationManager.createNotificationChannel(channel); | ||||
| 		return notificationManager; | ||||
|     } | ||||
|  | ||||
|     // 创建通知 | ||||
|     // | ||||
|     public void sendForegroundNotification(MainService service, MessageNotificationBean nessageNotificationBean) { | ||||
| 		//创建Notification,传入Context和channelId | ||||
| 		Intent intent = new Intent();//这个intent会传给目标,可以使用getIntent来获取 | ||||
| 		intent.setClass(service, MainActivity.class); | ||||
|  | ||||
| 		//这里放一个count用来区分每一个通知 | ||||
| 		//intent.putExtra("intent", "intent--->" + count);//这里设置一个数据,带过去 | ||||
|  | ||||
| 		//参数1:context 上下文对象 | ||||
| 		//参数2:发送者私有的请求码(Private request code for the sender) | ||||
| 		//参数3:intent 意图对象 | ||||
| 		//参数4:必须为FLAG_ONE_SHOT,FLAG_NO_CREATE,FLAG_CANCEL_CURRENT,FLAG_UPDATE_CURRENT,中的一个 | ||||
| 		PendingIntent mForegroundPendingIntent = PendingIntent.getActivity(service, nessageNotificationBean.getMessageId(), intent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_CANCEL_CURRENT); | ||||
|  | ||||
| 		Notification mForegroundNotification = new Notification.Builder(service, szServiceChannelID) | ||||
| 			.setAutoCancel(true) | ||||
| 			.setContentTitle(nessageNotificationBean.getTitle()) | ||||
| 			.setContentText(nessageNotificationBean.getContent()) | ||||
| 			.setWhen(System.currentTimeMillis()) | ||||
| 			.setSmallIcon(R.drawable.ic_launcher) | ||||
| 			//设置红色 | ||||
| 			.setColor(Color.parseColor("#F00606")) | ||||
| 			.setLargeIcon(BitmapFactory.decodeResource(service.getResources(), R.drawable.ic_launcher)) | ||||
| 			.setContentIntent(mForegroundPendingIntent) | ||||
| 			.build(); | ||||
|  | ||||
|  | ||||
| 		RemoteViews mrvForegroundNotificationView = new RemoteViews(service.getPackageName(), R.layout.remoteview); | ||||
| 		mrvForegroundNotificationView.setTextViewText(R.id.remoteviewTextView1, nessageNotificationBean.getTitle()); | ||||
| 		mrvForegroundNotificationView.setTextViewText(R.id.remoteviewTextView2, nessageNotificationBean.getContent()); | ||||
| 		mrvForegroundNotificationView.setImageViewResource(R.id.remoteviewImageView1, R.drawable.ic_launcher); | ||||
| 		mForegroundNotification.contentView = mrvForegroundNotificationView; | ||||
| 		mForegroundNotification.bigContentView = mrvForegroundNotificationView; | ||||
|  | ||||
| 		service.startForeground(nessageNotificationBean.getMessageId(), mForegroundNotification); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     public void sendSMSNotification(Context context, MessageNotificationBean messageNotificationBean) { | ||||
|         NotificationManager notificationManager = (NotificationManager) context.getSystemService( | ||||
| 			Context.NOTIFICATION_SERVICE); | ||||
| 		/*NotificationManager notificationManager = createSMSNotificationChannel(context); | ||||
| 		 if (notificationManager == null) { | ||||
| 		 LogUtils.d(TAG, "createSMSNotificationChannel failed."); | ||||
| 		 return; | ||||
| 		 }*/ | ||||
|  | ||||
| 		//创建Notification,传入Context和channelId | ||||
| 		Intent intent = new Intent(context, SMSActivity.class); | ||||
| 		intent.putExtra(SMSActivity.EXTRA_PHONE, messageNotificationBean.getPhone()); | ||||
| 		LogUtils.d(TAG, "sendSMSNotification(...) message.getPhone() is : " + messageNotificationBean.getPhone()); | ||||
| 		//Intent intent = new Intent();//这个intent会传给目标,可以使用getIntent来获取 | ||||
| 		//intent.setClass(context, MainActivity.class); | ||||
| 		//这里放一个count用来区分每一个通知 | ||||
| 		//intent.putExtra("intent", "intent--->" + count);//这里设置一个数据,带过去 | ||||
|  | ||||
| 		//参数1:context 上下文对象 | ||||
| 		//参数2:发送者私有的请求码(Private request code for the sender) | ||||
| 		//参数3:intent 意图对象 | ||||
| 		//参数4:必须为FLAG_ONE_SHOT,FLAG_NO_CREATE,FLAG_CANCEL_CURRENT,FLAG_UPDATE_CURRENT,中的一个 | ||||
| 		PendingIntent mRemindPendingIntent = PendingIntent.getActivity(context, messageNotificationBean.getMessageId(), intent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_CANCEL_CURRENT); | ||||
| 		Notification mSMSNotification = new Notification.Builder(context, szSMSChannelID) | ||||
| 			.setAutoCancel(true) | ||||
| 			.setContentTitle(messageNotificationBean.getTitle()) | ||||
| 			.setContentText(messageNotificationBean.getContent()) | ||||
| 			.setWhen(System.currentTimeMillis()) | ||||
| 			.setSmallIcon(R.drawable.ic_launcher) | ||||
| 			//设置红色 | ||||
| 			.setColor(Color.parseColor("#F00606")) | ||||
| 			.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_launcher)) | ||||
| 			.setContentIntent(mRemindPendingIntent) | ||||
| 			.build(); | ||||
|  | ||||
| 		RemoteViews mrvSMSNotificationView = new RemoteViews(context.getPackageName(), R.layout.remoteview); | ||||
| 		mrvSMSNotificationView.setTextViewText(R.id.remoteviewTextView1, messageNotificationBean.getTitle()); | ||||
| 		mrvSMSNotificationView.setTextViewText(R.id.remoteviewTextView2, messageNotificationBean.getContent()); | ||||
| 		mrvSMSNotificationView.setImageViewResource(R.id.remoteviewImageView1, R.drawable.ic_launcher); | ||||
| 		mSMSNotification.contentView = mrvSMSNotificationView; | ||||
| 		mSMSNotification.bigContentView = mrvSMSNotificationView; | ||||
| 		notificationManager.notify(messageNotificationBean.getMessageId(), mSMSNotification); | ||||
|         LogUtils.d(TAG, "getMessageId is : " + Integer.toString(messageNotificationBean.getMessageId())); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     public void sendSMSReceivedMessage(Context context, int nMessageId, String szPhone, String szBody) { | ||||
|         String szTitle = context.getString(R.string.text_smsfrom)  + "<" + szPhone + ">"; | ||||
|         String szContent = "[ " + szBody + " ]"; | ||||
|         sendSMSNotification(context, new MessageNotificationBean(nMessageId, szPhone, szTitle, szContent)); | ||||
|     } | ||||
|  | ||||
|     public static void cancelNotification(Context context, int notificationId) { | ||||
|         // 获取 NotificationManager 实例 | ||||
|         NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); | ||||
|         // 撤回指定 ID 的通知栏消息 | ||||
|         notificationManager.cancel(notificationId); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -10,9 +10,9 @@ import android.content.Context; | ||||
| import android.content.DialogInterface; | ||||
| import android.content.Intent; | ||||
| import android.net.Uri; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.BaseActivity; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
| import com.hjq.permissions.OnPermissionCallback; | ||||
| import com.hjq.permissions.Permission; | ||||
| import com.hjq.permissions.XXPermissions; | ||||
|   | ||||
| @@ -10,11 +10,14 @@ import android.content.Context; | ||||
| import android.database.Cursor; | ||||
| import android.net.Uri; | ||||
| import android.provider.ContactsContract; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.beans.PhoneBean; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Collections; | ||||
| import java.util.Comparator; | ||||
| import java.util.List; | ||||
| import java.util.regex.Matcher; | ||||
| import java.util.regex.Pattern; | ||||
|  | ||||
| public class PhoneUtil { | ||||
|  | ||||
| @@ -59,12 +62,57 @@ public class PhoneUtil { | ||||
|  | ||||
|     public boolean isPhoneInContacts(String szPhone) { | ||||
|         List<PhoneBean> listPhoneDto = getPhoneList(); | ||||
|         LogUtils.d(TAG, String.format("isPhoneInContacts(...) listPhoneDto.size() %d", listPhoneDto.size())); | ||||
|         for (int i = 0; i < listPhoneDto.size(); i++) { | ||||
|             if (listPhoneDto.get(i).getTelPhone().equals(szPhone)) { | ||||
|             if (isTheSamePhoneNumber(listPhoneDto.get(i).getTelPhone(), szPhone)) { | ||||
|                 return true; | ||||
|             } | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
|      | ||||
|     boolean isTheSamePhoneNumber(String szNum1, String szNum2) { | ||||
|         //LogUtils.d(TAG, String.format("szNum1 %s\nszNum2 %s", szNum1, szNum2)); | ||||
|         if(szNum1.equals(szNum2)) { | ||||
|             LogUtils.d(TAG, "szNum1.equals(szNum2)"); | ||||
|             return true; | ||||
|         } | ||||
|          | ||||
|         if(UnitAreaUtils.getInstance(mContext).isCurrentUnitAreaNumber(szNum1)) { | ||||
|             if(szNum1.equals(UnitAreaUtils.getInstance(mContext).genCurrentUnitAreaNumber(szNum2))) { | ||||
|                 LogUtils.d(TAG, "szNum1.equals(UnitAreaUtils.genCurrentUnitAreaNumber(szNum2))"); | ||||
|                 return true; | ||||
|             } | ||||
|         } | ||||
|          | ||||
|         if(UnitAreaUtils.getInstance(mContext).isCurrentUnitAreaNumber(szNum2)) { | ||||
|             if(szNum2.equals(UnitAreaUtils.getInstance(mContext).genCurrentUnitAreaNumber(szNum1))) { | ||||
|                 LogUtils.d(TAG, "szNum2.equals(UnitAreaUtils.genCurrentUnitAreaNumber(szNum1))"); | ||||
|                 return true; | ||||
|             } | ||||
|         } | ||||
|          | ||||
|         LogUtils.d(TAG, "isTheSamePhoneNumber(...) return false;"); | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     // | ||||
|     // 检验电话号码是否是数字 | ||||
|     // | ||||
|     public static boolean isPhoneByDigit(String szPhone) { | ||||
|         if(!RegexPPiUtils.isPPiOK(szPhone)) { | ||||
|             return false; | ||||
|         } | ||||
|         //String text = "这里是一些任意的文本内容"; | ||||
|         String regex = "[+]?\\d+"; | ||||
|         Pattern pattern = Pattern.compile(regex); | ||||
|         Matcher matcher = pattern.matcher(szPhone); | ||||
|         LogUtils.d(TAG, String.format("matcher.matches() : %s", matcher.matches())); | ||||
|         /*if (matcher.matches()) { | ||||
|          System.out.println("文本满足该正则表达式模式"); | ||||
|          } else { | ||||
|          System.out.println("文本不满足该正则表达式模式"); | ||||
|          }*/ | ||||
|         return matcher.matches(); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -7,9 +7,9 @@ package cc.winboll.studio.mymessagemanager.utils; | ||||
|  */ | ||||
| import android.content.Context; | ||||
| import android.util.JsonReader; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean; | ||||
| import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean_V1; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
| import java.io.InputStreamReader; | ||||
| @@ -18,7 +18,6 @@ import java.util.ArrayList; | ||||
| import java.util.Collections; | ||||
| import java.util.Comparator; | ||||
| import java.util.List; | ||||
| import java.nio.channels.AcceptPendingException; | ||||
|  | ||||
| public class SMSReceiveRuleUtil { | ||||
|  | ||||
| @@ -194,9 +193,9 @@ public class SMSReceiveRuleUtil { | ||||
|     public ArrayList<SMSAcceptRuleBean> loadConfigData() { | ||||
|         ArrayList<SMSAcceptRuleBean> list = new ArrayList<SMSAcceptRuleBean>(); | ||||
|         SMSAcceptRuleBean.loadBeanList(mContext, list, SMSAcceptRuleBean.class); | ||||
|         for (int i = 0; i < list.size(); i++) { | ||||
|             LogUtils.d(TAG, "loadConfigData isEnable : " + Boolean.toString(list.get(i).isEnable())); | ||||
|         } | ||||
| //        for (int i = 0; i < list.size(); i++) { | ||||
| //            LogUtils.d(TAG, "loadConfigData isEnable : " + Boolean.toString(list.get(i).isEnable())); | ||||
| //        } | ||||
|         mDataList.clear(); | ||||
|         mDataList.addAll(list); | ||||
|         return mDataList; | ||||
|   | ||||
| @@ -6,7 +6,7 @@ package cc.winboll.studio.mymessagemanager.utils; | ||||
|  * @Describe 短信回收站工具类 | ||||
|  */ | ||||
| import android.content.Context; | ||||
| import cc.winboll.studio.mymessagemanager.GlobalApplication; | ||||
| import cc.winboll.studio.mymessagemanager.App; | ||||
| import cc.winboll.studio.mymessagemanager.beans.SMSBean; | ||||
| import cc.winboll.studio.mymessagemanager.beans.SMSRecycleBean; | ||||
| import java.util.ArrayList; | ||||
|   | ||||
| @@ -17,8 +17,8 @@ import android.os.Bundle; | ||||
| import android.provider.Telephony; | ||||
| import android.telephony.gsm.SmsManager; | ||||
| import android.telephony.gsm.SmsMessage; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.beans.SMSBean; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
| import com.hjq.toast.ToastUtils; | ||||
| import java.util.ArrayList; | ||||
|  | ||||
|   | ||||
| @@ -10,6 +10,7 @@ import android.content.Intent; | ||||
| import android.os.Message; | ||||
| import android.util.JsonReader; | ||||
| import android.widget.Toast; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.activitys.TTSPlayRuleActivity; | ||||
| import cc.winboll.studio.mymessagemanager.beans.TTSPlayRuleBean; | ||||
| @@ -17,7 +18,6 @@ import cc.winboll.studio.mymessagemanager.beans.TTSPlayRuleBean_V1; | ||||
| import cc.winboll.studio.mymessagemanager.beans.TTSSpeakTextBean; | ||||
| import cc.winboll.studio.mymessagemanager.dialogs.YesNoAlertDialog; | ||||
| import cc.winboll.studio.mymessagemanager.services.TTSPlayService; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
| import java.io.File; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
|   | ||||
| @@ -14,9 +14,9 @@ import android.view.Gravity; | ||||
| import android.view.View; | ||||
| import android.view.WindowManager; | ||||
| import android.widget.LinearLayout; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.R; | ||||
| import cc.winboll.studio.mymessagemanager.beans.TTSSpeakTextBean; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
| import java.util.ArrayList; | ||||
|  | ||||
| public class TextToSpeechUtil { | ||||
|   | ||||
| @@ -0,0 +1,47 @@ | ||||
| package cc.winboll.studio.mymessagemanager.utils; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen@AliYun.Com | ||||
|  * @Date 2025/04/14 15:55:36 | ||||
|  * @Describe 电话号码区域管理辅助类 | ||||
|  */ | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.beans.AppConfigBean; | ||||
| import android.content.Context; | ||||
|  | ||||
| public class UnitAreaUtils { | ||||
|      | ||||
|     public static final String TAG = "UnitAreaUtils"; | ||||
|      | ||||
|     static UnitAreaUtils _UnitAreaUtils; | ||||
|     Context mContext; | ||||
|  | ||||
|     UnitAreaUtils(Context context) { | ||||
|         mContext = context; | ||||
|     } | ||||
|  | ||||
|     public static UnitAreaUtils getInstance(Context context) { | ||||
|         if (_UnitAreaUtils == null) { | ||||
|             _UnitAreaUtils = new UnitAreaUtils(context); | ||||
|         } | ||||
|         return _UnitAreaUtils; | ||||
|     } | ||||
|      | ||||
|     public boolean isCurrentUnitAreaNumber(String szPhoneNumer) { | ||||
|         String szUnitArea = getUnitArea(); | ||||
|         LogUtils.d(TAG, String.format("szPhoneNumer.substring(1,3) %s", szPhoneNumer.substring(1,3))); | ||||
|         return szPhoneNumer.substring(1,3).equals(szUnitArea); | ||||
|     } | ||||
|      | ||||
|     public String genCurrentUnitAreaNumber(String szPhoneNumer) { | ||||
|         String szUnitArea = getUnitArea(); | ||||
|         LogUtils.d(TAG, String.format("szUnitArea %s", szUnitArea)); | ||||
|         return "+" + szUnitArea + szPhoneNumer; | ||||
|     } | ||||
|      | ||||
|     String getUnitArea() { | ||||
|         String szUnitArea = AppConfigUtil.getInstance(mContext).mAppConfigBean.getCountryCode(); | ||||
|         LogUtils.d(TAG, String.format("szUnitArea %s", szUnitArea)); | ||||
|         return szUnitArea; | ||||
|     } | ||||
| } | ||||
| @@ -8,8 +8,8 @@ import android.content.Context; | ||||
| import android.util.AttributeSet; | ||||
| import android.view.View; | ||||
| import android.widget.Switch; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.mymessagemanager.dialogs.YesNoAlertDialog; | ||||
| import cc.winboll.studio.shared.log.LogUtils; | ||||
|  | ||||
| public class ConfirmSwitchView extends Switch { | ||||
|  | ||||
|   | ||||
| @@ -1,29 +1,21 @@ | ||||
| <?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"> | ||||
|  | ||||
|    <!--<androidx.appcompat.widget.Toolbar | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:id="@+id/activityaboutToolbar1"/>--> | ||||
|     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"> | ||||
|  | ||||
|     <cc.winboll.studio.libaes.views.ASupportToolbar | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="@dimen/toolbar_height" | ||||
| 		android:id="@+id/activityaboutASupportToolbar1"/> | ||||
|         android:layout_height="wrap_content" | ||||
|         android:id="@+id/toolbar"/> | ||||
|  | ||||
|     <cc.winboll.studio.shared.view.AboutView | ||||
|         app:appname="MyMessageManager" | ||||
|         app:appprojectname="MyMessageManager" | ||||
|         app:appdescription="用正则表达式方法自定义短信过滤和语音播报的短信应用。" | ||||
|         app:appicon="@drawable/ic_winboll" | ||||
|     <LinearLayout | ||||
|         android:orientation="vertical" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="match_parent" | ||||
|         android:id="@+id/activityaboutAboutView1"/> | ||||
|         android:layout_height="0dp" | ||||
|         android:layout_weight="1.0" | ||||
|         android:id="@+id/aboutviewroot_ll"/> | ||||
|  | ||||
| </LinearLayout> | ||||
|  | ||||
|   | ||||
| @@ -213,6 +213,12 @@ | ||||
| 						android:text="检查应用权限" | ||||
| 						android:onClick="onCheckAndGetAppPermission"/> | ||||
|  | ||||
|                     <Button | ||||
|                         android:layout_width="wrap_content" | ||||
|                         android:layout_height="wrap_content" | ||||
|                         android:text="清理通知设置" | ||||
|                         android:onClick="onCleanOldChannels"/> | ||||
|                      | ||||
| 				</LinearLayout> | ||||
|  | ||||
| 			</LinearLayout> | ||||
|   | ||||
| @@ -72,11 +72,5 @@ | ||||
|  | ||||
| 	</com.baoyz.widget.PullRefreshLayout> | ||||
|  | ||||
| 	<cc.winboll.studio.shared.log.LogView | ||||
| 		android:orientation="horizontal" | ||||
| 		android:layout_width="match_parent" | ||||
| 		android:layout_height="120dp" | ||||
| 		android:id="@+id/logview"/> | ||||
|  | ||||
| </LinearLayout> | ||||
|  | ||||
|   | ||||
							
								
								
									
										44
									
								
								mymessagemanager/src/main/res/layout/activity_unittest.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								mymessagemanager/src/main/res/layout/activity_unittest.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,44 @@ | ||||
| <?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"> | ||||
|  | ||||
| 	<ScrollView | ||||
| 		android:layout_width="match_parent" | ||||
| 		android:layout_height="500dp"> | ||||
|  | ||||
| 		<LinearLayout | ||||
| 			android:orientation="vertical" | ||||
| 			android:layout_width="match_parent" | ||||
| 			android:layout_height="wrap_content"> | ||||
|  | ||||
| 			<LinearLayout | ||||
| 				android:orientation="horizontal" | ||||
| 				android:layout_width="match_parent" | ||||
| 				android:layout_height="wrap_content" | ||||
| 				android:gravity="right"> | ||||
|  | ||||
| 				<Button | ||||
| 					android:layout_width="wrap_content" | ||||
| 					android:layout_height="wrap_content" | ||||
| 					android:text="Test Main" | ||||
| 					android:onClick="onMain" | ||||
| 					android:textAllCaps="false"/> | ||||
|  | ||||
| 			</LinearLayout> | ||||
|  | ||||
| 		</LinearLayout> | ||||
|  | ||||
| 	</ScrollView> | ||||
|  | ||||
| 	<cc.winboll.studio.shared.log.LogView | ||||
| 		android:layout_width="match_parent" | ||||
| 		android:layout_height="0dp" | ||||
| 		android:layout_weight="1.0" | ||||
| 		android:id="@+id/logview"/> | ||||
|  | ||||
| </LinearLayout> | ||||
|  | ||||
| @@ -19,6 +19,12 @@ | ||||
|         android:title="@string/text_smsrule"/> | ||||
|     <item android:title="@string/app_developoptions"> | ||||
|         <menu> | ||||
|             <item | ||||
|                 android:id="@+id/app_log" | ||||
|                 android:title="@string/app_log"/> | ||||
|             <item | ||||
|                 android:id="@+id/app_unittest" | ||||
|                 android:title="@string/app_unittest"/> | ||||
|             <item | ||||
|                 android:id="@+id/app_crashtest" | ||||
|                 android:title="@string/app_crashtest"/> | ||||
|   | ||||
| @@ -9,6 +9,7 @@ | ||||
|     <string name="app_goldentheme">辉煌历程主题</string> | ||||
|     <string name="app_developoptions">开发选项</string> | ||||
|     <string name="app_default_app_settings">默认应用设置</string> | ||||
|     <string name="app_unittest">单元测试</string> | ||||
|     <string name="app_crashtest">应用异常崩溃处理测试</string> | ||||
|     <string name="app_about">关于应用</string> | ||||
|     <string name="app_smsrecycle">短信回收站</string> | ||||
|   | ||||
| @@ -9,6 +9,7 @@ | ||||
|     <string name="app_goldentheme">Golden Theme</string> | ||||
|     <string name="app_developoptions">Develop Options</string> | ||||
|     <string name="app_default_app_settings">Default App Settings</string> | ||||
|     <string name="app_unittest">Unit Test</string> | ||||
|     <string name="app_crashtest">Crash Test</string> | ||||
|     <string name="app_about">About APP</string> | ||||
|     <string name="app_smsrecycle">SMS Recycle</string> | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <resources> | ||||
|  | ||||
|     <style name="MyDefaultAESTheme" parent="DefaultAESTheme"> | ||||
|     <style name="MyAppTheme" parent="AESTheme"> | ||||
|         <item name="android:textSize">20sp</item> | ||||
|         <item name="attrSMSViewSendColor">@color/colorSMSSendColor</item> | ||||
|         <item name="attrSMSViewInboxColor">@color/colorSMSInboxColor</item> | ||||
|   | ||||
| @@ -0,0 +1,6 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <network-security-config> | ||||
|     <domain-config cleartextTrafficPermitted="true"> | ||||
|         <domain includeSubdomains="true">winboll.cc</domain> | ||||
|     </domain-config> | ||||
| </network-security-config> | ||||
		Reference in New Issue
	
	Block a user
	 ZhanGSKen
					ZhanGSKen