Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bannedbook committed Aug 14, 2023
1 parent 6668d3f commit 771a2f7
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 30 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ buildscript {
junitVersion = '4.13'
androidTestVersion = '1.2.0'
androidEspressoVersion = '3.2.0'
versionCode = 5001199
versionName = '6.2.1'
versionCode = 5001209
versionName = '6.3.0'
resConfigs = ['ar', 'es', 'fa', 'fr', 'ja', 'ko', 'ru', 'tr', 'zh-rCN', 'zh-rTW']
}

Expand Down
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ dependencies {
api "androidx.room:room-runtime:2.2.5"
kapt "androidx.room:room-compiler:2.2.5"
api "androidx.work:work-runtime-ktx:2.4.0"
implementation 'androidx.work:work-runtime:2.7.1'
api "androidx.work:work-gcm:2.4.0"
api 'com.google.firebase:firebase-analytics-ktx:19.0.0'
api 'com.google.firebase:firebase-config-ktx:21.0.0'
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission-sdk-23 android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-feature android:name="android.software.leanback"
android:required="false"/>

Expand Down
14 changes: 10 additions & 4 deletions core/src/main/java/com/github/shadowsocks/Core.kt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ object Core {
fun init(app: Application, configureClass: KClass<out Any>) {
this.app = app
this.configureIntent = {
PendingIntent.getActivity(it, 0, Intent(it, configureClass.java)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
PendingIntent.getActivity(it, 0, Intent(it, configureClass.java)
.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT), PendingIntent.FLAG_IMMUTABLE)
else
PendingIntent.getActivity(it, 0, Intent(it, configureClass.java)
.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT), 0)
}

Expand All @@ -213,9 +217,11 @@ object Core {
}
}
})
val config:Configuration = Configuration.Builder().build()
WorkManager.initialize(app.applicationContext, config)
UpdateCheck.enqueue() //google play Publishing, prohibiting self-renewal
/* if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
val config: Configuration = Configuration.Builder().build()
WorkManager.initialize(app.applicationContext, config)
UpdateCheck.enqueue() //google play Publishing, prohibiting self-renewal
}*/

// handle data restored/crash
if (Build.VERSION.SDK_INT >= 24 && DataStore.directBootAware &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ class ServiceNotification(private val service: BaseService.Interface, profileNam

init {
service as Context
var intentFlad=0
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) intentFlad=PendingIntent.FLAG_IMMUTABLE
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), intentFlad)).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 @@ -26,6 +26,7 @@ import android.app.PendingIntent
import android.app.Service
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import android.os.IBinder
import android.util.Log
import android.widget.Toast
Expand Down Expand Up @@ -80,11 +81,13 @@ class SubscriptionService : Service(), CoroutineScope {
val notification = NotificationCompat.Builder(this@SubscriptionService, NOTIFICATION_CHANNEL).apply {
color = ContextCompat.getColor(this@SubscriptionService, R.color.material_primary_500)
priority = NotificationCompat.PRIORITY_LOW
var intentFlad=0
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) intentFlad=PendingIntent.FLAG_IMMUTABLE
addAction(NotificationCompat.Action.Builder(
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), intentFlad)).apply {
setShowsUserInterface(false)
}.build())
setCategory(NotificationCompat.CATEGORY_PROGRESS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import androidx.core.content.getSystemService
Expand Down Expand Up @@ -45,9 +46,11 @@ class UpdateCheck(context: Context, workerParams: WorkerParameters) : CoroutineW
if (info["version"].asInt > BuildConfig.VERSION_CODE) {
val nm = app.getSystemService<NotificationManager>()!!
val intent = Intent(Intent.ACTION_VIEW).setData(Uri.parse(update_uri))
var intentFlad=0
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) intentFlad=PendingIntent.FLAG_IMMUTABLE
val builder = NotificationCompat.Builder(app as Context, "update")
.setColor(ContextCompat.getColor(app, R.color.material_primary_500))
.setContentIntent(PendingIntent.getActivity(app, 0, intent, 0))
.setContentIntent(PendingIntent.getActivity(app, 0, intent, intentFlad))
.setVisibility(
if (DataStore.canToggleLocked) NotificationCompat.VISIBILITY_PUBLIC
else NotificationCompat.VISIBILITY_PRIVATE
Expand Down
17 changes: 0 additions & 17 deletions core/src/main/java/org/bannedbook/app/service/PolipoService.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,6 @@ public void onDestroy() {
//stopForeground(true);
}

private void createNotification() {

Intent notificationIntent = new Intent(this, mContext.getClass());
//notificationIntent.setData(Uri.parse("http://127.0.0.1:8123"));
//notificationIntent.setClassName(this,mContext.getClass().getName());
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,notificationIntent, 0);

Notification notification = new Notification.Builder(this).
setContentTitle("JWProxy").
setContentText("JWProxy - 禁闻代理正在运行。").
setSmallIcon(android.R.drawable.ic_media_play).
setOngoing(true).
setContentIntent(pendingIntent).
build();
startForeground(ONGOING_NOTIFICATION, notification);
}

private void copyAssets(String configFile, String toPath) {
AssetManager assetManager = getAssets();
Log.e("---", "Copy file: " + configFile);
Expand Down
2 changes: 1 addition & 1 deletion gitupdate.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ git pull origin master
git add -A
git commit -m "update"
git push origin master
git tag -a v6.2.0 -m "release v6.2.0"
git tag -a v6.3.0 -m "release v6.3.0"
git push origin --tags
pause
Binary file added libv2ray/libv2ray-sources.jar
Binary file not shown.
Binary file added libv2ray/libv2ray.aar
Binary file not shown.
2 changes: 1 addition & 1 deletion update-zh.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5001168",
"version": "5001209",
"title": "V2ray VPN 有新版本",
"text": "请尽快从Google Play下载更新。如果您以前不是从Google Play安装的,则可能需要先卸载再安装!",
"uri": "https://play.google.com/store/apps/details?id=free.v2ray.proxy.VPN"
Expand Down
2 changes: 1 addition & 1 deletion update.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5001168",
"version": "5001209",
"title": "New version detected",
"text": "Please download the update from Google Play as soon as possible. If you did not install it from Google Play before, you may need to uninstall then to install it!",
"uri": "https://play.google.com/store/apps/details?id=free.v2ray.proxy.VPN"
Expand Down

0 comments on commit 771a2f7

Please sign in to comment.