Skip to content

Commit

Permalink
Merge branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
pranshoe committed Dec 29, 2022
2 parents 0a53017 + 37b81ad commit d252f37
Show file tree
Hide file tree
Showing 31 changed files with 445 additions and 185 deletions.
11 changes: 6 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ android {
packagingOptions {
resources {
excludes += "/META-INF/*"
excludes += "/META-INF/versions/**"
excludes += "/org/bouncycastle/**"
excludes += "/kotlin/**"
excludes += "/kotlinx/**"
Expand Down Expand Up @@ -72,9 +73,9 @@ dependencies {
implementation("com.github.topjohnwu:indeterminate-checkbox:1.0.7")
implementation("com.github.topjohnwu:lz4-java:1.7.1")
implementation("com.jakewharton.timber:timber:5.0.1")
implementation("org.bouncycastle:bcpkix-jdk18on:1.71")
implementation("org.bouncycastle:bcpkix-jdk18on:1.72")
implementation("dev.rikka.rikkax.layoutinflater:layoutinflater:1.2.0")
implementation("dev.rikka.rikkax.insets:insets:1.2.0")
implementation("dev.rikka.rikkax.insets:insets:1.3.0")
implementation("dev.rikka.rikkax.recyclerview:recyclerview-ktx:1.3.1")
implementation("io.noties.markwon:core:4.6.2")

Expand All @@ -93,11 +94,11 @@ dependencies {
implementation("com.squareup.okhttp3:logging-interceptor:${vOkHttp}")
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:${vOkHttp}")

val vMoshi = "1.13.0"
val vMoshi = "1.14.0"
implementation("com.squareup.moshi:moshi:${vMoshi}")
kapt("com.squareup.moshi:moshi-kotlin-codegen:${vMoshi}")

val vRoom = "2.5.0-alpha03"
val vRoom = "2.5.0-rc01"
implementation("androidx.room:room-runtime:${vRoom}")
implementation("androidx.room:room-ktx:${vRoom}")
kapt("androidx.room:room-compiler:${vRoom}")
Expand All @@ -111,7 +112,7 @@ dependencies {
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.recyclerview:recyclerview:1.2.1")
implementation("androidx.fragment:fragment-ktx:1.5.4")
implementation("androidx.fragment:fragment-ktx:1.5.5")
implementation("androidx.transition:transition:1.4.1")
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.core:core-splashscreen:1.0.0")
Expand Down
1 change: 0 additions & 1 deletion app/shared/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.topjohnwu.shared"
android:installLocation="internalOnly">

<uses-permission android:name="android.permission.INTERNET" />
Expand Down
13 changes: 11 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<permission
android:name="${applicationId}.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"
android:protectionLevel="signature"
tools:node="remove" />

<uses-permission
android:name="${applicationId}.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"
tools:node="remove" />

<application
android:name=".core.App"
android:extractNativeLibs="true"
android:icon="@drawable/ic_launcher"
android:multiArch="true"
tools:remove="android:appComponentFactory"
tools:ignore="UnusedAttribute,GoogleAppIndexingWarning">
tools:ignore="UnusedAttribute,GoogleAppIndexingWarning"
tools:remove="android:appComponentFactory">

<activity
android:name=".ui.MainActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ abstract class MagiskInstallImpl protected constructor(
}

// Extract scripts
for (script in listOf("util_functions.sh", "boot_patch.sh", "addon.d.sh")) {
for (script in listOf("util_functions.sh", "boot_patch.sh", "addon.d.sh", "stub.apk")) {
val dest = File(installDir, script)
context.assets.open(script).writeTo(dest)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.topjohnwu.magisk.core.utils.net

import android.annotation.TargetApi
import android.content.Context
import android.net.ConnectivityManager
import android.net.Network
import android.net.NetworkCapabilities
import android.net.NetworkRequest
import android.os.Build
import androidx.collection.ArraySet

@TargetApi(21)
open class LollipopNetworkObserver(
context: Context,
callback: ConnectionCallback
Expand All @@ -17,10 +16,13 @@ open class LollipopNetworkObserver(
private val networkCallback = NetCallback()

init {
val request = NetworkRequest.Builder()
.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
.build()
manager.registerNetworkCallback(request, networkCallback)
val builder = NetworkRequest.Builder()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
builder.addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED)
} else {
builder.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
}
manager.registerNetworkCallback(builder.build(), networkCallback)
}

@Suppress("DEPRECATION")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("DEPRECATION")

package com.topjohnwu.magisk.core.utils.net

import android.annotation.TargetApi
Expand Down Expand Up @@ -32,7 +30,7 @@ class MarshmallowNetworkObserver(

override fun getCurrentState() {
callback(manager.getNetworkCapabilities(manager.activeNetwork)
?.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) ?: false)
?.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED) ?: false)
}

private inner class IdleBroadcastReceiver: BroadcastReceiver() {
Expand Down
Loading

0 comments on commit d252f37

Please sign in to comment.