-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
133 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
app/src/main/java/com/koalasat/pokey/service/BootReceiver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.koalasat.pokey.service | ||
|
||
import android.content.BroadcastReceiver | ||
import android.content.Context | ||
import android.content.Intent | ||
import android.os.Build | ||
import android.util.Log | ||
import com.koalasat.pokey.Pokey | ||
|
||
class BootReceiver : BroadcastReceiver() { | ||
override fun onReceive(context: Context, intent: Intent) { | ||
if (!Pokey.isForegroundServiceEnabled(context)) return | ||
|
||
if (intent.action == Intent.ACTION_PACKAGE_REPLACED && Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { | ||
if (intent.dataString?.contains("com.greenart7c3.nostrsigner") == true) { | ||
Log.d("BootReceiver", "Starting ConnectivityService ACTION_PACKAGE_REPLACED") | ||
context.startForegroundService( | ||
Intent( | ||
context, | ||
NotificationsService::class.java, | ||
), | ||
) | ||
} | ||
} | ||
|
||
if (intent.action == Intent.ACTION_MY_PACKAGE_REPLACED) { | ||
Log.d("BootReceiver", "Starting ConnectivityService ACTION_MY_PACKAGE_REPLACED") | ||
context.startForegroundService( | ||
Intent( | ||
context, | ||
NotificationsService::class.java, | ||
), | ||
) | ||
} | ||
|
||
if (intent.action == Intent.ACTION_BOOT_COMPLETED) { | ||
Log.d("BootReceiver", "Starting ConnectivityService ACTION_BOOT_COMPLETED") | ||
context.startForegroundService( | ||
Intent( | ||
context, | ||
NotificationsService::class.java, | ||
), | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt" | ||
android:viewportWidth="100" | ||
android:viewportHeight="100" | ||
android:width="800dp" | ||
android:height="800dp"> | ||
<group | ||
android:scaleX="1.597919" | ||
android:scaleY="1.597919" | ||
android:translateX="-31.30763" | ||
android:translateY="-31.43249"> | ||
<path | ||
android:pathData="M73.9 27c-3.9 0 -7.1 3.2 -7.1 7.1 0 0.6 0.1 1.1 0.2 1.6l-6.7 4.4c-2.1 -2.4 -5.1 -4 -8.6 -4 -2.6 0 -5 0.9 -6.9 2.4l-11 -7.6C34.5 28 33 24.8 30.2 23.5 26.9 22 23 23.4 21.5 26.6c-1.5 3.2 -0.1 7.2 3.1 8.7 1.7 0.8 3.6 0.8 5.3 0.1l11.3 7.9c-0.5 1.2 -0.8 2.6 -0.8 4 0 0.8 0.1 1.5 0.2 2.3l-6.9 2.5c-0.9 -1 -2.1 -1.8 -3.6 -2.2 -3.9 -1.1 -8 1.2 -9.1 5.2 -1.1 3.9 1.2 8 5.2 9.1 3.9 1.1 8 -1.2 9.1 -5.2 0.1 -0.4 0.2 -0.8 0.2 -1.2L43.4 55c2.1 2.2 5 3.6 8.2 3.6 0.3 0 0.6 0 0.9 0l1.1 5.6c-2.1 1.7 -3.3 4.4 -3 7.2 0.4 4.6 4.5 7.9 9.1 7.5 4.6 -0.4 7.9 -4.5 7.5 -9.1 -0.4 -4.1 -3.7 -7.2 -7.7 -7.5l-1.2 -5.9c2.8 -2 4.7 -5.4 4.7 -9.1 0 -0.6 -0.1 -1.2 -0.1 -1.7l7.9 -5.2c1 0.5 2.1 0.8 3.2 0.8 3.9 0 7.1 -3.2 7.1 -7.1C81 30.2 77.8 27 73.9 27ZM51.7 54.6c-4 0 -7.2 -3.2 -7.2 -7.2 0 -4 3.2 -7.2 7.2 -7.2 4 0 7.2 3.2 7.2 7.2 0 3.9 -3.2 7.2 -7.2 7.2z" | ||
android:fillColor="#000000" /> | ||
<path | ||
android:pathData="M55 47.4A3.2 3.2 0 0 1 48.6 47.4A3.2 3.2 0 0 1 55 47.4Z" | ||
android:fillColor="#000000" /> | ||
</group> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:id="@+id/textViewItem" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textSize="16sp" | ||
android:layout_marginBottom="16dp"/> | ||
</LinearLayout> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters