commit a6b5a0a9c425fcb1c40e3ef4321fe4c8dfe40624 Author: DESKTOP-G4KQC8P\xiangy Date: Tue Oct 31 16:19:36 2023 +0800 first commit diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml new file mode 100644 index 0000000..f03a4af --- /dev/null +++ b/.github/workflows/blank.yml @@ -0,0 +1,53 @@ +name: Android CI + +on: + push: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache Gradle + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-manager-${{ github.sha }} + restore-keys: | + gradle- + - name: Build with Gradle + run: | + echo 'org.gradle.caching=true' >> gradle.properties + echo 'org.gradle.parallel=true' >> gradle.properties + echo 'org.gradle.vfs.watch=true' >> gradle.properties + echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties + chmod 777 ./gradlew + ./gradlew assembleRelease + - uses: r0adkll/sign-android-release@v1 + name: Sign app APK + # ID used to access action output + id: sign_app + with: + releaseDirectory: app/build/outputs/apk/release + signingKeyBase64: ${{ secrets.SIGNING_KEY }} + alias: ${{ secrets.ALIAS }} + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + #env: + #// override default build-tools version (29.0.3) -- optional + #BUILD_TOOLS_VERSION: "30.0.2" + + # Example use of `signedReleaseFile` output -- not needed + - uses: actions/upload-artifact@v2 + with: + name: Signed app bundle + path: ${{steps.sign_app.outputs.signedReleaseFile}} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..8dc356c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +淘米水 \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..1bbd29e --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..ae388c2 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..a0fcdc3 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..e1eea1d --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8978d23 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f4dfed0 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# mi_water +a lsposed module for miui 一款基于lsposed的去除miui系统中各种不友好使用限制的模块 + +淘米水 +一款基于lsposed开发的针对miui系统的插件 +实现了去除系统自带广告,去除app安装限制等功能 + +基于GPLV2协议公开源码 diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..bc90e8d --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,52 @@ +plugins { + id 'com.android.application' + id 'kotlin-android' +} + +android { + defaultConfig { + applicationId "cn.coderstory.miui.water" + minSdkVersion 28 + targetSdkVersion 33 + versionCode 15 + versionName "1.7.6" + } + packagingOptions { + jniLibs { + excludes += ['META-INF/**'] + } + resources { + excludes += ['META-INF/**'] + } + } + + + buildTypes { + release { + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = '11' + } + buildFeatures { + viewBinding true + } + lint { + abortOnError false + } + namespace 'cn.coderstory.miui.water' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation 'androidx.preference:preference-ktx:1.2.0' + compileOnly 'de.robv.android.xposed:api:82' + implementation "com.github.topjohnwu.libsu:core:3.1.2" +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..bd21888 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,5 @@ +-keep class cn.coderstory.miui.water.MainHook + +-repackageclasses +-allowaccessmodification +-overloadaggressively \ No newline at end of file diff --git a/app/release/app-release.apk b/app/release/app-release.apk new file mode 100644 index 0000000..be38307 Binary files /dev/null and b/app/release/app-release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json new file mode 100644 index 0000000..348fa77 --- /dev/null +++ b/app/release/output-metadata.json @@ -0,0 +1,20 @@ +{ + "version": 3, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "cn.coderstory.miui.water", + "variantName": "release", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "attributes": [], + "versionCode": 15, + "versionName": "1.7.6", + "outputFile": "app-release.apk" + } + ], + "elementType": "File" +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ff56d3f --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/assets/xposed_init b/app/src/main/assets/xposed_init new file mode 100644 index 0000000..c8d5883 --- /dev/null +++ b/app/src/main/assets/xposed_init @@ -0,0 +1 @@ +cn.coderstory.miui.water.MainHook \ No newline at end of file diff --git a/app/src/main/java/cn/coderstory/miui/water/MainHook.kt b/app/src/main/java/cn/coderstory/miui/water/MainHook.kt new file mode 100644 index 0000000..85d1960 --- /dev/null +++ b/app/src/main/java/cn/coderstory/miui/water/MainHook.kt @@ -0,0 +1,192 @@ +package cn.coderstory.miui.water + +import android.content.pm.ApplicationInfo +import android.widget.TextView +import de.robv.android.xposed.* +import de.robv.android.xposed.callbacks.XC_LoadPackage +import java.net.URL + + +class MainHook : XposedHelper(), IXposedHookLoadPackage { + var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "conf") + + override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { + if (lpparam.packageName.equals("com.android.thememanager")) { + if (prefs.getBoolean("removeThemeAd", true)) { + hookAllMethods( + "com.android.thememanager.basemodule.ad.model.AdInfoResponse", + lpparam.classLoader, + "isAdValid", + XC_MethodReplacement.returnConstant(false) + ) + hookAllMethods( + "com.android.thememanager.basemodule.ad.model.AdInfoResponse", + lpparam.classLoader, + "checkAndGetAdInfo", + XC_MethodReplacement.returnConstant(null) + ) + } + } + + if (lpparam.packageName.equals("com.miui.packageinstaller")) { + if (prefs.getBoolean("removeInstallerAd", true)) { + XposedHelpers.findAndHookConstructor( + "com.miui.packageInstaller.model.CloudParams", + lpparam.classLoader, + object : XC_MethodHook() { + override fun afterHookedMethod(param: MethodHookParam) { + var obj = param.thisObject; + XposedHelpers.setBooleanField(obj, "showAdsBefore", false); + XposedHelpers.setBooleanField(obj, "showAdsAfter", false); + XposedHelpers.setBooleanField(obj, "singletonAuthShowAdsBefore", false); + XposedHelpers.setBooleanField(obj, "singletonAuthShowAdsAfter", true); + XposedHelpers.setBooleanField(obj, "useSystemAppRules", true); + XposedHelpers.setBooleanField(obj, "showSafeModeTip", false); + XposedHelpers.setBooleanField(obj, "openButton", true); + XposedHelpers.setObjectField(obj, "safeType", "1"); + } + }) + } + if (prefs.getBoolean("removeInstallerAuth", true)) { + findAndHookMethod( + "java.net.URL", + lpparam.classLoader, + "openConnection", + object : XC_MethodHook() { + override fun afterHookedMethod(param: MethodHookParam) { + var obj: URL = param.thisObject as URL + XposedBridge.log("current host is ${obj.host}") + if (obj.host.equals("api-installer.pt.xiaomi.com") || obj.host.equals("preview-api.installer.xiaomi.com")) { + XposedHelpers.setObjectField(obj, "host", "www.baidu.com"); + } + } + }) + } + + if (prefs.getBoolean("removeInstallerLimit", true)) { + findAndHookMethod( + "android.net.Uri", + lpparam.classLoader, + "parse", String::class.java, + object : XC_MethodHook() { + override fun beforeHookedMethod(param: MethodHookParam) { + if (param.args[0].toString().contains("com.miui.securitycenter")) { + param.args[0] = "ddddd" + } + } + }) + + // return (arg2.flags & 1) > 0 || arg2.uid < 10000; + findAndHookMethod( + "com.android.packageinstaller.e", + lpparam.classLoader, + "a", ApplicationInfo::class.java, + object : XC_MethodHook() { + override fun beforeHookedMethod(param: MethodHookParam) { + param.result = true + } + }) + + // 隐藏开启纯净模式提示 + // SafeModeTipViewObject safeModeTipViewObject = new SafeModeTipViewObject(h10, pureModeElderTipViewObject.f5884m, null, null, 12, null); + // safeModeTipViewObject.a(); a方法里的调用 + findAndHookMethod( + "com.miui.packageInstaller.ui.listcomponets.f0", + lpparam.classLoader, + "a", + object : XC_MethodHook() { + @Throws(Throwable::class) + override fun afterHookedMethod(param: MethodHookParam) { + super.afterHookedMethod(param) + XposedHelpers.setBooleanField(param.thisObject, "l", false); + } + }) + } + } + + if (lpparam.packageName.equals("com.android.mms")) { + if (prefs.getBoolean("removeMmsAd", true)) { + hookAllMethods( + "com.miui.smsextra.http.RequestResult", + lpparam.classLoader, + "data", + object : XC_MethodHook() { + override fun afterHookedMethod(param: MethodHookParam) { + var result = param.result + if (result.toString().contains("modules")) { + param.result = "{}"; + } + } + } + ) + hookAllMethods( + "com.miui.smsextra.ui.UnderstandButton", + lpparam.classLoader, + "requestAD", + XC_MethodReplacement.returnConstant(false) + ) + } + } + + if (lpparam.packageName.equals("com.miui.systemAdSolution")) { + if (prefs.getBoolean("removeSplashAd2", false)) { + + findAndHookMethod( + "com.xiaomi.ad.entity.cloudControl.cn.CNDeskFolderControlInfo", + lpparam.classLoader, + "isCloseAd", + XC_MethodReplacement.returnConstant(true) + ) + + findAndHookMethod( + "com.xiaomi.ad.common.pojo.AdType", + lpparam.classLoader, + "valueOf", + Int::class.java, + XC_MethodReplacement.returnConstant(0) + ) + } + } + + if (lpparam.packageName.equals("com.miui.securitycenter")) { + if (prefs.getBoolean("disableWaiting", true)) { + findAndHookMethod("android.widget.TextView", + lpparam.classLoader, + "setEnabled", + Boolean::class.java, + object : XC_MethodHook() { + override fun beforeHookedMethod(param: MethodHookParam) { + param.args[0] = true + } + }) + findAndHookMethod("android.widget.TextView", + lpparam.classLoader, + "setText", + CharSequence::class.java, + TextView.BufferType::class.java, + Boolean::class.java, + Int::class.java, + object : XC_MethodHook() { + override fun beforeHookedMethod(param: MethodHookParam) { + if (param.args.isNotEmpty() && param.args[0]?.toString() + ?.startsWith("确定(") == true + ) { + param.args[0] = "确定" + } + } + }) + } + } + + + // Global + if (findClassWithOutLog("com.xiaomi.ad.server.AdLauncher", lpparam.classLoader) != null) { + findAndHookMethod( + "com.xiaomi.ad.server.AdLauncher", + lpparam.classLoader, + "initCrashMonitor", + XC_MethodReplacement.returnConstant(false) + ) + } + } +} diff --git a/app/src/main/java/cn/coderstory/miui/water/SettingsActivity.kt b/app/src/main/java/cn/coderstory/miui/water/SettingsActivity.kt new file mode 100644 index 0000000..938d3f9 --- /dev/null +++ b/app/src/main/java/cn/coderstory/miui/water/SettingsActivity.kt @@ -0,0 +1,59 @@ +package cn.coderstory.miui.water + +import android.annotation.SuppressLint +import android.app.AlertDialog +import android.content.DialogInterface +import android.os.Bundle +import androidx.fragment.app.FragmentActivity +import androidx.preference.Preference +import androidx.preference.PreferenceFragmentCompat +import androidx.preference.SwitchPreference +import com.topjohnwu.superuser.Shell + +class SettingsActivity : FragmentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_settings) + checkEdXposed() + if (savedInstanceState == null) { + supportFragmentManager + .beginTransaction() + .replace(R.id.fragment_container, SettingsFragment()) + .commit() + } + } + + @SuppressLint("WorldReadableFiles") + private fun checkEdXposed() { + try { + getSharedPreferences("conf", MODE_WORLD_READABLE) + } catch (exception: SecurityException) { + AlertDialog.Builder(this) + .setMessage(getString(R.string.not_supported)) + .setPositiveButton(android.R.string.ok) { _: DialogInterface?, _: Int -> finish() } + .setNegativeButton(R.string.ignore, null) + .show() + } + } + + class SettingsFragment : PreferenceFragmentCompat() { + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + setPreferencesFromResource(R.xml.prefs, rootKey) + } + + override fun onPreferenceTreeClick(preference: Preference): Boolean { + if(preference.key == "removeSplashAd" ){ + if((preference as SwitchPreference).isChecked){ + Shell.su("rm -rf /storage/emulated/0/Android/data/com.miui.systemAdSolution/files/miad") + .exec() + Shell.su("touch /storage/emulated/0/Android/data/com.miui.systemAdSolution/files/miad") + .exec() + }else{ + Shell.su("rm -rf /storage/emulated/0/Android/data/com.miui.systemAdSolution/files/miad") + .exec() + } + } + return super.onPreferenceTreeClick(preference) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/cn/coderstory/miui/water/XposedHelper.kt b/app/src/main/java/cn/coderstory/miui/water/XposedHelper.kt new file mode 100644 index 0000000..00facfd --- /dev/null +++ b/app/src/main/java/cn/coderstory/miui/water/XposedHelper.kt @@ -0,0 +1,76 @@ +package cn.coderstory.miui.water + +import de.robv.android.xposed.XC_MethodHook +import de.robv.android.xposed.XposedBridge +import de.robv.android.xposed.XposedHelpers + +open class XposedHelper { + companion object { + fun findAndHookMethod( + p1: String?, + lpparam: ClassLoader?, + p2: String?, + vararg parameterTypesAndCallback: Any? + ) { + try { + if (findClass(p1, lpparam) != null) { + XposedHelpers.findAndHookMethod(p1, lpparam, p2, *parameterTypesAndCallback) + } + } catch (e: Throwable) { + XposedBridge.log(e) + } + } + + fun hookAllMethods( + p1: String?, + lpparam: ClassLoader?, + methodName: String?, + parameterTypesAndCallback: XC_MethodHook? + ) { + try { + val packageParser = findClass(p1, lpparam) + XposedBridge.hookAllMethods(packageParser, methodName, parameterTypesAndCallback) + } catch (e: Throwable) { + XposedBridge.log(e) + } + } + + private fun findClass(className: String?, classLoader: ClassLoader?): Class<*>? { + try { + return XposedHelpers.findClass(className,classLoader) + } catch (e: Throwable) { + XposedBridge.log(e) + } + return null + } + + fun hookAllConstructors(p1: String?, classLoader: ClassLoader?,parameterTypesAndCallback: XC_MethodHook) { + try { + val packageParser = findClass(p1, classLoader) + hookAllConstructors(packageParser, parameterTypesAndCallback) + } catch (e: Throwable) { + XposedBridge.log(e) + } + } + + private fun hookAllConstructors( + hookClass: Class<*>?, + callback: XC_MethodHook + ): Set? { + return try { + XposedBridge.hookAllConstructors(hookClass, callback) + } catch (e: Throwable) { + XposedBridge.log(e) + null + } + } + fun findClassWithOutLog(className: String?, classLoader: ClassLoader?): Class<*>? { + try { + return className?.let { Class.forName(it, false, classLoader) } + } catch (e: Exception) { + // 忽略 + } + return null + } + } +} \ No newline at end of file diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml new file mode 100644 index 0000000..1d249e3 --- /dev/null +++ b/app/src/main/res/layout/activity_settings.xml @@ -0,0 +1,5 @@ + + diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..8aedef5 --- /dev/null +++ b/app/src/main/res/values-night/styles.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml new file mode 100644 index 0000000..3ffad6d --- /dev/null +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -0,0 +1,22 @@ + + 淘米水 + MIUI广告救星 + 本插件兼容MIUI 13\n基于红米K40 MIUI 13.0.7版本适配\nPower By CoderStory + 安装包管理器 + 禁用账户验证 + 安装非商店应用时,不再需要输入MIUI账户密码. + 移除应用安装界面的广告和去除应用商店相关按钮. + 主题美化 + 清除主题美化App中的广告 + 安装限制 + 移除一些应用安装限制,比如系统app无法直接安装,被标记为危险的应用无法安装等 + 开屏广告 + 去除系统App上的开屏广告, 需root权限 + 去除5s/10s限制 + 去掉开启无障碍等功能必须等待10秒的危险提示 + 短信去广告 + 去掉短信下方输入框位置的广告按钮和短信内容下方的推广按钮 + 设置 + 忽略 + 您似乎正在使用过时的 LSPosed 版本或 LSPosed 未激活,请更新 LSPosed 或者激活后再试。 + diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml new file mode 100644 index 0000000..74c8c90 --- /dev/null +++ b/app/src/main/res/values/array.xml @@ -0,0 +1,12 @@ + + + + com.android.thememanager + com.miui.packageinstaller + com.miui.securitycenter + com.miui.analytics + com.android.traceur + com.miui.systemAdSolution + com.android.mms + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..501ec51 --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,24 @@ + + Mi Water + LSPosed Module For MIUI + This version is for miui 13 only. + MIUI Theme + Remove AD from Theme. + disable verify account + disable verify account when install app which not exist on the official store. + Package Installer + Remove AD from Package Installer. + install limit + remove some limits on install apk + remove splash AD + remove splash ad with miui app (need root permission) + remove limit for enable some futures in miui + Removed the restriction of having to wait 10 seconds before the function can be turned on + remove ad with mms + It seems ads will no longer appear with English language + 260345842 + https://blog.coderstory.cn + Settings + Ignore + It seems that you are using an out dated version of LSPosed or LSPosed is not activated, please update LSPosed or try again after activated. + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..960b125 --- /dev/null +++ b/app/src/main/res/values/styles.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/app/src/main/res/xml/prefs.xml b/app/src/main/res/xml/prefs.xml new file mode 100644 index 0000000..bcdcdd6 --- /dev/null +++ b/app/src/main/res/xml/prefs.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..2c6d1a6 --- /dev/null +++ b/build.gradle @@ -0,0 +1,25 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + ext.kotlin_version = '1.7.20' + repositories { + google() + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:8.1.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + maven { url "https://jcenter.bintray.com" } + maven { url 'https://jitpack.io' } + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..d4d1171 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,28 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1500m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app"s APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false +#systemProp.http.proxyHost=127.0.0.1 +#systemProp.http.proxyPort=8889 +#systemProp.https.proxyHost=127.0.0.1 +#systemProp.https.proxyPort=8889 +# diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..f6b961f Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..83dcbc0 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Jun 09 21:06:45 CST 2021 +distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/java_pid4324.hprof b/java_pid4324.hprof new file mode 100644 index 0000000..e53dcab Binary files /dev/null and b/java_pid4324.hprof differ diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..f91565c --- /dev/null +++ b/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name = "淘米水" +include ':app'