diff --git a/VirtualApp/app/build.gradle b/VirtualApp/app/build.gradle index 4ccf09401..7165ba445 100644 --- a/VirtualApp/app/build.gradle +++ b/VirtualApp/app/build.gradle @@ -28,8 +28,8 @@ android { applicationId "io.va.exposed" minSdkVersion 21 targetSdkVersion 23 - versionCode 130 - versionName "0.13.0" + versionCode 140 + versionName "0.14.0" multiDexEnabled false android { defaultConfig { diff --git a/VirtualApp/app/src/main/java/io/virtualapp/home/NewHomeActivity.java b/VirtualApp/app/src/main/java/io/virtualapp/home/NewHomeActivity.java index 54f94d754..129beb8bc 100644 --- a/VirtualApp/app/src/main/java/io/virtualapp/home/NewHomeActivity.java +++ b/VirtualApp/app/src/main/java/io/virtualapp/home/NewHomeActivity.java @@ -8,6 +8,7 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; +import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; @@ -20,10 +21,14 @@ import android.provider.Settings; import android.text.TextUtils; import android.util.Log; +import android.util.TypedValue; import android.view.KeyEvent; import android.view.View; import android.view.Window; import android.view.WindowManager; +import android.widget.CheckBox; +import android.widget.LinearLayout; +import android.widget.TextView; import android.widget.Toast; import com.android.launcher3.LauncherFiles; @@ -78,6 +83,7 @@ public void onCreate(Bundle savedInstanceState) { alertForMeizu(); alertForDoze(); mDirectlyBack = sharedPreferences.getBoolean(SettingsActivity.DIRECTLY_BACK_KEY, false); + alertForExp(); } private void installXposed() { @@ -251,6 +257,61 @@ private void alertForMeizu() { }, 2000); } + protected int dp2px(float dp) { + final float scale = getResources().getDisplayMetrics().density; + return (int) (dp * scale + 0.5f); + } + + private void alertForExp() { + final String shown = "_exp_has_alert"; + boolean aBoolean = PreferenceManager.getDefaultSharedPreferences(this).getBoolean(shown, false); + if (aBoolean) { + return; + } + + LinearLayout layout = new LinearLayout(this); + layout.setOrientation(LinearLayout.VERTICAL); + + int _20dp = dp2px(20); + layout.setPadding(_20dp, _20dp, _20dp, _20dp); + + TextView tv = new TextView(this); + tv.setTextColor(Color.BLACK); + tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); + tv.setText(R.string.exp_tips); + layout.addView(tv); + + CheckBox checkBox = new CheckBox(this); + checkBox.setText("不再提示"); + checkBox.setOnClickListener(v -> { + if (checkBox.isChecked()) { + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean(shown, true).apply(); + } + }); + + layout.addView(checkBox); + mUiHandler.postDelayed(() -> { + AlertDialog alertDialog = new AlertDialog.Builder(getContext()) + .setTitle("关于新项目EXP的说明") + .setView(layout) + .setPositiveButton("查看详情说明", (dialog, which) -> { + Intent t = new Intent(Intent.ACTION_VIEW); + t.setData(Uri.parse("https://vxposed.com/exp.html")); + startActivity(t); + }).setNegativeButton("支持我", (dialog, which) -> { + Intent t = new Intent(Intent.ACTION_VIEW); + t.setData(Uri.parse("https://vxposed.com/donate.html")); + startActivity(t); + }) + .create(); + try { + alertDialog.show(); + + } catch (Throwable ignored) { + } + }, 2000); + } + private void alertForDoze() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { return; diff --git a/VirtualApp/app/src/main/res/values/strings.xml b/VirtualApp/app/src/main/res/values/strings.xml index 2082d37fb..95f7b0f84 100644 --- a/VirtualApp/app/src/main/res/values/strings.xml +++ b/VirtualApp/app/src/main/res/values/strings.xml @@ -166,4 +166,10 @@ File Manager is supported by Amaze File Manager, download(about 3M) and install it now? Permission Manage Permission Manage is implemented by XPrivacyLua, download(about 1.7M) and install it now? + VirtualXposed 自去年诞生以来,已经经历了相当一段时间;在项目的演进过程中,逐渐发现它的一些不足。\n因此我产生了从另外换一种方式实现免ROOT Xposed功能的想法,我把它称之为 E-Xposed,简称EXP;简单来说,它有如下特性:\n\n + +1. 不再使用双开。\n +2. 直接运行原始APP。\n +3. 不易被检测。\n +