Skip to content

Commit

Permalink
Deal with new requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Jun 19, 2021
1 parent 594cdca commit 3d09ab4
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ tasks.clean.dependsOn("cargoClean")
dependencies {
val coroutinesVersion = "1.5.0"
val roomVersion = "2.3.0"
val workVersion = "2.5.0"
val workVersion = "2.7.0-alpha04"

api(project(":plugin"))
api("androidx.core:core-ktx:1.6.0-rc01")
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<activity
android:name="com.github.shadowsocks.UrlImportActivity"
android:theme="@style/Theme.AppCompat.Translucent"
android:exported="true"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
Expand All @@ -89,12 +90,14 @@
<activity
android:name="com.github.shadowsocks.VpnRequestActivity"
android:theme="@style/Theme.AppCompat.Translucent"
android:exported="false"
android:excludeFromRecents="true"
android:taskAffinity=""/>

<receiver android:name="com.github.shadowsocks.BootReceiver"
android:process=":bg"
android:directBootAware="true"
android:exported="true"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/github/shadowsocks/Core.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ object Core : Configuration.Provider {
this.app = app
this.configureIntent = {
PendingIntent.getActivity(it, 0, Intent(it, configureClass.java)
.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT), 0)
.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT), PendingIntent.FLAG_IMMUTABLE)
}

if (Build.VERSION.SDK_INT >= 24) { // migrate old files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class ServiceNotification(private val service: BaseService.Interface, profileNam
val closeAction = NotificationCompat.Action.Builder(
R.drawable.ic_navigation_close,
service.getText(R.string.stop),
PendingIntent.getBroadcast(service, 0, Intent(Action.CLOSE).setPackage(service.packageName), 0)).apply {
PendingIntent.getBroadcast(service, 0, Intent(Action.CLOSE).setPackage(service.packageName),
PendingIntent.FLAG_IMMUTABLE)).apply {
setShowsUserInterface(false)
}.build()
if (Build.VERSION.SDK_INT < 24) builder.addAction(closeAction) else builder.addInvisibleAction(closeAction)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import com.google.gson.JsonStreamParser
import kotlinx.coroutines.*
import timber.log.Timber
import java.io.File
import java.io.IOException
import java.io.InputStream
import java.net.HttpURLConnection
import java.net.URL
Expand Down Expand Up @@ -83,7 +82,7 @@ class SubscriptionService : Service(), CoroutineScope {
R.drawable.ic_navigation_close,
getText(R.string.stop),
PendingIntent.getBroadcast(this@SubscriptionService, 0,
Intent(Action.ABORT).setPackage(packageName), 0)).apply {
Intent(Action.ABORT).setPackage(packageName), PendingIntent.FLAG_IMMUTABLE)).apply {
setShowsUserInterface(false)
}.build())
setCategory(NotificationCompat.CATEGORY_PROGRESS)
Expand Down
14 changes: 12 additions & 2 deletions mobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:exported="true"
android:theme="@style/Theme.Shadowsocks.Immersive.Navigation"
android:launchMode="singleTask">
<intent-filter>
Expand All @@ -35,13 +36,15 @@

<activity
android:name=".ProfileConfigActivity"
android:exported="false"
android:theme="@style/Theme.Shadowsocks.Immersive"
android:excludeFromRecents="true"
android:label="@string/profile_config"
android:launchMode="singleTask"/>

<activity
android:name=".AppManager"
android:exported="false"
android:label="@string/proxied_apps"
android:parentActivityName=".ProfileConfigActivity"
android:theme="@style/Theme.Shadowsocks.Immersive"
Expand All @@ -50,22 +53,26 @@

<activity
android:name=".UdpFallbackProfileActivity"
android:exported="false"
android:label="@string/udp_fallback"
android:theme="@style/Theme.Shadowsocks.Immersive"
android:launchMode="singleTask"
android:excludeFromRecents="true"/>

<activity
android:name=".ScannerActivity"
android:exported="true"
android:label="@string/add_profile_methods_scan_qr_code"
android:parentActivityName=".MainActivity"
android:theme="@style/Theme.Shadowsocks.Immersive"
android:launchMode="singleTask"
android:screenOrientation="locked"
android:excludeFromRecents="true"/>

<activity android:name=".tasker.ConfigActivity"
android:theme="@style/Theme.Shadowsocks.Immersive">
<activity
android:name=".tasker.ConfigActivity"
android:exported="true"
android:theme="@style/Theme.Shadowsocks.Immersive">
<intent-filter>
<action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING" />
</intent-filter>
Expand All @@ -75,6 +82,7 @@
android:name=".QuickToggleShortcut"
android:label="@string/quick_toggle"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="true"
android:launchMode="singleTask"
android:excludeFromRecents="true"
android:taskAffinity=""
Expand All @@ -87,6 +95,7 @@
<service android:name=".bg.TileService"
android:label="@string/quick_toggle"
android:process=":bg"
android:exported="true"
android:directBootAware="true"
android:icon="@drawable/ic_service_active"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
Expand All @@ -102,6 +111,7 @@
<receiver android:name=".tasker.ActionListener"
android:process=":bg"
android:directBootAware="true"
android:exported="true"
tools:ignore="ExportedReceiver">
<intent-filter>
<action android:name="com.twofortyfouram.locale.intent.action.FIRE_SETTING"/>
Expand Down
1 change: 1 addition & 0 deletions tv/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
Expand Down

0 comments on commit 3d09ab4

Please sign in to comment.