Skip to content

Commit

Permalink
Merge branch 'release/3.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
sollyu committed Dec 25, 2017
2 parents b4c8b61 + c50fa40 commit a369a10
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 15 deletions.
6 changes: 4 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ android {
applicationId "com.sollyu.xposed.hook.model"
minSdkVersion 15
targetSdkVersion 26
versionCode 584
versionName "3.2.3" + getGitVersion()
versionCode 585
versionName "3.2.4." + getGitVersion()
}
buildTypes {
release {
Expand Down Expand Up @@ -86,6 +86,8 @@ dependencies {
implementation 'com.afollestad.material-dialogs:core:0.9.5.0'
// https://github.com/rubensousa/BottomSheetBuilder
implementation 'com.github.rubensousa:bottomsheetbuilder:1.6.0'
// https://github.com/NoNews/NoPermission
implementation 'ru.alexbykov:nopermission:1.1.2'
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ class ActivitySettings : ActivityBase() {
notices.addNotice(Notice("EventBus" , "https://github.com/greenrobot/EventBus" , "Copyright (C) 2012-2017 Markus Junginger greenrobot (http://greenrobot.org)", ApacheSoftwareLicense20()))
notices.addNotice(Notice("LicensesDialog" , "https://github.com/PSDev/LicensesDialog" , "Copyright 2013-2017 Philip Schiffer" , ApacheSoftwareLicense20()))
notices.addNotice(Notice("libsuperuser" , "https://github.com/Chainfire/libsuperuser" , "Written by and copyright ©: Jorrit \"Chainfire\" Jongma Author of SuperSU" , ApacheSoftwareLicense20()))
notices.addNotice(Notice("NoPermission" , "https://github.com/NoNews/NoPermission" , "Copyright 2017 Mike Antipiev and Alex Bykov" , ApacheSoftwareLicense20()))
notices.addNotice(Notice("material-dialogs" , "https://github.com/afollestad/material-dialogs" , "Copyright (c) 2014-2016 Aidan Michael Follestad" , MITLicense()) )

LicensesDialog.Builder(activity).setNotices(notices).build().showAppCompat()
Expand Down Expand Up @@ -255,8 +256,8 @@ class ActivitySettings : ActivityBase() {
@Event(R.id.oivThinks)
private fun onBtnClickThinks(view: View) {
MaterialDialog.Builder(activity)
.title(R.string.settings_thinks).
items(arrayListOf("[email protected]"))
.title(R.string.settings_thinks)
.items(arrayListOf("[email protected]"))
.positiveText(android.R.string.ok)
.show()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@

package com.sollyu.android.appenv.activitys

import android.Manifest
import android.app.ProgressDialog.show
import android.content.pm.PackageManager
import android.os.Handler
import android.support.v4.app.ActivityCompat
import android.support.v4.content.ContextCompat
import android.widget.Toast
import com.afollestad.materialdialogs.MaterialDialog
import com.elvishew.xlog.XLog
import com.sollyu.android.appenv.BuildConfig
import com.sollyu.android.appenv.R
import com.sollyu.android.appenv.commons.Application
import com.umeng.analytics.MobclickAgent
import ru.alexbykov.nopermission.PermissionHelper


/**
Expand All @@ -23,6 +31,8 @@ import com.umeng.analytics.MobclickAgent
*/
class ActivitySplash : ActivityBase(), Runnable {

val permissionHelper by lazy { PermissionHelper(activity) }

override fun run() {

/* Xposed 没有成功的状态 */
Expand All @@ -44,7 +54,26 @@ class ActivitySplash : ActivityBase(), Runnable {
override fun onInitDone() {
super.onInitDone()

Handler().postAtTime(this, 1000)
permissionHelper.check(Manifest.permission.WRITE_EXTERNAL_STORAGE)
permissionHelper.onSuccess{
Handler().postAtTime(this, 1000)
}
permissionHelper.onDenied {
MaterialDialog.Builder(activity)
.title(R.string.tip)
.content(R.string.splash_permission_write_storage_denied_content)
.positiveText(android.R.string.ok).onPositive { _, _ -> Handler().postAtTime(this, 1000) }
.show()
}
permissionHelper.onNeverAskAgain {
Toast.makeText(activity, R.string.splash_permission_write_storage_denied_content, Toast.LENGTH_LONG).show()
}
permissionHelper.run()
}

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
permissionHelper.onRequestPermissionsResult(requestCode, permissions, grantResults)
}

override fun getMobclickAgentTag(): String {
Expand Down
11 changes: 4 additions & 7 deletions app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@
<string name="settings_issues">问题?建议?</string>
<string name="detail_run_app">请从桌面启动程序</string>
<string name="detail_run_app_back">桌面</string>
<string name="about_text">
<Data>
<![CDATA[
<string name="about_text">"\n <Data>\n <![CDATA[
"<h2>应用变量</h2>"
"作者: king.sollyu<br>"
"联系: QQ: 191067617<br>"
Expand Down Expand Up @@ -109,17 +107,15 @@
"<br>"
"<h2>本版更新</h2>"
"+ 使用Kotlin语言复写<br>"
"+ 增加启动时检测权限<br>"
"~ 增加版本号 (ง •̀_•́)ง <br>"
"<br>"
"<br>"
"<br>"
"<br>"
"<br>"
]]>
</Data>
</string>
]]>\n </Data>\n "</string>
<string name="title_activity_about">关于</string>
<string name="main_nav_header_desc">如需定制,可以联系作者</string>
<string name="settings_show_desktop_icon">显示桌面图标</string>
Expand All @@ -135,4 +131,5 @@
<string name="detail_display_dip">DPI</string>
<string name="settings_use_app_data_config">使用内置存储</string>
<string name="settings_use_app_data_config_content">【内置存储特性】\n支持「没有SD卡权限」应用拦截\n不支持「7.0+」以上系统\n\n【外置存储特性】\n不支持「没有SD卡权限」应用拦截\n方便直接修改配置文件\n兼容所有系统\n\n您确定使用内置存储吗?</string>
<string name="splash_permission_write_storage_denied_content">应用变量需要内存卡读取权限才能正常使用\n\n问:为什么要权限?\n答:因为在Android7.0+之后,Android系统为了手机系统的安全,删除了一个名字叫做【MODE_WORLD_READABLE】的权限,此权限是允许其他程序访问使用这个权限设置的文件,这也是应用变量提供被拦截程序的一个配置入口。因为系统删除了这个权限,外加上本人菜鸡,无奈只能使用SD来存放此配置文件,从而达到让别的程序来读取。\n\n问:如果我不给会怎么样?\n答:如果您的系统在Android7.0之前,那么您可以在设置中设置成使用内置存储,这样您就可以正常使用本软件了。那如果您的系统是Android7.0+,因为不能保存配置文件在内存卡里,所以我感觉您应该不能正常使用本软件。\n\n问:但是我真的很讨厌这个权限\n答:在这里我仅作为作者来告诉您,本软件【永久】不会增加任何性质的广告,也不会在您的手机内存卡里生成各种乱七八糟的文件。但是因为本软件使用来一个叫做【友盟】的统计,它好像会在您的SD卡下生成一个叫做【umeng】的文件夹。\n\n问:……\n答:…………\n</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,5 @@
<string name="detail_display_dip">DPI</string>
<string name="settings_use_app_data_config">Use app data Config</string>
<string name="settings_use_app_data_config_content">Use app data Config?</string>
<string name="splash_permission_write_storage_denied_content">AppEnv need write external storeage permission. :(</string>
</resources>
6 changes: 3 additions & 3 deletions online/app.env.soft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"last-version-code": 584,
"last-version-name": "3.2.3",
"last-version-message": "1. 增加语言和DPI拦截\n2. 支持Android 7.1+",
"last-version-code": 585,
"last-version-name": "3.2.4",
"last-version-message": "+ 增加启动时检测权限\n~ 增加版本号 (ง •̀_•́)ง ",
"last-version-url": "https://github.com/kingsollyu/AppEnv-Kotlin/releases"
}

1 comment on commit a369a10

@lwl12
Copy link

@lwl12 lwl12 commented on a369a10 Dec 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加版本号 xswl

Please sign in to comment.