Skip to content

Commit

Permalink
Merge branch 'release/3.2.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
sollyu committed Jun 21, 2018
2 parents 236ef42 + b849d9e commit ef7885b
Show file tree
Hide file tree
Showing 19 changed files with 487 additions and 273 deletions.
40 changes: 11 additions & 29 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ static def getGitVersion() {
}

android {
compileSdkVersion 26
compileSdkVersion 27
flavorDimensions "default"

defaultConfig {
applicationId "com.sollyu.xposed.hook.model"
minSdkVersion 16
targetSdkVersion 26
versionCode 590
versionName "3.2.9." + getGitVersion()
targetSdkVersion 27
versionCode 591
versionName "3.2.10." + getGitVersion()
}
buildTypes {
release {
Expand Down Expand Up @@ -62,44 +62,26 @@ dependencies {
compileOnly fileTree(include: ['*.jar'], dir: 'libs')
implementation files('libs/umeng-analytics-7.4.0.jar')
implementation files('libs/umeng-common-1.4.0.jar')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
// https://github.com/Chainfire/libsuperuser
implementation 'eu.chainfire:libsuperuser:1.0.0.+'
// https://mvnrepository.com/artifact/org.apache.commons/commons-text
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'eu.chainfire:libsuperuser:1.0.0.201704021214'
implementation 'org.apache.commons:commons-text:1.1'
// https://github.com/apache/commons-io
implementation 'commons-io:commons-io:2.6'
// xUtils3简介 - https://github.com/wyouflf/xUtils3
implementation 'org.xutils:xutils:3.5.0'
// https://github.com/elvishew/xLog
implementation 'com.elvishew:xlog:1.3.0'
// FastJson https://github.com/alibaba/fastjson
implementation 'com.elvishew:xlog:1.4.0'
implementation 'com.alibaba:fastjson:1.1.56.android'
// https://github.com/square/okhttp
implementation 'com.squareup.okhttp:okhttp:2.7.5'
// https://github.com/kingsollyu/NotProguard
implementation 'com.github.kingsollyu:NotProguard:1.0.0'
// https://github.com/kingsollyu/OptionItem
implementation 'com.github.kingsollyu:OptionItem:1.2.2'
// https://github.com/Clans/FloatingActionButton
implementation 'com.github.clans:fab:1.6.4'
// https://github.com/PSDev/LicensesDialog
implementation 'de.psdev.licensesdialog:licensesdialog:1.8.3'
// https://github.com/greenrobot/EventBus
implementation 'org.greenrobot:eventbus:3.0.0'
// https://github.com/afollestad/material-dialogs
implementation 'org.greenrobot:eventbus:3.1.1'
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'
// https://github.com/Justson/AgentWeb
implementation 'com.just.agentweb:agentweb:3.0.0-rc'
// https://github.com/dlazaro66/QRCodeReaderView
implementation 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.3'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class ActivityAbout : ActivityBase() {

}

@Suppress("DEPRECATION")
override fun onInitData() {
super.onInitData()
textView.movementMethod = LinkMovementMethod.getInstance()
Expand Down
213 changes: 121 additions & 92 deletions app/src/main/java/com/sollyu/android/appenv/activitys/ActivityDetail.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,18 @@ class ActivityMain : ActivityBase(), NavigationView.OnNavigationItemSelectedList
return true
}
})

return true
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.menu_hook_user -> ActivityDetail.launch(activity, "hook.model.user")
R.id.menu_hook_all -> ActivityDetail.launch(activity, "hook.model.all")
}
return super.onOptionsItemSelected(item)
}

override fun onNavigationItemSelected(item: MenuItem): Boolean {
// Handle navigation view item clicks here.
when (item.itemId) {
Expand Down Expand Up @@ -218,6 +227,8 @@ class ActivityMain : ActivityBase(), NavigationView.OnNavigationItemSelectedList
recyclerViewAdapter.installAppList.addAll(unConfigAppInfoList)
recyclerViewAdapter.filter.filter(searchLastText)
}
else -> {
}
}
}

Expand Down Expand Up @@ -257,36 +268,37 @@ class ActivityMain : ActivityBase(), NavigationView.OnNavigationItemSelectedList
val displayAppList = LinkedList<ApplicationInfo>()
val installAppList = LinkedList<ApplicationInfo>()

