Skip to content

Commit 2d86d73

Browse files
committed
feat: add network_security_config.xml and upgrade some dependencies
1 parent 2f57697 commit 2d86d73

File tree

9 files changed

+121
-59
lines changed

9 files changed

+121
-59
lines changed

README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,35 @@ Exit value 0
2323
```
2424

2525
### Tested devices :heavy_check_mark:
26-
| Device | Model | Chipset | Result |
27-
|-----------------|:-------:|:----------------:|:-------:|
28-
| Lg X Power2 | M320N | MediaTek MT6750 | Success |
29-
| Lg K10 | M250DS | MediaTek MT6750 | Success |
30-
| Lg K10 Power | M320TV | MediaTek MT6750 | Success |
31-
| Lg K10 TV | K430DSF | MediaTek MT6753 | Success |
32-
| Lg K8 | K350 | Mediatek MT6735 | Fail |
33-
| Lg K4 | X230DS | MediaTek MT6737M | Success |
34-
| Motorola Moto C | XT1756 | Mediatek MT6737M | Success |
35-
| Motorola Moto E4| XT1773 | Mediatek MT6737 | Success |
36-
| Alcatel A3 LX | 9008X | Mediatek MT8735B | Success |
37-
| Alcatel 1 | 5033T | Mediatek MT6739 | Success |
38-
| Alcatel U5 3G | 4047A | Mediatek MT6580M | Fail |
39-
| Blu Studio X8 HD| S532 | Mediatek MT6580 | Fail |
40-
| Nook Tablet 10.1|BNTV650|Mediatek A35-MT8167A| Success |
41-
|ZTE Blade A7 Prime| OEM |Mediatek A22-MT6761| Success |
42-
| Oppo F7 | CPH1821 | Mediatek MT6771 | Fail |
43-
| Oppo F3 | CPH1609 | Mediatek MT6750T | Fail |
44-
|Lenovo Vibe K5 Note|A7020a48|Mediatek MT6755 | Fail |
45-
|Lenovo Tab E8 |TB-8304F1|Mediatek MT8163 | Success |
46-
| Vernee Mix 2 | Mix 2 | Mediatek MT6757CD| Success |
47-
| Nokia 1 | TA-1130 | Mediatek MT6739WW| Fail |
48-
| Sony Xperia C5 Ultra | E5553 | Mediatek MT6752 | Success |
49-
| Redmi 6 | Cerus | Mediatek MT6762 | Success |
50-
| Ark Elf S8 | Elf S8 | MediaTek MT6580 | Success |
51-
| Sony Xperia L3 | I4312 | MediaTek MT6762 | Success |
52-
| GIONEE S10 | GIONEE_SW17G04 | MediaTek MT6767 | Success |
53-
| GIONEE M7 | GIONEE_SW17G07 | MediaTek MT6758 | Success |
54-
| Southern Telecom PB1009 | PB1009 | MediaTek MT8167B | Success |
26+
| Device | Model | Chipset | Result |
27+
|-------------------------|:--------------:|:--------------------:|:-------:|
28+
| Lg X Power2 | M320N | MediaTek MT6750 | Success |
29+
| Lg K10 | M250DS | MediaTek MT6750 | Success |
30+
| Lg K10 Power | M320TV | MediaTek MT6750 | Success |
31+
| Lg K10 TV | K430DSF | MediaTek MT6753 | Success |
32+
| Lg K8 | K350 | Mediatek MT6735 | Fail |
33+
| Lg K4 | X230DS | MediaTek MT6737M | Success |
34+
| Motorola Moto C | XT1756 | Mediatek MT6737M | Success |
35+
| Motorola Moto E4 | XT1773 | Mediatek MT6737 | Success |
36+
| Alcatel A3 LX | 9008X | Mediatek MT8735B | Success |
37+
| Alcatel 1 | 5033T | Mediatek MT6739 | Success |
38+
| Alcatel U5 3G | 4047A | Mediatek MT6580M | Fail |
39+
| Blu Studio X8 HD | S532 | Mediatek MT6580 | Fail |
40+
| Nook Tablet 10.1 | BNTV650 | Mediatek A35-MT8167A | Success |
41+
| ZTE Blade A7 Prime | OEM | Mediatek A22-MT6761 | Success |
42+
| Oppo F7 | CPH1821 | Mediatek MT6771 | Fail |
43+
| Oppo F3 | CPH1609 | Mediatek MT6750T | Fail |
44+
| Lenovo Vibe K5 Note | A7020a48 | Mediatek MT6755 | Fail |
45+
| Lenovo Tab E8 | TB-8304F1 | Mediatek MT8163 | Success |
46+
| Vernee Mix 2 | Mix 2 | Mediatek MT6757CD | Success |
47+
| Nokia 1 | TA-1130 | Mediatek MT6739WW | Fail |
48+
| Sony Xperia C5 Ultra | E5553 | Mediatek MT6752 | Success |
49+
| Redmi 6 | Cerus | Mediatek MT6762 | Success |
50+
| Ark Elf S8 | Elf S8 | MediaTek MT6580 | Success |
51+
| Sony Xperia L3 | I4312 | MediaTek MT6762 | Success |
52+
| GIONEE S10 | GIONEE_SW17G04 | MediaTek MT6767 | Success |
53+
| GIONEE M7 | GIONEE_SW17G07 | MediaTek MT6758 | Success |
54+
| Southern Telecom PB1009 | PB1009 | MediaTek MT8167B | Success |
5555

5656
### Acknowledgments :handshake:
5757
- This app was based on [this](https://forum.xda-developers.com/android/development/amazing-temp-root-mediatek-armv8-t3922213/post82081703#post82081703) tutorial.

app/build.gradle

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ file("${rootDir}/env.properties").withInputStream { env.load(it) }
1111

1212
android {
1313

14-
applicationVariants.all { variant ->
15-
variant.outputs.all {
14+
applicationVariants.configureEach { variant ->
15+
variant.outputs.configureEach {
1616
outputFileName = "mtk-easy-su-v${defaultConfig.versionName}.apk"
1717
}
1818
}
@@ -38,15 +38,15 @@ android {
3838
defaultConfig {
3939
applicationId 'juniojsv.mtk.easy.su'
4040
minSdkVersion 21
41-
compileSdkVersion 32
42-
targetSdkVersion 32
43-
versionCode 208
44-
versionName "2.1.1"
41+
compileSdk 33
42+
versionCode 209
43+
versionName "2.2.0"
4544
}
4645

4746
buildTypes {
48-
all {
49-
buildConfigField "String", "ADMOB_TEST_DEVICE", "\"$adbmob_test_device\""
47+
configureEach {
48+
buildConfigField "String", "ADMOB_TEST_DEVICE", "\"${env['admob.test.device']}\""
49+
buildConfigField "String", "APPLOVIN_SDK_KEY", "\"${env['applovin.sdk.key']}\""
5050
}
5151
release {
5252
minifyEnabled true
@@ -56,21 +56,20 @@ android {
5656
}
5757
}
5858

59-
6059
buildFeatures {
6160
viewBinding true
6261
}
63-
64-
buildToolsVersion = '29.0.3'
62+
namespace 'juniojsv.mtk.easy.su'
6563
}
6664

6765
dependencies {
6866
implementation fileTree(dir: 'libs', include: ['*.jar'])
69-
//noinspection GradleDependency
7067
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7168
implementation 'androidx.core:core-ktx:1.7.0'
7269
implementation 'com.google.android.material:material:1.5.0'
73-
implementation 'com.google.android.gms:play-services-ads:20.6.0'
70+
implementation 'com.google.android.gms:play-services-ads:22.5.0'
71+
implementation 'com.google.ads.mediation:facebook:6.16.0.0'
72+
implementation 'com.google.ads.mediation:applovin:11.11.3.0'
7473
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'
7574
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
7675
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="juniojsv.mtk.easy.su">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<uses-permission android:name="android.permission.INTERNET" />
65
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@@ -12,7 +11,8 @@
1211
android:roundIcon="@mipmap/ic_launcher_round"
1312
android:supportsRtl="true"
1413
android:theme="@style/AppTheme"
15-
android:fullBackupContent="@xml/backup_descriptor">
14+
android:fullBackupContent="@xml/backup_descriptor"
15+
android:networkSecurityConfig="@xml/network_security_config">
1616

1717
<meta-data
1818
android:name="com.google.android.gms.ads.APPLICATION_ID"

app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
package juniojsv.mtk.easy.su
22

3-
import android.content.*
3+
import android.content.ClipData
4+
import android.content.ClipboardManager
5+
import android.content.Context
6+
import android.content.Intent
7+
import android.content.SharedPreferences
48
import android.net.Uri
59
import android.os.Build
610
import android.os.Bundle
711
import android.util.Log
812
import androidx.appcompat.app.AlertDialog
913
import androidx.appcompat.app.AppCompatActivity
1014
import androidx.core.content.edit
15+
import com.applovin.sdk.AppLovinPrivacySettings
16+
import com.applovin.sdk.AppLovinSdk
17+
import com.applovin.sdk.AppLovinSdkSettings
18+
import com.google.android.gms.ads.AdRequest
1119
import com.google.android.gms.ads.FullScreenContentCallback
1220
import com.google.android.gms.ads.LoadAdError
1321
import com.google.android.gms.ads.MobileAds
@@ -23,19 +31,22 @@ import kotlinx.coroutines.withContext
2331
import retrofit2.Retrofit
2432
import retrofit2.await
2533
import retrofit2.converter.gson.GsonConverterFactory
34+
import java.util.Timer
35+
import java.util.TimerTask
2636
import kotlin.coroutines.CoroutineContext
2737

2838
class MainActivity : AppCompatActivity(), CoroutineScope {
2939
private lateinit var preferences: SharedPreferences
3040
private lateinit var github: GithubRepository
41+
private lateinit var binding: ActivityMainBinding
3142
private var advertising: InterstitialAd? = null
3243
override val coroutineContext: CoroutineContext
3344
get() = Dispatchers.IO
3445

3546
override fun onCreate(savedInstanceState: Bundle?) {
3647
super.onCreate(savedInstanceState)
3748

38-
val binding = ActivityMainBinding.inflate(layoutInflater)
49+
binding = ActivityMainBinding.inflate(layoutInflater)
3950
setContentView(binding.root)
4051

4152
preferences = getSharedPreferences(BuildConfig.APPLICATION_ID, Context.MODE_PRIVATE)
@@ -65,8 +76,21 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
6576
}
6677

6778
try {
79+
if (BuildConfig.APPLOVIN_SDK_KEY.isNotBlank()) {
80+
AppLovinPrivacySettings.setHasUserConsent(true, this)
81+
AppLovinSdk.getInstance(
82+
BuildConfig.APPLOVIN_SDK_KEY,
83+
AppLovinSdkSettings(this).also { settings ->
84+
if (BuildConfig.DEBUG) {
85+
settings.setVerboseLogging(true)
86+
}
87+
},
88+
this
89+
).initializeSdk()
90+
}
6891
MobileAds.initialize(this) {
69-
if (BuildConfig.DEBUG) {
92+
onSetupBannerAd()
93+
if (BuildConfig.DEBUG && BuildConfig.ADMOB_TEST_DEVICE.isNotBlank()) {
7094
MobileAds.setRequestConfiguration(
7195
RequestConfiguration.Builder().setTestDeviceIds(
7296
mutableListOf(BuildConfig.ADMOB_TEST_DEVICE)
@@ -143,7 +167,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
143167
binding.mButtonTryRoot.setOnClickListener { button ->
144168
getString(R.string.please_wait).toast(this, true)
145169
button.isEnabled = false
146-
loadNewAdvertising {
170+
onLoadFullScreenAd {
147171
ExploitHandler(this) { result ->
148172
advertising?.show(this)
149173
binding.mLog.text = result.log
@@ -176,9 +200,24 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
176200
}
177201
}
178202

179-
private fun loadNewAdvertising(onComplete: (error: LoadAdError?) -> Unit) =
203+
private fun onSetupBannerAd() {
204+
fun onLoadNewAd() = launch(Dispatchers.Main) {
205+
binding.mBannerAd.loadAd(AdRequest.Builder().build())
206+
}
207+
208+
Timer().scheduleAtFixedRate(
209+
object : TimerTask() {
210+
override fun run() {
211+
onLoadNewAd()
212+
}
213+
},
214+
0, 3000,
215+
)
216+
}
217+
218+
private fun onLoadFullScreenAd(onComplete: (error: LoadAdError?) -> Unit) =
180219
InterstitialAd.load(
181-
this, getString(R.string.advertising_id),
220+
this, getString(R.string.intersticial_advertising_id),
182221
AdManagerAdRequest.Builder().build(),
183222
object : InterstitialAdLoadCallback() {
184223
override fun onAdLoaded(interstitial: InterstitialAd) {

app/src/main/res/layout/activity_main.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
android:orientation="vertical">
88

99
<com.google.android.material.appbar.AppBarLayout
10+
android:id="@+id/mAppBar"
1011
android:layout_width="match_parent"
1112
android:layout_height="wrap_content">
1213

1314
<com.google.android.material.appbar.MaterialToolbar
15+
android:id="@+id/mToolBar"
1416
android:layout_width="match_parent"
1517
android:layout_height="wrap_content"
1618
app:layout_scrollFlags="scroll|enterAlways"
@@ -27,6 +29,10 @@
2729
android:id="@+id/mRootView"
2830
style="@style/LinearLayoutContainer">
2931

32+
<android.widget.Space
33+
android:layout_width="0dp"
34+
android:layout_height="24dp" />
35+
3036
<com.google.android.material.card.MaterialCardView style="@style/CustomCardView">
3137

3238
<LinearLayout style="@style/CustomCardViewContainer">
@@ -199,9 +205,10 @@
199205
</LinearLayout>
200206
</com.google.android.material.card.MaterialCardView>
201207

202-
<androidx.legacy.widget.Space
208+
<android.widget.Space
203209
android:layout_width="0dp"
204210
android:layout_height="80dp" />
211+
205212
</LinearLayout>
206213
</androidx.core.widget.NestedScrollView>
207214

@@ -217,4 +224,15 @@
217224
app:tint="@android:color/white"
218225
tools:ignore="ContentDescription" />
219226

227+
<com.google.android.gms.ads.AdView
228+
android:id="@+id/mBannerAd"
229+
android:layout_width="match_parent"
230+
android:layout_height="wrap_content"
231+
app:adSize="BANNER"
232+
app:adUnitId="@string/banner_advertising_id"
233+
app:layout_anchor="@id/mAppBar"
234+
android:layout_gravity="bottom"
235+
app:layout_anchorGravity="bottom" />
236+
237+
220238
</androidx.coordinatorlayout.widget.CoordinatorLayout>

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
</string>
1616
<string name="executing_script">Executing script</string>
1717
<string name="please_wait">Please wait</string>
18+
<string name="banner_advertising_id" translatable="false">ca-app-pub-4100401274047460/1297176350</string>
1819
<string name="application_advertising_id" translatable="false">ca-app-pub-4100401274047460~8660712784</string>
19-
<string name="advertising_id" translatable="false">ca-app-pub-4100401274047460/2396825799</string>
20+
<string name="intersticial_advertising_id" translatable="false">ca-app-pub-4100401274047460/2396825799</string>
2021
<string name="donate_url" translatable="false">https://mpago.la/2anvA1b</string>
2122
<string name="github_url" translatable="false">https://github.com/JunioJsv/mtk-easy-su</string>
2223
<string name="github_api_entry" translatable="false">https://api.github.com/</string>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<network-security-config>
3+
<domain-config cleartextTrafficPermitted="true">
4+
<domain includeSubdomains="true">127.0.0.1</domain>
5+
</domain-config>
6+
</network-security-config>

build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
buildscript {
2-
ext.kotlin_version = '1.5.30'
3-
ext.adbmob_test_device = System.getenv('ADMOB_TEST_DEVICE')
2+
ext.kotlin_version = '1.8.22'
43
repositories {
54
google()
65
mavenCentral()
76
}
87
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.1.3'
8+
classpath 'com.android.tools.build:gradle:7.4.2'
109
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1110
classpath 'com.google.gms:google-services:4.3.10'
1211
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
@@ -20,6 +19,6 @@ allprojects {
2019
}
2120
}
2221

23-
task clean(type: Delete) {
22+
tasks.register('clean', Delete) {
2423
delete rootProject.buildDir
2524
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Dec 24 17:49:17 BRT 2020
1+
#Thu Nov 09 14:52:47 BRT 2023
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip

0 commit comments

Comments
 (0)