diff --git a/app/build.gradle b/app/build.gradle index 1a9340c..efe4f43 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -104,7 +104,7 @@ android { //签名 signingConfigs { tuixin { - storeFile file("src/keystore/tuixin.jks") + storeFile file("keystore/tuixin.jks") storePassword "123456" keyAlias "universal" keyPassword "123456" @@ -113,7 +113,7 @@ android { } xueshibao { - storeFile file("src/keystore/xueshibaoos.jks") + storeFile file("keystore/xueshibaoos.jks") storePassword "123456" keyAlias "xueshibaoos" keyPassword "123456" @@ -121,8 +121,26 @@ android { v2SigningEnabled true } + teclastMTK { + storeFile file("keystore/TeclastMTK.jks") + storePassword "123456" + keyAlias "TeclastMTK" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled true + } + + teclastUnisoc { + storeFile file("keystore/TeclastUnisoc.keystore") + storePassword "123456" + keyAlias "teclast" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled true + } + zhanRui { - storeFile file("src/keystore/zhanxun.keystore") + storeFile file("keystore/zhanxun.keystore") storePassword "123456" keyAlias "zhanxun" keyPassword "123456" @@ -131,7 +149,7 @@ android { } zhanRuiUserdebug { - storeFile file("src/keystore/zhanxunUserdebug.keystore") + storeFile file("keystore/zhanxunUserdebug.keystore") storePassword "123456" keyAlias "zhanxunUserdebug" keyPassword "123456" @@ -140,13 +158,49 @@ android { } own { - storeFile file("src/keystore/tt.jks") + storeFile file("keystore/tt.jks") storePassword "fht19961207" keyAlias "key0" keyPassword "981964879aa" v1SigningEnabled true v2SigningEnabled true } + + G10P{ + storeFile file("keystore/G10PMTK11.jks") + storePassword "123456" + keyAlias "G10PMTK11" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled true + } + + G10PUserDebug{ + storeFile file("keystore/G10PUserDebug.jks") + storePassword "123456" + keyAlias "G10PUserDebug" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled true + } + + Teclast8515{ + storeFile file("keystore/Teclast8515.keystore") + storePassword "123456" + keyAlias "Teclast8515" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled true + } + + P20S { + storeFile file("keystore/MTKP20S.keystore") + storePassword "123456" + keyAlias "MTKP20S" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled true + } } buildTypes { @@ -158,6 +212,84 @@ android { signingConfig signingConfigs.tuixin } + teclastUnisocdebug.initWith(zhanRuiDebug) + teclastUnisocdebug { + buildConfigField "String", "platform", '"ZhanRui"' + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.teclastUnisoc + } + + teclastUnisocrelease.initWith(zhanRuiDebug) + teclastUnisocrelease { + buildConfigField "String", "platform", '"ZhanRui"' + signingConfig signingConfigs.teclastUnisoc + } + + teclastMTKDebug.initWith(debug) + teclastMTKDebug { + buildConfigField "String", "platform", '"MTK"' + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.teclastMTK + } + + teclastMTKRelease.initWith(release) + teclastMTKRelease { + buildConfigField "String", "platform", '"MTK"' + signingConfig signingConfigs.teclastMTK + } + + G10PDebug.initWith(debug) + G10PDebug { + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.G10P + buildConfigField "String", "platform", '"MTK11"' + } + + G10PRelease.initWith(release) + G10PRelease { + signingConfig signingConfigs.G10P + buildConfigField "String", "platform", '"MTK11"' + } + + G10PUserDebug.initWith(debug) + G10PUserDebug { + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.G10PUserDebug + buildConfigField "String", "platform", '"MTK11"' + } + + Teclast8515Debug.initWith(debug) + Teclast8515Debug { + buildConfigField "String", "platform", '"8515"' + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.Teclast8515 + } + + Teclast8515Release.initWith(release) + Teclast8515Release { + buildConfigField "String", "platform", '"8515"' + signingConfig signingConfigs.Teclast8515 + } + + TeclastP20SDebug.initWith(debug) + TeclastP20SDebug { + buildConfigField "String", "platform", '"P20S"' + debuggable true + versionNameSuffix "-debug" + signingConfig signingConfigs.P20S + } + + TeclastP20SRelease.initWith(release) + TeclastP20SRelease { + buildConfigField "String", "platform", '"P20S"' + signingConfig signingConfigs.P20S + } + zhanRuiDebug.initWith(debug) zhanRuiDebug { versionNameSuffix "-debug" diff --git a/app/keystore/G10PMTK11.jks b/app/keystore/G10PMTK11.jks new file mode 100644 index 0000000..324fa31 Binary files /dev/null and b/app/keystore/G10PMTK11.jks differ diff --git a/app/keystore/G10PUserDebug.jks b/app/keystore/G10PUserDebug.jks new file mode 100644 index 0000000..eba0422 Binary files /dev/null and b/app/keystore/G10PUserDebug.jks differ diff --git a/app/keystore/MTKP20S.keystore b/app/keystore/MTKP20S.keystore new file mode 100644 index 0000000..1156f88 Binary files /dev/null and b/app/keystore/MTKP20S.keystore differ diff --git a/app/keystore/Teclast8515.keystore b/app/keystore/Teclast8515.keystore new file mode 100644 index 0000000..922a161 Binary files /dev/null and b/app/keystore/Teclast8515.keystore differ diff --git a/app/keystore/TeclastMTK.jks b/app/keystore/TeclastMTK.jks new file mode 100644 index 0000000..21975a2 Binary files /dev/null and b/app/keystore/TeclastMTK.jks differ diff --git a/app/keystore/TeclastUnisoc.keystore b/app/keystore/TeclastUnisoc.keystore new file mode 100644 index 0000000..2cf3127 Binary files /dev/null and b/app/keystore/TeclastUnisoc.keystore differ diff --git a/app/src/keystore/tt.jks b/app/keystore/tt.jks similarity index 100% rename from app/src/keystore/tt.jks rename to app/keystore/tt.jks diff --git a/app/src/keystore/tuixin.jks b/app/keystore/tuixin.jks similarity index 100% rename from app/src/keystore/tuixin.jks rename to app/keystore/tuixin.jks diff --git a/app/src/keystore/xueshibaoos.jks b/app/keystore/xueshibaoos.jks similarity index 100% rename from app/src/keystore/xueshibaoos.jks rename to app/keystore/xueshibaoos.jks diff --git a/app/src/keystore/zhanxun.keystore b/app/keystore/zhanxun.keystore similarity index 100% rename from app/src/keystore/zhanxun.keystore rename to app/keystore/zhanxun.keystore diff --git a/app/src/keystore/zhanxunUserdebug.keystore b/app/keystore/zhanxunUserdebug.keystore similarity index 100% rename from app/src/keystore/zhanxunUserdebug.keystore rename to app/keystore/zhanxunUserdebug.keystore diff --git a/app/src/main/java/com/tt/ttutils/activity/AoleyunTestActivity.java b/app/src/main/java/com/tt/ttutils/activity/AoleyunTestActivity.java index bdf1936..9e7c4c6 100644 --- a/app/src/main/java/com/tt/ttutils/activity/AoleyunTestActivity.java +++ b/app/src/main/java/com/tt/ttutils/activity/AoleyunTestActivity.java @@ -5,7 +5,6 @@ import android.content.Context; import android.content.Intent; import android.media.AudioManager; import android.net.Uri; -import android.os.Bundle; import android.provider.Settings; import android.util.Log; import android.view.KeyEvent; @@ -15,15 +14,12 @@ import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; -import androidx.appcompat.app.AppCompatActivity; - import com.tt.ttutils.BuildConfig; import com.tt.ttutils.R; import com.tt.ttutils.base.BaseActivity; import com.tt.ttutils.utils.java.JGYUtils; import com.tt.ttutils.utils.java.ToastUtil; -import java.lang.reflect.Method; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -155,6 +151,15 @@ public class AoleyunTestActivity extends BaseActivity { @BindView(R.id.bt_browser_off) Button bt_browser_off; + @BindView(R.id.bt_app_net) + Button bt_app_net; + @BindView(R.id.bt_app_statu) + Button bt_app_statu; + @BindView(R.id.bt_app_on) + Button bt_app_on; + @BindView(R.id.bt_app_off) + Button bt_app_off; + @Override public int getLayoutId() { return R.layout.activity_aoleyun_test; @@ -183,19 +188,41 @@ public class AoleyunTestActivity extends BaseActivity { } private void init() { + bt_usb_statu.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + ToastUtil.show("app_view_click_disabled"); + } + }); + bt_usb.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Settings.System.putString(getContentResolver(), "app_view_click_disabled", + "com.android.gallery3d:12345,78901;com.android.settings:9876543,12346"); + } + }); bt_usb_charge.setOnClickListener(view -> { -// Intent usbIntent = new Intent("aole_action_usb_usb_charge").setPackage("com.android.settings"); + Log.e(TAG, "bt_usb_charge: " + view.getId()); Intent usbIntent = new Intent("aole_action_usb_usb_charge"); + if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK8515Platform) { + usbIntent.setPackage("com.android.settings"); + } sendBroadcast(usbIntent); }); bt_usb_mtp.setOnClickListener(view -> { -// Intent usbIntent = new Intent("aole_action_usb_usb_mtp").setPackage("com.android.settings"); + Log.e(TAG, "bt_usb_charge: " + view.getId()); Intent usbIntent = new Intent("aole_action_usb_usb_mtp"); + if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK8515Platform) { + usbIntent.setPackage("com.android.settings"); + } sendBroadcast(usbIntent); }); bt_usb_midi.setOnClickListener(view -> { -// Intent usbIntent = new Intent("aole_action_usb_usb_midi").setPackage("com.android.settings"); + Log.e(TAG, "bt_usb_charge: " + view.getId()); Intent usbIntent = new Intent("aole_action_usb_usb_midi"); + if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK8515Platform) { + usbIntent.setPackage("com.android.settings"); + } sendBroadcast(usbIntent); }); @@ -216,8 +243,8 @@ public class AoleyunTestActivity extends BaseActivity { }); bt_desktop_aoleyun.setOnClickListener(view -> { Intent intent = new Intent("setDefaultLauncher"); - intent.putExtra("package", "com.uiui.os"); - intent.putExtra("className", "com.uiui.os.Launcher"); + intent.putExtra("package", "com.android.uiuios"); + intent.putExtra("className", "com.android.uiuios.Launcher"); intent.setPackage("com.android.settings"); sendBroadcast(intent); }); @@ -240,21 +267,32 @@ public class AoleyunTestActivity extends BaseActivity { bt_developer_on.setOnClickListener(view -> setDeveloperOptions(0)); bt_developer_off.setOnClickListener(view -> setDeveloperOptions(1)); + bt_navigation_statu.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS); + startActivity(intent); + } + }); bt_navigation_on.setOnClickListener(view -> { - Intent navIntent = new Intent("aole_show_NavigationBar").setPackage("com.android.systemui"); + Intent navIntent = new Intent("aole_show_NavigationBar"); +// Intent navIntent = new Intent("aole_show_NavigationBar").setPackage("com.android.systemui"); sendBroadcast(navIntent); }); bt_navigation_off.setOnClickListener(view -> { - Intent navIntent = new Intent("aole_hide_NavigationBar").setPackage("com.android.systemui"); + Intent navIntent = new Intent("aole_hide_NavigationBar"); +// Intent navIntent = new Intent("aole_hide_NavigationBar").setPackage("com.android.systemui"); sendBroadcast(navIntent); }); bt_status_on.setOnClickListener(view -> { - Intent navIntent = new Intent("aole_show_statusBar").setPackage("com.android.systemui"); + Intent navIntent = new Intent("aole_show_statusBar"); +// Intent navIntent = new Intent("aole_show_statusBar").setPackage("com.android.systemui"); sendBroadcast(navIntent); }); bt_status_off.setOnClickListener(view -> { - Intent navIntent = new Intent("aole_hide_statusBar").setPackage("com.android.systemui"); + Intent navIntent = new Intent("aole_hide_statusBar"); +// Intent navIntent = new Intent("aole_hide_statusBar").setPackage("com.android.systemui"); sendBroadcast(navIntent); }); @@ -305,14 +343,14 @@ public class AoleyunTestActivity extends BaseActivity { } }); bt_input_on.setOnClickListener(view -> { - Log.e(TAG, "init: "+getInputMethodId("com.baidu.input") ); + Log.e(TAG, "init: " + getInputMethodId("com.baidu.input")); Intent intent = new Intent("setDefaultInputMethod"); intent.putExtra("package", getInputMethodId("com.baidu.input")); intent.setPackage("com.android.settings"); sendBroadcast(intent); }); bt_input_off.setOnClickListener(view -> { - Log.e(TAG, "init: "+getInputMethodId("com.sohu.inputmethod.sogou") ); + Log.e(TAG, "init: " + getInputMethodId("com.sohu.inputmethod.sogou")); Intent intent = new Intent("setDefaultInputMethod"); intent.putExtra("package", getInputMethodId("com.sohu.inputmethod.sogou")); intent.setPackage("com.android.settings"); @@ -343,6 +381,31 @@ public class AoleyunTestActivity extends BaseActivity { intent.setPackage("com.android.settings"); sendBroadcast(intent); }); + + bt_app_net.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + + } + }); + bt_app_statu.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Log.e("aole_network_disallow", "onClick: " + Settings.System.getString(getContentResolver(), "aole_network_disallow")); + } + }); + bt_app_on.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Settings.System.putString(getContentResolver(), "aole_network_disallow", "com.quark.browser"); + } + }); + bt_app_off.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Settings.System.putString(getContentResolver(), "aole_network_disallow", ""); + } + }); } @Override diff --git a/app/src/main/java/com/tt/ttutils/activity/main/MainActivity.java b/app/src/main/java/com/tt/ttutils/activity/main/MainActivity.java index 080ed36..f8b24a1 100644 --- a/app/src/main/java/com/tt/ttutils/activity/main/MainActivity.java +++ b/app/src/main/java/com/tt/ttutils/activity/main/MainActivity.java @@ -114,7 +114,7 @@ public class MainActivity extends ImmerseBaseActivity { private IGetLicenseInterface getLicenseInterface; private ServiceConnection mIGetInfoConnection; private IGetInfoInterface getInfoInterface; - private String TAG = MainActivity.class.getSimpleName(); + private static final String TAG = MainActivity.class.getSimpleName(); private UsbManager mUsbManager; @@ -274,13 +274,13 @@ public class MainActivity extends ImmerseBaseActivity { public void onServiceDisconnected(ComponentName name) { Log.e(TAG, "onServiceDisconnected: mIGetInfoConnection"); getInfoInterface = null; - bindinfoService(); + bindInfoService(); } }; bindService(); bindLicenseService(); - bindinfoService(); + bindInfoService(); // Intent intent2 = new Intent(); // intent2.setComponent(new ComponentName("com.info.sn", "com.notepad.uiui.service.NoteService")); @@ -289,7 +289,6 @@ public class MainActivity extends ImmerseBaseActivity { // intent.setComponent(new ComponentName("com.notepad.uiui", "com.notepad.uiui.service.NoteService")); // startService(intent); - textView.setText(ndks); textView.setOnClickListener(new View.OnClickListener() { @Override @@ -341,10 +340,8 @@ public class MainActivity extends ImmerseBaseActivity { Log.e("mIGetInfoConnection", "getUserInfo: " + e.getMessage()); } } else { - bindinfoService(); + bindInfoService(); } - - // if (getLicenseInterface != null) { // try { // String license = getLicenseInterface.getLicense(); @@ -549,7 +546,7 @@ public class MainActivity extends ImmerseBaseActivity { } } - private void bindinfoService() { + private void bindInfoService() { if (getInfoInterface == null) { //这是连接aidl服务的代码 Intent intent = new Intent(); diff --git a/app/src/main/java/com/tt/ttutils/base/BaseLightActivity.java b/app/src/main/java/com/tt/ttutils/base/BaseLightActivity.java new file mode 100644 index 0000000..6fd06d1 --- /dev/null +++ b/app/src/main/java/com/tt/ttutils/base/BaseLightActivity.java @@ -0,0 +1,129 @@ +package com.tt.ttutils.base; + +import android.os.Bundle; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.ContentView; +import androidx.annotation.LayoutRes; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + +import com.trello.rxlifecycle4.LifecycleProvider; +import com.trello.rxlifecycle4.LifecycleTransformer; +import com.trello.rxlifecycle4.RxLifecycle; +import com.trello.rxlifecycle4.android.ActivityEvent; +import com.trello.rxlifecycle4.android.RxLifecycleAndroid; +import com.tt.ttutils.R; +import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX; + +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.subjects.BehaviorSubject; + + +public abstract class BaseLightActivity extends AppCompatActivity implements LifecycleProvider { + public final BehaviorSubject lifecycleSubject = BehaviorSubject.create(); + + public BaseLightActivity() { + super(); + } + + @ContentView + public BaseLightActivity(@LayoutRes int contentLayoutId) { + super(contentLayoutId); + } + + @Override + @NonNull + @CheckResult + public final Observable lifecycle() { + return lifecycleSubject.hide(); + } + + @Override + @NonNull + @CheckResult + public final LifecycleTransformer bindUntilEvent(@NonNull ActivityEvent event) { + return RxLifecycle.bindUntilEvent(lifecycleSubject, event); + } + + @Override + @NonNull + @CheckResult + public final LifecycleTransformer bindToLifecycle() { + return RxLifecycleAndroid.bindActivity(lifecycleSubject); + } + + @Override + @CallSuper + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + lifecycleSubject.onNext(ActivityEvent.CREATE); +// StatusBarUtil.init(this); + UltimateBarX.statusBar(this) + .transparent() + .colorRes(R.color.colorPrimaryDark) + .light(true) + .apply(); + UltimateBarX.navigationBar(this) + .transparent() + .colorRes(R.color.colorPrimaryDark) + .light(true) + .apply(); + setContentView(this.getLayoutId()); + initView(); + initData(); + } + + /** + * 设置布局 + */ + public abstract int getLayoutId(); + + /** + * 初始化视图 + */ + public abstract void initView(); + + + /** + * 初始化数据 + */ + public abstract void initData(); + + @Override + @CallSuper + protected void onStart() { + super.onStart(); + lifecycleSubject.onNext(ActivityEvent.START); + } + + @Override + @CallSuper + protected void onResume() { + super.onResume(); + lifecycleSubject.onNext(ActivityEvent.RESUME); + } + + @Override + @CallSuper + protected void onPause() { + lifecycleSubject.onNext(ActivityEvent.PAUSE); + super.onPause(); + } + + @Override + @CallSuper + protected void onStop() { + lifecycleSubject.onNext(ActivityEvent.STOP); + super.onStop(); + } + + @Override + @CallSuper + protected void onDestroy() { + lifecycleSubject.onNext(ActivityEvent.DESTROY); + super.onDestroy(); + } +} diff --git a/app/src/main/java/com/tt/ttutils/utils/java/JGYUtils.java b/app/src/main/java/com/tt/ttutils/utils/java/JGYUtils.java index 39b0834..8d4f1e3 100644 --- a/app/src/main/java/com/tt/ttutils/utils/java/JGYUtils.java +++ b/app/src/main/java/com/tt/ttutils/utils/java/JGYUtils.java @@ -24,18 +24,20 @@ public class JGYUtils { private CacheHelper cacheHelper; - public static int UnknowPlatform = 0; - public static int MTKPlatform = 1; - // TODO: 2022/4/23 标签替换未完成 - public static int CubePlatform = 2; - public static int ZhanruiPlatform = 3; + public static final int MTKPlatform = 1; + public static final int ZhanruiPlatform = 2; + public static final int M40sePlatform = 4; + public static final int T30ProPlatform = 5; + public static final int MTK8515Platform = 6; + public static final int G13Platform = 7; + public static final int UnknowPlatform = 0; - - public static String Other = "其他"; - public static String MTKTag = "MTK"; - // TODO: 2022/4/23 标签替换未完成 - public static String CubeTag = "展锐cube"; - public static String ZhanruiTag = "展锐"; + public static final String MTKTag = "MTK"; + public static final String ZhanruiTag = "展锐"; + public static final String M40SETag = "M40SE"; + public static final String T30PROTag = "T30PRO"; + public static final String MTK8515Tag = "8515"; + public static final String G13Tag = "G13"; private JGYUtils(Context context) { if (context == null) { @@ -80,9 +82,18 @@ public class JGYUtils { } else if ("ZhanRui".equalsIgnoreCase(platform)) { Log.i(TAG, "checkAppPlatform: " + "展锐平台"); return ZhanruiPlatform; - } else if ("ZhanRuiCube".equalsIgnoreCase(platform)) { - Log.i(TAG, "checkAppPlatform: " + "酷比平台"); - return CubePlatform; + } else if ("M40SE".equalsIgnoreCase(platform)) { + Log.i(TAG, "checkAppPlatform: " + "M40SE"); + return M40sePlatform; + } else if ("T30PRO".equalsIgnoreCase(platform)) { + Log.i(TAG, "checkAppPlatform: " + "T30PRO"); + return T30ProPlatform; + } else if (MTK8515Tag.equalsIgnoreCase(platform)) { + Log.i(TAG, "checkAppPlatform: " + "8515"); + return MTK8515Platform; + } else if (G13Tag.equalsIgnoreCase(platform)) { + Log.i(TAG, "checkAppPlatform: " + "G13"); + return G13Platform; } else { Log.i(TAG, "checkAppPlatform: " + "没有数据"); return UnknowPlatform; @@ -104,30 +115,23 @@ public class JGYUtils { public void getAppPlatform(GetAppPlatformCallback getAppPlatformCallback) { String platform = BuildConfig.platform; - if ("MTK".equalsIgnoreCase(platform)) { + if (MTKTag.equalsIgnoreCase(platform)) { getAppPlatformCallback.AppPlatform(MTKPlatform); } else if ("ZhanRui".equalsIgnoreCase(platform)) { getAppPlatformCallback.AppPlatform(ZhanruiPlatform); - } else if ("ZhanRuiCube".equalsIgnoreCase(platform)) { - getAppPlatformCallback.AppPlatform(CubePlatform); + } else if (M40SETag.equalsIgnoreCase(platform)) { + getAppPlatformCallback.AppPlatform(M40sePlatform); + } else if (T30PROTag.equalsIgnoreCase(platform)) { + getAppPlatformCallback.AppPlatform(T30ProPlatform); + } else if (MTK8515Tag.equalsIgnoreCase(platform)) { + getAppPlatformCallback.AppPlatform(MTK8515Platform); + } else if (G13Tag.equalsIgnoreCase(platform)) { + getAppPlatformCallback.AppPlatform(G13Platform); } else { getAppPlatformCallback.AppPlatform(UnknowPlatform); } } - public String getAppPlatform() { - String platform = BuildConfig.platform; - if ("MTK".equalsIgnoreCase(platform)) { - return MTKTag; - } else if ("ZhanRui".equalsIgnoreCase(platform)) { - return ZhanruiTag; - } else if ("ZhanRuiCube".equalsIgnoreCase(platform)) { - return CubeTag; - } else { - return Other; - } - } - /** * 从Manifest中获取meta-data值 * https://blog.csdn.net/yue_233/article/details/91453451 diff --git a/app/src/main/java/com/tt/ttutils/utils/java/dimens.java b/app/src/main/java/com/tt/ttutils/utils/java/dimens.java new file mode 100644 index 0000000..c7920fb --- /dev/null +++ b/app/src/main/java/com/tt/ttutils/utils/java/dimens.java @@ -0,0 +1,52 @@ +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +class dimens { + + public static void main(String[] args) { + File file = new File("."+File.separator + "dimens.xml"); + System.out.println(file.getAbsolutePath()); + if (!file.exists()) { + file.getParentFile().mkdirs(); + try { + file.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + } + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 1; i <= 500; i++) { + stringBuilder.append(""); + stringBuilder.append(i); + stringBuilder.append("dp"); + stringBuilder.append("\n"); + } + stringBuilder.append("\n"); + for (int i = 1; i <= 50; i++) { + stringBuilder.append(""); + stringBuilder.append(i); + stringBuilder.append("sp"); + stringBuilder.append("\n"); + } + try { + FileWriter fileWritter = new FileWriter(file); + fileWritter.write(stringBuilder.toString()); + fileWritter.close(); + // BufferedWriter out = new BufferedWriter(new FileWriter("runoob.txt")); + // out.write(stringBuilder.toString()); + // out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + System.out.println("创建文件成功"); + } + +} \ No newline at end of file diff --git a/app/src/main/res/layout/activity_aoleyun_test.xml b/app/src/main/res/layout/activity_aoleyun_test.xml index 56fe004..40883b4 100644 --- a/app/src/main/res/layout/activity_aoleyun_test.xml +++ b/app/src/main/res/layout/activity_aoleyun_test.xml @@ -509,6 +509,43 @@ android:text="Chrome" /> + + +