override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): RecyclerViewHolder {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerViewHolder {
val view = LayoutInflater.from(activity).inflate(R.layout.item_listview, parent, false)
val typedValue = TypedValue()
activity.theme.resolveAttribute(R.attr.selectableItemBackground, typedValue, true)
view.setBackgroundResource(typedValue.resourceId)
return RecyclerViewHolder(view)
}

override fun onBindViewHolder(holder: RecyclerViewHolder?, position: Int) {
@Suppress("DEPRECATION")
override fun onBindViewHolder(holder: RecyclerViewHolder, position: Int) {
val applicationInfo = displayAppList[position]
val appLabel = applicationInfo.loadLabel(packageManager)
val appPackageName = applicationInfo.packageName

holder?.appInfo = applicationInfo
holder.appInfo = applicationInfo

val configJsonObject = SettingsXposed.Instance.get(applicationInfo.packageName)
if (configJsonObject != null && configJsonObject.isNotEmpty()) {
holder?.tvTitleName?.leftTextView ?.setTextAppearance(activity, R.style.AppTheme_XposedEnable_Left)
holder?.tvTitleName?.rightTextView?.setTextAppearance(activity, R.style.AppTheme_XposedEnable_Right)
holder.tvTitleName?.leftTextView ?.setTextAppearance(activity, R.style.AppTheme_XposedEnable_Left)
holder.tvTitleName?.rightTextView?.setTextAppearance(activity, R.style.AppTheme_XposedEnable_Right)
}else {
holder?.tvTitleName?.leftTextView ?.setTextAppearance(activity, R.style.AppTheme_XposedDisable_Left)
holder?.tvTitleName?.rightTextView?.setTextAppearance(activity, R.style.AppTheme_XposedDisable_Right)
holder.tvTitleName?.leftTextView ?.setTextAppearance(activity, R.style.AppTheme_XposedDisable_Left)
holder.tvTitleName?.rightTextView?.setTextAppearance(activity, R.style.AppTheme_XposedDisable_Right)
}

if (appLabel == appPackageName){}
holder?.tvTitleName?.setRightText(appPackageName)
holder.tvTitleName?.setRightText(appPackageName)

if (appLabel != appPackageName){
holder?.tvTitleName?.setLeftText(appLabel)
holder?.tvTitleName?.setRightText(appPackageName)
holder.tvTitleName?.setLeftText(appLabel)
holder.tvTitleName?.setRightText(appPackageName)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
*/

@file:Suppress("UNUSED_PARAMETER")

package com.sollyu.android.appenv.activitys

import android.app.Activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
*/

@file:Suppress("UNUSED_PARAMETER")

package com.sollyu.android.appenv.activitys

import android.app.Activity
Expand Down Expand Up @@ -219,7 +221,7 @@ class ActivitySettings : ActivityBase() {
.content(R.string.settings_use_data_local_tmp_content)
.positiveText(android.R.string.ok)
.negativeText(android.R.string.cancel)
.onPositive { dialog, which ->
.onPositive { _, _ ->
if (Shell.SU.available()) {
try {
Settings.Instance.isUseDataLocalTmpConfig = true
Expand All @@ -236,7 +238,7 @@ class ActivitySettings : ActivityBase() {
SettingsXposed.Save()
SettingsXposed.Reload()
}
.onNegative { dialog, which ->
.onNegative { _, _ ->
Settings.Instance.isUseDataLocalTmpConfig = false
oiwAppDataConfig.switch.isEnabled = !Settings.Instance.isUseDataLocalTmpConfig
oiwUseDataLocalTmp.setCheckedImmediatelyNoEvent(Settings.Instance.isUseDataLocalTmpConfig)
Expand Down Expand Up @@ -310,7 +312,7 @@ class ActivitySettings : ActivityBase() {
private fun onBtnClickThinks(view: View) {
MaterialDialog.Builder(activity)
.title(R.string.settings_thinks)
.items(arrayListOf("[email protected]"))
.items(arrayListOf("[email protected]", "AdroitAdorKhan(Github)", "tiann(Github)", "david082321(Github)"))
.positiveText(android.R.string.ok)
.show()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,12 @@
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 Down Expand Up @@ -57,7 +51,7 @@ class ActivitySplash : ActivityBase(), Runnable {
super.onInitDone()

permissionHelper.check(Manifest.permission.WRITE_EXTERNAL_STORAGE)
permissionHelper.onSuccess{
permissionHelper.onSuccess {
Handler().postAtTime(this, 1000)
}
permissionHelper.onDenied {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ActivityWeb : ActivityBase(), ChromeClientCallbackManager.ReceivedTitleCal
.content("确定下载:$configName$packageLabel ?")
.positiveText("确定")
.negativeText(android.R.string.cancel)
.onPositive { dialog, which ->
.onPositive { dialog, _ ->
val cookie = AgentWebConfig.getCookiesByUrl(AppEnvConstants.URL_APPENV_SERVER)
OkHttpClient().newCall(Request.Builder().url(AppEnvConstants.URL_APPENV_DOWNLOAD_PACKAGE + "?config_id=" + configId).header("Cookie", cookie).build()).enqueue(object : Callback {
override fun onFailure(request: Request, e: IOException) {
Expand Down
80 changes: 80 additions & 0 deletions app/src/main/java/com/sollyu/android/appenv/bean/BeanHookInfo.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Copyright © 2017 Sollyu <https://www.sollyu.com/>
*
* Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
*
* This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
*/
package com.sollyu.android.appenv.bean

import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.JSONObject
import com.alibaba.fastjson.annotation.JSONField

class BeanHookInfo {
@JSONField(name = "android.os.Build.ro.product.manufacturer")
var buildManufacturer:String? = null

@JSONField(name = "android.os.Build.ro.product.model")
var buildModel:String? = null

@JSONField(name = "android.os.Build.ro.serialno")
var buildSerial:String? = null

@JSONField(name = "android.os.Build.VERSION.RELEASE")
var buildVersionName:String? = null

@JSONField(name = "android.os.SystemProperties.android_id")
var androidId:String? = null

@JSONField(name = "android.telephony.TelephonyManager.getLine1Number")
var simLine1Number:String? = null

@JSONField(name = "android.telephony.TelephonyManager.getDeviceId")
var simGetDeviceId:String? = null

@JSONField(name = "android.telephony.TelephonyManager.getSubscriberId")
var simSubscriberId:String? = null

@JSONField(name = "android.telephony.TelephonyManager.getSimOperator")
var simOperator:String? = null

@JSONField(name = "android.telephony.TelephonyManager.getSimCountryIso")
var simCountryIso:String? = null

@JSONField(name = "android.telephony.TelephonyManager.getSimOperatorName")
var simOperatorName:String? = null

@JSONField(name = "android.telephony.TelephonyManager.getSimSerialNumber")
var simSerialNumber:String? = null

@JSONField(name = "android.telephony.TelephonyManager.getSimState")
var simStatus:String? = null

@JSONField(name = "android.net.NetworkInfo.getType")
var phoneNetworkType:String? = null

@JSONField(name = "android.net.wifi.WifiInfo.getSSID")
var wifiName:String? = null

@JSONField(name = "android.net.wifi.WifiInfo.getBSSID")
var wifiBssid:String? = null

@JSONField(name = "android.net.wifi.WifiInfo.getMacAddress")
var wifiMacAddress:String? = null

@JSONField(name = "android.content.res.language")
var language:String? = null

@JSONField(name = "android.content.res.display.dpi")
var displayDpi:String? = null

@JSONField(serialize = false)
override fun toString(): String {
return JSON.toJSONString(this)
}

fun toJSON():JSONObject{
return JSON.parseObject(toString())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ class XposedEntry : IXposedHookLoadPackage {
}

inner class UpdateConfiguration(private val loadPackageParam: XC_LoadPackage.LoadPackageParam, private val xposedPackageJson: JSONObject) : XC_MethodHook() {
@Suppress("DEPRECATION")
override fun beforeHookedMethod(methodHookParam: MethodHookParam) {
var configuration: Configuration? = null
if (methodHookParam.args[0] != null) {
Expand Down
Loading

0 comments on commit ef7885b

Please sign in to comment.