6.0.0 - 部分插件及工具版本更新

This commit is contained in:
SuperMonster003
2021-12-01 13:39:18 +08:00
parent 684938893a
commit 99a1d8490f
195 changed files with 5540 additions and 3909 deletions

View File

@@ -1,16 +1,14 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion versions.compile
buildToolsVersion versions.buildTool
defaultConfig {
applicationId "com.stardust.auojs.inrt"
minSdkVersion versions.mini
targetSdkVersion versions.target
versionCode versions.appVersionCode - 200
versionCode versions.appVersionCode
versionName versions.appVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
@@ -21,8 +19,8 @@ android {
disable 'ExtraTranslation'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_16
targetCompatibility JavaVersion.VERSION_16
}
splits {
@@ -39,7 +37,7 @@ android {
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include "x86", "armeabi-v7a"
include "armeabi-v7a"
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk false
@@ -87,7 +85,6 @@ task buildApkPlugin {
return
}
buildApkPluginForAbi(pluginProjectDir, 'armeabi-v7a')
buildApkPluginForAbi(pluginProjectDir, 'x86')
}
}
@@ -97,23 +94,24 @@ tasks.whenTaskAdded { task ->
}
}
repositories {
flatDir {
dirs 'libs'
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_16
}
}
repositories {
google()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1-alpha01', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//Glide
implementation('com.github.bumptech.glide:glide:4.2.0', {
exclude group: 'com.android.support'
})
testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.2'
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation project(":libs:org.mozilla.rhino-1.7.14")
implementation project(":libs:org.opencv-4.5.4")
implementation project(':automator')
implementation project(':common')
implementation project(':autojs')

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -30,18 +30,18 @@ class App : Application() {
Drawables.setDefaultImageLoader(object : ImageLoader {
override fun loadInto(imageView: ImageView, uri: Uri) {
Glide.with(this@App)
.load(uri)
.into(imageView)
.load(uri)
.into(imageView)
}
override fun loadIntoBackground(view: View, uri: Uri) {
Glide.with(this@App)
.load(uri)
.into(object : SimpleTarget<Drawable>() {
override fun onResourceReady(resource: Drawable, transition: Transition<in Drawable>) {
view.background = resource
}
})
.load(uri)
.into(object : SimpleTarget<Drawable>() {
override fun onResourceReady(resource: Drawable, transition: Transition<in Drawable>?) {
view.background = resource
}
})
}
override fun load(view: View, uri: Uri): Drawable {
@@ -50,23 +50,23 @@ class App : Application() {
override fun load(view: View, uri: Uri, drawableCallback: ImageLoader.DrawableCallback) {
Glide.with(this@App)
.load(uri)
.into(object : SimpleTarget<Drawable>() {
override fun onResourceReady(resource: Drawable, transition: Transition<in Drawable>) {
drawableCallback.onLoaded(resource)
}
})
.load(uri)
.into(object : SimpleTarget<Drawable>() {
override fun onResourceReady(resource: Drawable, transition: Transition<in Drawable>?) {
drawableCallback.onLoaded(resource)
}
})
}
override fun load(view: View, uri: Uri, bitmapCallback: ImageLoader.BitmapCallback) {
Glide.with(this@App)
.asBitmap()
.load(uri)
.into(object : SimpleTarget<Bitmap>() {
override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>) {
bitmapCallback.onLoaded(resource)
}
})
.asBitmap()
.load(uri)
.into(object : SimpleTarget<Bitmap>() {
override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
bitmapCallback.onLoaded(resource)
}
})
}
})
}

View File

@@ -1,7 +1,7 @@
package com.stardust.auojs.inrt
import android.content.SharedPreferences
import android.preference.PreferenceManager
import androidx.preference.PreferenceManager
import com.stardust.app.GlobalAppContext
@@ -14,13 +14,13 @@ object Pref {
private const val KEY_FIRST_USING = "key_first_using"
private var sPreferences: SharedPreferences? = null
val preferences: SharedPreferences
private val preferences: SharedPreferences
get() {
return sPreferences ?: {
return sPreferences ?: run {
val pref = PreferenceManager.getDefaultSharedPreferences(GlobalAppContext.get())
sPreferences = pref
pref
}()
}
}
val isFirstUsing: Boolean
@@ -37,11 +37,11 @@ object Pref {
}
fun shouldEnableAccessibilityServiceByRoot(): Boolean {
return preferences.getBoolean(getString(R.string.key_enable_accessibility_service_by_root), false)
return preferences.getBoolean(getString(R.string.key_enable_accessibility_service_by_root), true)
}
fun shouldHideLogs(): Boolean {
return preferences.getBoolean(getString(R.string.key_dont_show_main_activity), false)
return preferences.getBoolean(getString(R.string.key_not_show_main_activity), false)
}
fun shouldStopAllScriptsWhenVolumeUp(): Boolean {

View File

@@ -5,14 +5,11 @@ import androidx.annotation.Nullable
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
/**
* Created by Stardust on 2017/12/8.
*/
class SettingsActivity : AppCompatActivity() {
override fun onCreate(@Nullable savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setupViews()
@@ -28,11 +25,15 @@ class SettingsActivity : AppCompatActivity() {
supportActionBar?.setDisplayHomeAsUpEnabled(true)
}
class PreferenceFragment : android.preference.PreferenceFragment() {
class PreferenceFragment : androidx.preference.PreferenceFragment() {
override fun onCreate(@Nullable savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
addPreferencesFromResource(R.xml.preference)
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
TODO("Not yet implemented")
}
}
}

View File

@@ -53,7 +53,7 @@ class SplashActivity : AppCompatActivity() {
runOnUiThread {
Toast.makeText(this@SplashActivity, e.message, Toast.LENGTH_LONG).show()
startActivity(Intent(this@SplashActivity, LogActivity::class.java))
AutoJs.instance!!.globalConsole.printAllStackTrace(e)
AutoJs.instance.globalConsole.printAllStackTrace(e)
}
}
}.start()
@@ -64,13 +64,9 @@ class SplashActivity : AppCompatActivity() {
}
private fun checkPermission(vararg permissions: String) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val requestPermissions = getRequestPermissions(permissions)
if (requestPermissions.isNotEmpty()) {
requestPermissions(requestPermissions, PERMISSION_REQUEST_CODE)
} else {
runScript()
}
val requestPermissions = getRequestPermissions(permissions)
if (requestPermissions.isNotEmpty()) {
requestPermissions(requestPermissions, PERMISSION_REQUEST_CODE)
} else {
runScript()
}
@@ -91,7 +87,7 @@ class SplashActivity : AppCompatActivity() {
companion object {
private const val PERMISSION_REQUEST_CODE = 11186
private const val INIT_TIMEOUT: Long = 2500
private const val INIT_TIMEOUT: Long = 1000
}
}

View File

@@ -22,7 +22,7 @@ class GlobalKeyObserver internal constructor() : OnKeyListener, ShellKeyObserver
init {
AccessibilityService.stickOnKeyObserver
.addListener(this)
.addListener(this)
val observer = ShellKeyObserver()
observer.setKeyListener(this)
InputEventObserver.getGlobal(GlobalAppContext.get()).addListener(observer)
@@ -31,7 +31,7 @@ class GlobalKeyObserver internal constructor() : OnKeyListener, ShellKeyObserver
fun onVolumeUp() {
Log.d(LOG_TAG, "onVolumeUp at " + System.currentTimeMillis())
if (Pref.shouldStopAllScriptsWhenVolumeUp()) {
AutoJs.instance!!.scriptEngineService.stopAllAndToast()
AutoJs.instance.scriptEngineService.stopAllAndToast()
}
}
@@ -83,9 +83,7 @@ class GlobalKeyObserver internal constructor() : OnKeyListener, ShellKeyObserver
}
companion object {
private val LOG_TAG = "GlobalKeyObserver"
private const val LOG_TAG = "GlobalKeyObserver"
private val sSingleton = GlobalKeyObserver()
fun init() {

View File

@@ -5,19 +5,18 @@
<string name="text_enable_accessibility_service_by_root_timeout">使用root权限启用无障碍服务失败</string>
<string name="text_settings">设置</string>
<string name="text_script_running">脚本运行</string>
<string name="key_use_volume_control_running">key_use_volume_control_running</string>
<string name="key_enable_accessibility_service_by_root">key_enable_accessibility_service_by_root</string>
<string name="text_use_volume_to_stop_running">音量上键停止所有脚本</string>
<string name="summary_enable_accessibility_service_by_root">开启后运行脚本会使用Root权限自动开启无障碍服务</string>
<string name="text_enable_accessibility_service_by_root">使用Root权限自动启用服务</string>
<string name="summary_enable_accessibility_service_by_root">开启后运行脚本会使用 Root 权限自动开启无障碍服务</string>
<string name="text_enable_accessibility_service_by_root">使用 Root 权限自动启用服务</string>
<string name="key_stable_mode">key_stable_mode</string>
<string name="summary_stable_mode">开启后布局分析更稳定,但小部分脚本可能无法正常运行。重启无障碍服务生效</string>
<string name="text_stable_mode">稳定模式</string>
<string name="text_accessibility_service">无障碍服务</string>
<string name="text_dont_show_main_activity">不显示主界面</string>
<string name="key_dont_show_main_activity">key_dont_show_main_activity</string>
<string name="summary_dont_show_main_activity">打开应用后直接运行脚本</string>
<string name="text_not_show_main_activity">不显示主界面</string>
<string name="key_not_show_main_activity">key_not_show_main_activity</string>
<string name="summary_not_show_main_activity">打开应用后直接运行脚本</string>
<string name="text_others">其他</string>
<string name="powered_by_autojs">Powered by Auto.js</string>
<string name="text_execution_finished" formatted="false">\n------------\n[%s]运行结束,用时%f秒</string>

View File

@@ -11,9 +11,9 @@
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_dont_show_main_activity"
android:summary="@string/summary_dont_show_main_activity"
android:title="@string/text_dont_show_main_activity"/>
android:key="@string/key_not_show_main_activity"
android:summary="@string/summary_not_show_main_activity"
android:title="@string/text_not_show_main_activity"/>
</PreferenceCategory>