合并20250520_122311_006
This commit is contained in:
		| @@ -29,7 +29,7 @@ android { | |||||||
|         // versionName 更新后需要手动设置  |         // versionName 更新后需要手动设置  | ||||||
|         // 项目模块目录的 build.gradle 文件的 stageCount=0 |         // 项目模块目录的 build.gradle 文件的 stageCount=0 | ||||||
|         // Gradle编译环境下合起来的 versionName 就是 "${versionName}.0" |         // Gradle编译环境下合起来的 versionName 就是 "${versionName}.0" | ||||||
|         versionName "15.2"  |         versionName "15.3"  | ||||||
|         if(true) { |         if(true) { | ||||||
|             versionName = genVersionName("${versionName}") |             versionName = genVersionName("${versionName}") | ||||||
|         } |         } | ||||||
| @@ -45,6 +45,9 @@ android { | |||||||
|  |  | ||||||
| dependencies { | dependencies { | ||||||
|     api fileTree(dir: 'libs', include: ['*.jar']) |     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' | ||||||
|      |      | ||||||
|     // 权限请求框架:https://github.com/getActivity/XXPermissions |     // 权限请求框架:https://github.com/getActivity/XXPermissions | ||||||
|     api 'com.github.getActivity:XXPermissions:18.63' |     api 'com.github.getActivity:XXPermissions:18.63' | ||||||
| @@ -81,8 +84,4 @@ dependencies { | |||||||
|     //api 'androidx.vectordrawable:vectordrawable:1.1.0' |     //api 'androidx.vectordrawable:vectordrawable:1.1.0' | ||||||
|     //api 'androidx.vectordrawable:vectordrawable-animated:1.1.0' |     //api 'androidx.vectordrawable:vectordrawable-animated:1.1.0' | ||||||
|     //api 'androidx.fragment:fragment:1.1.0' |     //api 'androidx.fragment:fragment:1.1.0' | ||||||
|      |  | ||||||
|     api 'cc.winboll.studio:libaes:15.2.4' |  | ||||||
|     api 'cc.winboll.studio:libapputils:15.2.1' |  | ||||||
|     api 'cc.winboll.studio:libappbase:15.2.2' |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| #Created by .winboll/winboll_app_build.gradle | #Created by .winboll/winboll_app_build.gradle | ||||||
| #Sun Apr 13 02:46:09 HKT 2025 | #Mon May 05 03:56:16 HKT 2025 | ||||||
| stageCount=8 | stageCount=2 | ||||||
| libraryProject= | libraryProject= | ||||||
| baseVersion=15.2 | baseVersion=15.3 | ||||||
| publishVersion=15.2.7 | publishVersion=15.3.1 | ||||||
| buildCount=0 | buildCount=0 | ||||||
| baseBetaVersion=15.2.8 | baseBetaVersion=15.3.2 | ||||||
|   | |||||||
| @@ -42,7 +42,8 @@ | |||||||
|         android:icon="@drawable/ic_winboll" |         android:icon="@drawable/ic_winboll" | ||||||
|         android:label="@string/app_name" |         android:label="@string/app_name" | ||||||
|         android:theme="@style/MyAppTheme" |         android:theme="@style/MyAppTheme" | ||||||
|         android:supportsRtl="true"> |         android:supportsRtl="true" | ||||||
|  |         android:networkSecurityConfig="@xml/network_security_config"> | ||||||
|  |  | ||||||
|         <activity |         <activity | ||||||
|             android:name=".MainActivity" |             android:name=".MainActivity" | ||||||
| @@ -192,4 +193,4 @@ | |||||||
|  |  | ||||||
|     </application> |     </application> | ||||||
|  |  | ||||||
| </manifest> | </manifest> | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ package cc.winboll.studio.contacts; | |||||||
|  */ |  */ | ||||||
| import android.view.Gravity; | import android.view.Gravity; | ||||||
| import cc.winboll.studio.libappbase.GlobalApplication; | import cc.winboll.studio.libappbase.GlobalApplication; | ||||||
| import cc.winboll.studio.libappbase.winboll.WinBollActivityManager; | import cc.winboll.studio.libappbase.winboll.WinBoLLActivityManager; | ||||||
| import com.hjq.toast.ToastUtils; | import com.hjq.toast.ToastUtils; | ||||||
|  |  | ||||||
| public class App extends GlobalApplication { | public class App extends GlobalApplication { | ||||||
| @@ -20,8 +20,8 @@ public class App extends GlobalApplication { | |||||||
|         // 这样可以预先设置日志与数据的存储根目录。 |         // 这样可以预先设置日志与数据的存储根目录。 | ||||||
|         //setIsDebuging(BuildConfig.DEBUG); |         //setIsDebuging(BuildConfig.DEBUG); | ||||||
|         super.onCreate(); |         super.onCreate(); | ||||||
|         // 设置 WinBoll 应用 UI 类型 |         // 设置 WinBoLL 应用 UI 类型 | ||||||
|         WinBollActivityManager.getInstance(this).setWinBollUI_TYPE(WinBollActivityManager.WinBollUI_TYPE.Aplication); |         getWinBoLLActivityManager().setWinBoLLUI_TYPE(WinBoLLActivityManager.WinBoLLUI_TYPE.Aplication); | ||||||
|          |          | ||||||
|         //LogUtils.d(TAG, "onCreate"); |         //LogUtils.d(TAG, "onCreate"); | ||||||
|          |          | ||||||
|   | |||||||
| @@ -32,22 +32,21 @@ import cc.winboll.studio.contacts.fragments.CallLogFragment; | |||||||
| import cc.winboll.studio.contacts.fragments.ContactsFragment; | import cc.winboll.studio.contacts.fragments.ContactsFragment; | ||||||
| import cc.winboll.studio.contacts.fragments.LogFragment; | import cc.winboll.studio.contacts.fragments.LogFragment; | ||||||
| import cc.winboll.studio.contacts.services.MainService; | import cc.winboll.studio.contacts.services.MainService; | ||||||
| import cc.winboll.studio.libaes.winboll.APPInfo; |  | ||||||
| import cc.winboll.studio.libappbase.LogUtils; | import cc.winboll.studio.libappbase.LogUtils; | ||||||
| import cc.winboll.studio.libappbase.LogView; | import cc.winboll.studio.libappbase.LogView; | ||||||
| import cc.winboll.studio.libappbase.winboll.IWinBollActivity; | import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity; | ||||||
| import com.google.android.material.tabs.TabLayout; | import com.google.android.material.tabs.TabLayout; | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| import java.util.List; | import java.util.List; | ||||||
|  |  | ||||||
| final public class MainActivity extends AppCompatActivity implements IWinBollActivity, ViewPager.OnPageChangeListener, View.OnClickListener { | final public class MainActivity extends AppCompatActivity implements IWinBoLLActivity, ViewPager.OnPageChangeListener, View.OnClickListener { | ||||||
|  |  | ||||||
| 	public static final String TAG = "MainActivity"; | 	public static final String TAG = "MainActivity"; | ||||||
|  |  | ||||||
|     public static final int REQUEST_HOME_ACTIVITY = 0; |     public static final int REQUEST_HOME_ACTIVITY = 0; | ||||||
|     public static final int REQUEST_ABOUT_ACTIVITY = 1; |     public static final int REQUEST_ABOUT_ACTIVITY = 1; | ||||||
|  |  | ||||||
|     public static final String ACTION_SOS = "cc.winboll.studio.libappbase.WinBoll.ACTION_SOS"; |     public static final String ACTION_SOS = "cc.winboll.studio.libappbase.WinBoLL.ACTION_SOS"; | ||||||
|  |  | ||||||
|     static MainActivity _MainActivity; |     static MainActivity _MainActivity; | ||||||
|     LogView mLogView; |     LogView mLogView; | ||||||
| @@ -71,10 +70,10 @@ final public class MainActivity extends AppCompatActivity implements IWinBollAct | |||||||
|  |  | ||||||
|     private static final int DIALER_REQUEST_CODE = 1; |     private static final int DIALER_REQUEST_CODE = 1; | ||||||
|  |  | ||||||
|     @Override | //    @Override | ||||||
|     public Activity getActivity() { | //    public Activity getActivity() { | ||||||
|         return this; | //        return this; | ||||||
|     } | //    } | ||||||
|  |  | ||||||
| //    @Override | //    @Override | ||||||
| //    public APPInfo getAppInfo() { | //    public APPInfo getAppInfo() { | ||||||
| @@ -95,6 +94,17 @@ final public class MainActivity extends AppCompatActivity implements IWinBollAct | |||||||
| //        return null; | //        return null; | ||||||
| //    } | //    } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public Activity getActivity() { | ||||||
|  |         return this; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public String getTag() { | ||||||
|  |         return TAG; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     protected void onCreate(Bundle savedInstanceState) { |     protected void onCreate(Bundle savedInstanceState) { | ||||||
|         // 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回 |         // 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回 | ||||||
| @@ -111,7 +121,7 @@ final public class MainActivity extends AppCompatActivity implements IWinBollAct | |||||||
| //            // 显示后退按钮 | //            // 显示后退按钮 | ||||||
| //            getSupportActionBar().setDisplayHomeAsUpEnabled(true); | //            getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||||||
| //        } | //        } | ||||||
|         getSupportActionBar().setSubtitle(getTag()); |         getSupportActionBar().setSubtitle(TAG); | ||||||
|  |  | ||||||
|         tabLayout = findViewById(R.id.tabLayout); |         tabLayout = findViewById(R.id.tabLayout); | ||||||
|         viewPager = findViewById(R.id.viewPager); |         viewPager = findViewById(R.id.viewPager); | ||||||
| @@ -339,7 +349,7 @@ final public class MainActivity extends AppCompatActivity implements IWinBollAct | |||||||
| // | // | ||||||
| //        if (intent.getAction().equals(StringToQrCodeView.ACTION_UNITTEST_QRCODE)) { | //        if (intent.getAction().equals(StringToQrCodeView.ACTION_UNITTEST_QRCODE)) { | ||||||
| //            try { | //            try { | ||||||
| //                WinBollActivity clazzActivity = UnitTestActivity.class.newInstance(); | //                WinBoLLActivity clazzActivity = UnitTestActivity.class.newInstance(); | ||||||
| //                String tag = clazzActivity.getTag(); | //                String tag = clazzActivity.getTag(); | ||||||
| //                LogUtils.d(TAG, "String tag = clazzActivity.getTag(); tag " + tag); | //                LogUtils.d(TAG, "String tag = clazzActivity.getTag(); tag " + tag); | ||||||
| //                Intent subIntent = new Intent(this, UnitTestActivity.class); | //                Intent subIntent = new Intent(this, UnitTestActivity.class); | ||||||
| @@ -357,8 +367,8 @@ final public class MainActivity extends AppCompatActivity implements IWinBollAct | |||||||
| //                } | //                } | ||||||
| // | // | ||||||
| //                Files.copy(Paths.get(szSrcPath), Paths.get(file.getPath())); | //                Files.copy(Paths.get(szSrcPath), Paths.get(file.getPath())); | ||||||
| //                //startWinBollActivity(subIntent, tag); | //                //startWinBoLLActivity(subIntent, tag); | ||||||
| //                WinBollActivityManager.getInstance(this).startWinBollActivity(this, subIntent, UnitTestActivity.class); | //                WinBoLLActivityManager.getInstance(this).startWinBoLLActivity(this, subIntent, UnitTestActivity.class); | ||||||
| //            } catch (IllegalAccessException | InstantiationException | IOException e) { | //            } catch (IllegalAccessException | InstantiationException | IOException e) { | ||||||
| //                LogUtils.d(TAG, e, Thread.currentThread().getStackTrace()); | //                LogUtils.d(TAG, e, Thread.currentThread().getStackTrace()); | ||||||
| //                // 函数处理异常返回失败 | //                // 函数处理异常返回失败 | ||||||
| @@ -371,10 +381,10 @@ final public class MainActivity extends AppCompatActivity implements IWinBollAct | |||||||
| //        return true; | //        return true; | ||||||
| //    } | //    } | ||||||
|  |  | ||||||
|     @Override | //    @Override | ||||||
|     public String getTag() { | //    public String getTag() { | ||||||
|         return TAG; | //        return TAG; | ||||||
|     } | //    } | ||||||
|  |  | ||||||
| //    @Override | //    @Override | ||||||
| //    public void onBackPressed() { | //    public void onBackPressed() { | ||||||
| @@ -386,7 +396,7 @@ final public class MainActivity extends AppCompatActivity implements IWinBollAct | |||||||
| // | // | ||||||
| //            @Override | //            @Override | ||||||
| //            public void onYes() { | //            public void onYes() { | ||||||
| //                WinBollActivityManager.getInstance(getApplicationContext()).finishAll(); | //                WinBoLLActivityManager.getInstance(getApplicationContext()).finishAll(); | ||||||
| //            } | //            } | ||||||
| // | // | ||||||
| //            @Override | //            @Override | ||||||
| @@ -408,7 +418,7 @@ final public class MainActivity extends AppCompatActivity implements IWinBollAct | |||||||
|         if (item.getItemId() == R.id.item_settings) { |         if (item.getItemId() == R.id.item_settings) { | ||||||
|             Intent intent = new Intent(this, SettingsActivity.class); |             Intent intent = new Intent(this, SettingsActivity.class); | ||||||
|             startActivity(intent); |             startActivity(intent); | ||||||
|             //WinBollActivityManager.getInstance(this).startWinBollActivity(this, CallActivity.class); |             //WinBoLLActivityManager.getInstance(this).startWinBoLLActivity(this, CallActivity.class); | ||||||
|         } |         } | ||||||
| //        } else  | //        } else  | ||||||
| //        if (item.getItemId() == R.id.item_exit) { | //        if (item.getItemId() == R.id.item_exit) { | ||||||
|   | |||||||
| @@ -10,14 +10,15 @@ import android.content.Context; | |||||||
| import android.os.Bundle; | import android.os.Bundle; | ||||||
| import android.view.ViewGroup; | import android.view.ViewGroup; | ||||||
| import android.widget.LinearLayout; | import android.widget.LinearLayout; | ||||||
|  | import androidx.appcompat.app.AppCompatActivity; | ||||||
| import androidx.appcompat.widget.Toolbar; | import androidx.appcompat.widget.Toolbar; | ||||||
| import cc.winboll.studio.contacts.R; | import cc.winboll.studio.contacts.R; | ||||||
| import cc.winboll.studio.libaes.winboll.APPInfo; | import cc.winboll.studio.libaes.winboll.APPInfo; | ||||||
| import cc.winboll.studio.libaes.winboll.AboutView; | import cc.winboll.studio.libaes.winboll.AboutView; | ||||||
| import cc.winboll.studio.libappbase.GlobalApplication; | import cc.winboll.studio.libappbase.GlobalApplication; | ||||||
| import cc.winboll.studio.libappbase.winboll.IWinBollActivity; | import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity; | ||||||
|  |  | ||||||
| public class AboutActivity extends WinBollActivity implements IWinBollActivity { | public class AboutActivity extends AppCompatActivity implements IWinBoLLActivity { | ||||||
|  |  | ||||||
|     public static final String TAG = "AboutActivity"; |     public static final String TAG = "AboutActivity"; | ||||||
|  |  | ||||||
| @@ -64,13 +65,13 @@ public class AboutActivity extends WinBollActivity implements IWinBollActivity { | |||||||
|         ); |         ); | ||||||
|         layout.addView(aboutView, params); |         layout.addView(aboutView, params); | ||||||
|  |  | ||||||
|         GlobalApplication.getWinBollActivityManager().add(this); |         GlobalApplication.getWinBoLLActivityManager().add(this); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     protected void onDestroy() { |     protected void onDestroy() { | ||||||
|         super.onDestroy(); |         super.onDestroy(); | ||||||
|         GlobalApplication.getWinBollActivityManager().registeRemove(this); |         GlobalApplication.getWinBoLLActivityManager().registeRemove(this); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public AboutView CreateAboutView() { |     public AboutView CreateAboutView() { | ||||||
|   | |||||||
| @@ -24,6 +24,7 @@ import androidx.appcompat.app.AppCompatActivity; | |||||||
| import androidx.appcompat.widget.Toolbar; | import androidx.appcompat.widget.Toolbar; | ||||||
| import androidx.recyclerview.widget.LinearLayoutManager; | import androidx.recyclerview.widget.LinearLayoutManager; | ||||||
| import androidx.recyclerview.widget.RecyclerView; | import androidx.recyclerview.widget.RecyclerView; | ||||||
|  | import cc.winboll.studio.contacts.App; | ||||||
| import cc.winboll.studio.contacts.R; | import cc.winboll.studio.contacts.R; | ||||||
| import cc.winboll.studio.contacts.adapters.PhoneConnectRuleAdapter; | import cc.winboll.studio.contacts.adapters.PhoneConnectRuleAdapter; | ||||||
| import cc.winboll.studio.contacts.beans.MainServiceBean; | import cc.winboll.studio.contacts.beans.MainServiceBean; | ||||||
| @@ -34,15 +35,13 @@ import cc.winboll.studio.contacts.bobulltoon.TomCat; | |||||||
| import cc.winboll.studio.contacts.dun.Rules; | import cc.winboll.studio.contacts.dun.Rules; | ||||||
| import cc.winboll.studio.contacts.services.MainService; | import cc.winboll.studio.contacts.services.MainService; | ||||||
| import cc.winboll.studio.contacts.views.DuInfoTextView; | import cc.winboll.studio.contacts.views.DuInfoTextView; | ||||||
| import cc.winboll.studio.libaes.winboll.APPInfo; |  | ||||||
| import cc.winboll.studio.libappbase.LogUtils; | import cc.winboll.studio.libappbase.LogUtils; | ||||||
| import cc.winboll.studio.libappbase.winboll.IWinBollActivity; | import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity; | ||||||
| import com.hjq.toast.ToastUtils; | import com.hjq.toast.ToastUtils; | ||||||
| import java.lang.reflect.Field; | import java.lang.reflect.Field; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| import cc.winboll.studio.contacts.App; |  | ||||||
|  |  | ||||||
| public class SettingsActivity extends AppCompatActivity implements IWinBollActivity { | public class SettingsActivity extends AppCompatActivity implements IWinBoLLActivity { | ||||||
|  |  | ||||||
|     public static final String TAG = "SettingsActivity"; |     public static final String TAG = "SettingsActivity"; | ||||||
|  |  | ||||||
| @@ -177,6 +176,8 @@ public class SettingsActivity extends AppCompatActivity implements IWinBollActiv | |||||||
|         etDunResumeSecondCount.setEnabled(!isEnableDun); |         etDunResumeSecondCount.setEnabled(!isEnableDun); | ||||||
|         etDunResumeCount.setEnabled(!isEnableDun); |         etDunResumeCount.setEnabled(!isEnableDun); | ||||||
|  |  | ||||||
|  |         EditText etBoBullToonURL = findViewById(R.id.bobulltoonurl_et); | ||||||
|  |         etBoBullToonURL.setText(Rules.getInstance(this).getBoBullToonURL()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public static void notifyDunInfoUpdate() { |     public static void notifyDunInfoUpdate() { | ||||||
| @@ -201,6 +202,11 @@ public class SettingsActivity extends AppCompatActivity implements IWinBollActiv | |||||||
|         settingsModel.setIsEnableDun(isEnableDun); |         settingsModel.setIsEnableDun(isEnableDun); | ||||||
|         Rules.getInstance(this).saveDun(); |         Rules.getInstance(this).saveDun(); | ||||||
|         Rules.getInstance(this).reload(); |         Rules.getInstance(this).reload(); | ||||||
|  |          | ||||||
|  |         // 重新加载盾牌参数 | ||||||
|  |         etDunTotalCount.setText(Integer.toString(settingsModel.getDunTotalCount())); | ||||||
|  |         etDunResumeSecondCount.setText(Integer.toString(settingsModel.getDunResumeSecondCount())); | ||||||
|  |         etDunResumeCount.setText(Integer.toString(settingsModel.getDunResumeCount())); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     void updateStreamVolumeTextView() { |     void updateStreamVolumeTextView() { | ||||||
| @@ -233,7 +239,18 @@ public class SettingsActivity extends AppCompatActivity implements IWinBollActiv | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public void onResetBoBullToonURL(View view) { | ||||||
|  |         Rules.getInstance(this).resetDefaultBoBullToonURL(); | ||||||
|  |         EditText etBoBullToonURL = findViewById(R.id.bobulltoonurl_et); | ||||||
|  |         etBoBullToonURL.setText(Rules.getInstance(this).getBoBullToonURL()); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     public void onDownloadBoBullToon(View view) { |     public void onDownloadBoBullToon(View view) { | ||||||
|  |         EditText etBoBullToonURL = findViewById(R.id.bobulltoonurl_et); | ||||||
|  |         if (!etBoBullToonURL.getText().toString().trim().equals(Rules.getInstance(this).getBoBullToonURL())) { | ||||||
|  |             Rules.getInstance(this).setBoBullToonURL(etBoBullToonURL.getText().toString().trim()); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         final TomCat tomCat = TomCat.getInstance(this); |         final TomCat tomCat = TomCat.getInstance(this); | ||||||
|         new Thread(new Runnable() { |         new Thread(new Runnable() { | ||||||
|                 @Override |                 @Override | ||||||
| @@ -247,8 +264,6 @@ public class SettingsActivity extends AppCompatActivity implements IWinBollActiv | |||||||
|             }).start(); |             }).start(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|     public void onSearchBoBullToonPhone(View view) { |     public void onSearchBoBullToonPhone(View view) { | ||||||
|         TomCat tomCat = TomCat.getInstance(this); |         TomCat tomCat = TomCat.getInstance(this); | ||||||
|         EditText etPhone = findViewById(R.id.activitysettingsEditText1); |         EditText etPhone = findViewById(R.id.activitysettingsEditText1); | ||||||
| @@ -311,8 +326,8 @@ public class SettingsActivity extends AppCompatActivity implements IWinBollActiv | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|      |  | ||||||
|     public void onAbout(View view) { |     public void onAbout(View view) { | ||||||
|         App.getWinBollActivityManager().startWinBollActivity(this, AboutActivity.class); |         App.getWinBoLLActivityManager().startWinBoLLActivity(this, AboutActivity.class); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -14,6 +14,7 @@ import cc.winboll.studio.contacts.utils.IntUtils; | |||||||
| public class SettingsModel extends BaseBean { | public class SettingsModel extends BaseBean { | ||||||
|  |  | ||||||
|     public static final String TAG = "SettingsModel"; |     public static final String TAG = "SettingsModel"; | ||||||
|  |      | ||||||
|     public static final int MAX_INTRANGE = 666666; |     public static final int MAX_INTRANGE = 666666; | ||||||
|     public static final int MIN_INTRANGE = 1; |     public static final int MIN_INTRANGE = 1; | ||||||
|      |      | ||||||
| @@ -27,6 +28,8 @@ public class SettingsModel extends BaseBean { | |||||||
|     int dunResumeCount; |     int dunResumeCount; | ||||||
|     // 是否启用云盾 |     // 是否启用云盾 | ||||||
|     boolean isEnableDun; |     boolean isEnableDun; | ||||||
|  |     // BoBullToon 应用模块数据请求地址 | ||||||
|  |     String szBoBullToon_URL; | ||||||
|  |  | ||||||
|     public SettingsModel() { |     public SettingsModel() { | ||||||
|         this.dunTotalCount = 6; |         this.dunTotalCount = 6; | ||||||
| @@ -34,14 +37,24 @@ public class SettingsModel extends BaseBean { | |||||||
|         this.dunResumeSecondCount = 60; |         this.dunResumeSecondCount = 60; | ||||||
|         this.dunResumeCount = 1; |         this.dunResumeCount = 1; | ||||||
|         this.isEnableDun = false; |         this.isEnableDun = false; | ||||||
|  |         this.szBoBullToon_URL = ""; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public SettingsModel(int dunTotalCount, int dunCurrentCount, int dunResumeSecondCount, int dunResumeCount, boolean isEnableDun) { |     public SettingsModel(int dunTotalCount, int dunCurrentCount, int dunResumeSecondCount, int dunResumeCount, boolean isEnableDun, String szBoBullToon_URL) { | ||||||
|         this.dunTotalCount = getSettingsModelRangeInt(dunTotalCount); |         this.dunTotalCount = getSettingsModelRangeInt(dunTotalCount); | ||||||
|         this.dunCurrentCount = getSettingsModelRangeInt(dunCurrentCount); |         this.dunCurrentCount = getSettingsModelRangeInt(dunCurrentCount); | ||||||
|         this.dunResumeSecondCount = getSettingsModelRangeInt(dunResumeSecondCount); |         this.dunResumeSecondCount = getSettingsModelRangeInt(dunResumeSecondCount); | ||||||
|         this.dunResumeCount = getSettingsModelRangeInt(dunResumeCount); |         this.dunResumeCount = getSettingsModelRangeInt(dunResumeCount); | ||||||
|         this.isEnableDun = isEnableDun; |         this.isEnableDun = isEnableDun; | ||||||
|  |         this.szBoBullToon_URL = szBoBullToon_URL; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setBoBullToon_URL(String boBullToon_URL) { | ||||||
|  |         this.szBoBullToon_URL = boBullToon_URL; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public String getBoBullToon_URL() { | ||||||
|  |         return szBoBullToon_URL; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public void setDunTotalCount(int dunTotalCount) { |     public void setDunTotalCount(int dunTotalCount) { | ||||||
| @@ -102,7 +115,8 @@ public class SettingsModel extends BaseBean { | |||||||
|         jsonWriter.name("dunResumeSecondCount").value(getDunResumeSecondCount()); |         jsonWriter.name("dunResumeSecondCount").value(getDunResumeSecondCount()); | ||||||
|         jsonWriter.name("dunResumeCount").value(getDunResumeCount()); |         jsonWriter.name("dunResumeCount").value(getDunResumeCount()); | ||||||
|         jsonWriter.name("isEnableDun").value(isEnableDun()); |         jsonWriter.name("isEnableDun").value(isEnableDun()); | ||||||
|  |         jsonWriter.name("szBoBullToon_URL").value(getBoBullToon_URL()); | ||||||
|  |          | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
| @@ -118,6 +132,8 @@ public class SettingsModel extends BaseBean { | |||||||
|                 setDunResumeCount(getSettingsModelRangeInt(jsonReader.nextInt())); |                 setDunResumeCount(getSettingsModelRangeInt(jsonReader.nextInt())); | ||||||
|             } else if (name.equals("isEnableDun")) { |             } else if (name.equals("isEnableDun")) { | ||||||
|                 setIsEnableDun(jsonReader.nextBoolean()); |                 setIsEnableDun(jsonReader.nextBoolean()); | ||||||
|  |             } else if (name.equals("szBoBullToon_URL")) { | ||||||
|  |                 setBoBullToon_URL(jsonReader.nextString()); | ||||||
|             } else { |             } else { | ||||||
|                 return false; |                 return false; | ||||||
|             } |             } | ||||||
|   | |||||||
| @@ -6,6 +6,8 @@ package cc.winboll.studio.contacts.bobulltoon; | |||||||
|  * @Describe 汤姆猫管家 :使用 BoBullToon 项目,对通讯地址进行筛选判断的好朋友。 |  * @Describe 汤姆猫管家 :使用 BoBullToon 项目,对通讯地址进行筛选判断的好朋友。 | ||||||
|  */ |  */ | ||||||
| import android.content.Context; | import android.content.Context; | ||||||
|  | import cc.winboll.studio.contacts.R; | ||||||
|  | import cc.winboll.studio.contacts.dun.Rules; | ||||||
| import cc.winboll.studio.libappbase.LogUtils; | import cc.winboll.studio.libappbase.LogUtils; | ||||||
| import com.hjq.toast.ToastUtils; | import com.hjq.toast.ToastUtils; | ||||||
| import java.io.File; | import java.io.File; | ||||||
| @@ -28,6 +30,7 @@ public class TomCat { | |||||||
|     public static final String TAG = "TomCat"; |     public static final String TAG = "TomCat"; | ||||||
|  |  | ||||||
|     List<String> listPhoneBoBullToon = new ArrayList<String>(); |     List<String> listPhoneBoBullToon = new ArrayList<String>(); | ||||||
|  |     String mszBoBullToon_URL; | ||||||
|  |  | ||||||
|     static volatile TomCat _TomCat; |     static volatile TomCat _TomCat; | ||||||
|     Context mContext; |     Context mContext; | ||||||
| @@ -41,8 +44,12 @@ public class TomCat { | |||||||
|         } |         } | ||||||
|         return _TomCat; |         return _TomCat; | ||||||
|     } |     } | ||||||
|  |      | ||||||
|  |     public String getDefaultBobulltoonUrl() { | ||||||
|  |         return mContext.getString(R.string.default_bobulltoon_url); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     void downloadAndExtractZip(String zipUrl, String destinationFolder) throws IOException { |     boolean downloadAndExtractZip(String zipUrl, String destinationFolder) throws IOException { | ||||||
|         OkHttpClient client = new OkHttpClient(); |         OkHttpClient client = new OkHttpClient(); | ||||||
|         Request request = new Request.Builder() |         Request request = new Request.Builder() | ||||||
|             .url(zipUrl) |             .url(zipUrl) | ||||||
| @@ -95,13 +102,16 @@ public class TomCat { | |||||||
|             // 删除临时 ZIP 文件 |             // 删除临时 ZIP 文件 | ||||||
|             tempZipFile.delete(); |             tempZipFile.delete(); | ||||||
|             LogUtils.d(TAG, "已更新 BoBullToon 数据"); |             LogUtils.d(TAG, "已更新 BoBullToon 数据"); | ||||||
|  |             return true; | ||||||
|         } catch (Exception e) { |         } catch (Exception e) { | ||||||
|  |             ToastUtils.show(e.getMessage()); | ||||||
|             LogUtils.d(TAG, e, Thread.currentThread().getStackTrace()); |             LogUtils.d(TAG, e, Thread.currentThread().getStackTrace()); | ||||||
|  |             return false; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public boolean downloadBoBullToon() { |     public boolean downloadBoBullToon() { | ||||||
|         String zipUrl = "http://10.8.0.12:3000/Studio/BoBullToon/archive/main.zip"; // 替换为实际的 ZIP 文件 URL |         String zipUrl = Rules.getInstance(mContext).getBoBullToonURL(); // 替换为实际的 ZIP 文件 URL | ||||||
|         String destinationFolder = getWorkingFolder().getPath(); // 替换为实际的目标文件夹路径 |         String destinationFolder = getWorkingFolder().getPath(); // 替换为实际的目标文件夹路径 | ||||||
|         try { |         try { | ||||||
|             // 删除旧文件 |             // 删除旧文件 | ||||||
| @@ -113,9 +123,11 @@ public class TomCat { | |||||||
|             } |             } | ||||||
|  |  | ||||||
|             // 更新新文件 |             // 更新新文件 | ||||||
|             downloadAndExtractZip(zipUrl, destinationFolder); |             if(downloadAndExtractZip(zipUrl, destinationFolder)) { | ||||||
|             LogUtils.d(TAG, "ZIP 文件下载并解压成功。"); |                 LogUtils.d(TAG, "ZIP 文件下载并解压成功。"); | ||||||
|             return true; |                 return true; | ||||||
|  |             } | ||||||
|  |             return false; | ||||||
|         } catch (IOException e) { |         } catch (IOException e) { | ||||||
|             LogUtils.d(TAG, e, Thread.currentThread().getStackTrace()); |             LogUtils.d(TAG, e, Thread.currentThread().getStackTrace()); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -18,6 +18,7 @@ import java.util.ArrayList; | |||||||
| import java.util.Timer; | import java.util.Timer; | ||||||
| import java.util.TimerTask; | import java.util.TimerTask; | ||||||
| import java.util.regex.Pattern; | import java.util.regex.Pattern; | ||||||
|  | import cc.winboll.studio.contacts.bobulltoon.TomCat; | ||||||
|  |  | ||||||
| public class Rules { | public class Rules { | ||||||
|  |  | ||||||
| @@ -84,6 +85,20 @@ public class Rules { | |||||||
|         PhoneConnectRuleModel.saveBeanList(mContext, _PhoneConnectRuleModelList, PhoneConnectRuleModel.class); |         PhoneConnectRuleModel.saveBeanList(mContext, _PhoneConnectRuleModelList, PhoneConnectRuleModel.class); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public void resetDefaultBoBullToonURL() { | ||||||
|  |         mSettingsModel.setBoBullToon_URL(TomCat.getInstance(mContext).getDefaultBobulltoonUrl()); | ||||||
|  |         saveDun(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setBoBullToonURL(String szUrl) { | ||||||
|  |         mSettingsModel.setBoBullToon_URL(szUrl); | ||||||
|  |         saveDun(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public String getBoBullToonURL() { | ||||||
|  |         return mSettingsModel.getBoBullToon_URL(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     public void loadDun() { |     public void loadDun() { | ||||||
|         mSettingsModel = SettingsModel.loadBean(mContext, SettingsModel.class); |         mSettingsModel = SettingsModel.loadBean(mContext, SettingsModel.class); | ||||||
|         if (mSettingsModel == null) { |         if (mSettingsModel == null) { | ||||||
| @@ -109,8 +124,12 @@ public class Rules { | |||||||
|         boolean isDefend = false; // 盾牌是否生效 |         boolean isDefend = false; // 盾牌是否生效 | ||||||
|         boolean isConnect = true; // 防御结果是否连接 |         boolean isConnect = true; // 防御结果是否连接 | ||||||
|  |  | ||||||
|  |         // 进行盾牌层数预计缩减计算 | ||||||
|  |         int nDunCurrentCount = mSettingsModel.getDunCurrentCount() - 1; | ||||||
|  |         LogUtils.d(TAG, String.format("nDunCurrentCount : %d", nDunCurrentCount)); | ||||||
|  |  | ||||||
|         // 如果盾值小于1,则解除防御 |         // 如果盾值小于1,则解除防御 | ||||||
|         if (!isDefend && mSettingsModel.getDunCurrentCount() < 1) { |         if (!isDefend && nDunCurrentCount < 1) { | ||||||
|             // 盾层为1以下,防御解除 |             // 盾层为1以下,防御解除 | ||||||
|             LogUtils.d(TAG, "盾层为1以下,防御解除"); |             LogUtils.d(TAG, "盾层为1以下,防御解除"); | ||||||
|             isDefend = true; |             isDefend = true; | ||||||
| @@ -174,17 +193,17 @@ public class Rules { | |||||||
|             // 就减少防御盾牌层数。 |             // 就减少防御盾牌层数。 | ||||||
|             // 每校验一次规则,云盾防御层数减1 |             // 每校验一次规则,云盾防御层数减1 | ||||||
|             // 当云盾防御层数为0时,再次进行以下程序段则恢复满值防御。 |             // 当云盾防御层数为0时,再次进行以下程序段则恢复满值防御。 | ||||||
|             int newDunCount = mSettingsModel.getDunCurrentCount() - 1; |             int newDunCount = nDunCurrentCount; | ||||||
|             LogUtils.d(TAG, String.format("新的防御层数预计为 %d", newDunCount)); |             LogUtils.d(TAG, String.format("新的防御层数预计为 %d", newDunCount)); | ||||||
|  |  | ||||||
|             // 保证盾值在[0,DunTotalCount]之内其他值一律重置为 DunTotalCount。 |             // 保证盾值在[1,DunTotalCount]之内其他值一律重置为 DunTotalCount。 | ||||||
|             if (newDunCount < 0 || newDunCount > mSettingsModel.getDunTotalCount()) { |             if (newDunCount > 0 && newDunCount < mSettingsModel.getDunTotalCount()) { | ||||||
|                 mSettingsModel.setDunCurrentCount(mSettingsModel.getDunTotalCount()); |  | ||||||
|                 LogUtils.d(TAG, String.format("盾值不在[0,%d]区间,恢复防御最大值%d", mSettingsModel.getDunTotalCount(), mSettingsModel.getDunTotalCount())); |  | ||||||
|             } else { |  | ||||||
|                 mSettingsModel.setDunCurrentCount(newDunCount); |                 mSettingsModel.setDunCurrentCount(newDunCount); | ||||||
|                 LogUtils.d(TAG, String.format("设置防御层数为 %d", newDunCount)); |                 LogUtils.d(TAG, String.format("设置防御层数为 %d", newDunCount)); | ||||||
|             } |             } else { | ||||||
|  |                 mSettingsModel.setDunCurrentCount(mSettingsModel.getDunTotalCount()); | ||||||
|  |                 LogUtils.d(TAG, String.format("盾值不在[0,%d]区间,恢复防御最大值%d", mSettingsModel.getDunTotalCount(), mSettingsModel.getDunTotalCount())); | ||||||
|  |             }  | ||||||
|  |  | ||||||
|             saveDun(); |             saveDun(); | ||||||
|             SettingsActivity.notifyDunInfoUpdate(); |             SettingsActivity.notifyDunInfoUpdate(); | ||||||
|   | |||||||
| @@ -31,7 +31,7 @@ import cc.winboll.studio.libappbase.LogUtils; | |||||||
| import cc.winboll.studio.libappbase.sos.SOS; | import cc.winboll.studio.libappbase.sos.SOS; | ||||||
| import java.util.Timer; | import java.util.Timer; | ||||||
| import java.util.TimerTask; | import java.util.TimerTask; | ||||||
| import cc.winboll.studio.libappbase.sos.WinBoll; | import cc.winboll.studio.libappbase.sos.WinBoLL; | ||||||
| import cc.winboll.studio.contacts.App; | import cc.winboll.studio.contacts.App; | ||||||
| import cc.winboll.studio.libappbase.sos.APPModel; | import cc.winboll.studio.libappbase.sos.APPModel; | ||||||
|  |  | ||||||
| @@ -129,11 +129,11 @@ public class MainService extends Service { | |||||||
|             isServiceRunning = true; |             isServiceRunning = true; | ||||||
|             // 唤醒守护进程 |             // 唤醒守护进程 | ||||||
|             wakeupAndBindAssistant(); |             wakeupAndBindAssistant(); | ||||||
|             // 召唤 WinBoll APP 绑定本服务 |             // 召唤 WinBoLL APP 绑定本服务 | ||||||
|             if (App.isDebuging()) { |             if (App.isDebuging()) { | ||||||
|                 WinBoll.bindToAPPBaseBeta(this, MainService.class.getName()); |                 WinBoLL.bindToAPPBaseBeta(this, MainService.class.getName()); | ||||||
|             } else { |             } else { | ||||||
|                 WinBoll.bindToAPPBase(this, MainService.class.getName()); |                 WinBoLL.bindToAPPBase(this, MainService.class.getName()); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             // 初始化服务运行参数 |             // 初始化服务运行参数 | ||||||
|   | |||||||
| @@ -195,16 +195,29 @@ | |||||||
| 				android:text="拨不通电话记录查询:"/> | 				android:text="拨不通电话记录查询:"/> | ||||||
|  |  | ||||||
| 			<LinearLayout | 			<LinearLayout | ||||||
| 				android:orientation="vertical" | 				android:orientation="horizontal" | ||||||
| 				android:layout_width="match_parent" | 				android:layout_width="match_parent" | ||||||
| 				android:layout_height="wrap_content" | 				android:layout_height="wrap_content" | ||||||
| 				android:gravity="right" | 				android:gravity="right" | ||||||
| 				android:layout_margin="10dp"> | 				android:layout_margin="10dp"> | ||||||
|  |  | ||||||
|  | 				<EditText | ||||||
|  | 					android:layout_width="0dp" | ||||||
|  | 					android:ems="10" | ||||||
|  | 					android:layout_height="wrap_content" | ||||||
|  | 					android:layout_weight="1.0" | ||||||
|  | 					android:id="@+id/bobulltoonurl_et"/> | ||||||
|  |  | ||||||
| 				<Button | 				<Button | ||||||
| 					android:layout_width="wrap_content" | 					android:layout_width="wrap_content" | ||||||
| 					android:layout_height="wrap_content" | 					android:layout_height="wrap_content" | ||||||
| 					android:text="下载 BoBullToon" | 					android:text="重置地址" | ||||||
|  | 					android:onClick="onResetBoBullToonURL"/> | ||||||
|  |  | ||||||
|  | 				<Button | ||||||
|  | 					android:layout_width="wrap_content" | ||||||
|  | 					android:layout_height="wrap_content" | ||||||
|  | 					android:text="下载数据" | ||||||
| 					android:onClick="onDownloadBoBullToon"/> | 					android:onClick="onDownloadBoBullToon"/> | ||||||
|  |  | ||||||
| 			</LinearLayout> | 			</LinearLayout> | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <resources> | <resources> | ||||||
|     <!-- WinBoll 默认方案 --> |     <!-- WinBoLL 默认方案 --> | ||||||
|     <color name="colorPrimary">#FF196ABC</color> |     <color name="colorPrimary">#FF196ABC</color> | ||||||
|     <color name="colorPrimaryDark">#FF002B57</color> |     <color name="colorPrimaryDark">#FF002B57</color> | ||||||
|     <color name="colorAccent">#FF80BFFF</color> |     <color name="colorAccent">#FF80BFFF</color> | ||||||
|   | |||||||
| @@ -2,5 +2,6 @@ | |||||||
| <resources> | <resources> | ||||||
|  |  | ||||||
|     <string name="app_name">Contacts</string> |     <string name="app_name">Contacts</string> | ||||||
|  |     <string name="default_bobulltoon_url">http://10.8.0.12:3000/Studio/BoBullToon/archive/main.zip</string> | ||||||
|  |  | ||||||
| </resources> | </resources> | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <resources> | <resources> | ||||||
|     <style name="MyAppTheme" parent="APPBaseTheme"> |     <style name="MyAppTheme" parent="AESTheme"> | ||||||
|         <item name="colorPrimary">@color/colorPrimary</item> |         <item name="colorPrimary">@color/colorPrimary</item> | ||||||
|         <item name="colorPrimaryDark">@color/colorPrimaryDark</item> |         <item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||||||
|         <item name="colorAccent">@color/colorAccent</item> |         <item name="colorAccent">@color/colorAccent</item> | ||||||
| @@ -8,7 +8,7 @@ | |||||||
|         <item name="android:windowContentOverlay">@null</item> |         <item name="android:windowContentOverlay">@null</item> | ||||||
|     </style> |     </style> | ||||||
|  |  | ||||||
|     <style name="GlobalCrashActivityTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar"> |     <style name="GlobalCrashActivityTheme" parent="AESTheme"> | ||||||
|         <item name="colorTittle">@color/colorAccent</item> |         <item name="colorTittle">@color/colorAccent</item> | ||||||
|         <item name="colorTittleBackgound">@color/colorPrimary</item> |         <item name="colorTittleBackgound">@color/colorPrimary</item> | ||||||
|         <item name="colorText">@color/colorAccent</item> |         <item name="colorText">@color/colorAccent</item> | ||||||
|   | |||||||
							
								
								
									
										9
									
								
								contacts/src/main/res/xml/network_security_config.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								contacts/src/main/res/xml/network_security_config.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <network-security-config> | ||||||
|  |     <domain-config cleartextTrafficPermitted="true"> | ||||||
|  |         <domain includeSubdomains="true">winboll.cc</domain> | ||||||
|  |     </domain-config> | ||||||
|  |     <domain-config cleartextTrafficPermitted="true"> | ||||||
|  |         <domain includeSubdomains="false">10.8.0.12</domain> | ||||||
|  |     </domain-config> | ||||||
|  | </network-security-config> | ||||||
		Reference in New Issue
	
	Block a user
	 ZhanGSKen
					ZhanGSKen