@@ -42,28 +42,28 @@ const val GITHUB_URL = "https://github.com/liangchenhe55/QQ-Notify-Evolution/rel
4242const val MANUAL_URL = " https://github.com/liangchenhe55/QQ-Notify-Evolution/wiki"
4343
4444const val ALIPAY =
45- " alipayqr://platformapi/startapp?saId=10000007&qrcode=https://qr.alipay.com/tsx12672qtk37hufsxfkub7"
45+ " alipayqr://platformapi/startapp?saId=10000007&qrcode=https://qr.alipay.com/tsx12672qtk37hufsxfkub7"
4646
4747/* *
4848 * 适配的应用包名列表。
4949 */
5050val packageNameList: List <String >
5151 get() = listOf (
52- " com.tencent.mobileqq " ,
53- " com.tencent.tim " ,
54- " com.tencent.qqlite " ,
55- " com.tencent.minihd.qq "
52+ Tag . QQ .pkg ,
53+ Tag . TIM .pkg ,
54+ Tag . QQ_LITE .pkg ,
55+ Tag . QQ_HD .pkg,
5656 )
5757
5858/* *
5959 * 通知渠道 id 列表。
6060 */
6161val notificationChannelIdList: List <String >
6262 get() = listOf (
63- NOTIFY_FRIEND_CHANNEL_ID ,
64- NOTIFY_FRIEND_SPECIAL_CHANNEL_ID ,
65- NOTIFY_GROUP_CHANNEL_ID ,
66- NOTIFY_QZONE_CHANNEL_ID
63+ NOTIFY_FRIEND_CHANNEL_ID ,
64+ NOTIFY_FRIEND_SPECIAL_CHANNEL_ID ,
65+ NOTIFY_GROUP_CHANNEL_ID ,
66+ NOTIFY_QZONE_CHANNEL_ID
6767 )
6868
6969fun getChannelId (channel : NotifyChannel ): String = when (channel) {
@@ -80,40 +80,48 @@ fun getNotificationChannels(context: Context, nevo: Boolean): List<NotificationC
8080 val prefix = if (nevo) context.getString(R .string.notify_nevo_prefix) else " "
8181
8282 val att = AudioAttributes .Builder ()
83- .setUsage(AudioAttributes .USAGE_NOTIFICATION_COMMUNICATION_INSTANT )
84- .setContentType(AudioAttributes .CONTENT_TYPE_SONIFICATION )
85- .build()
86-
87- val friendChannel = NotificationChannel (NOTIFY_FRIEND_CHANNEL_ID ,
88- prefix + context.getString(R .string.notify_friend_channel_name),
89- NotificationManager .IMPORTANCE_HIGH ).apply {
83+ .setUsage(AudioAttributes .USAGE_NOTIFICATION_COMMUNICATION_INSTANT )
84+ .setContentType(AudioAttributes .CONTENT_TYPE_SONIFICATION )
85+ .build()
86+
87+ val friendChannel = NotificationChannel (
88+ NOTIFY_FRIEND_CHANNEL_ID ,
89+ prefix + context.getString(R .string.notify_friend_channel_name),
90+ NotificationManager .IMPORTANCE_HIGH
91+ ).apply {
9092 description = context.getString(R .string.notify_friend_channel_des)
9193 setSound(RingtoneManager .getDefaultUri(RingtoneManager .TYPE_NOTIFICATION ), att)
9294 enableVibration(true )
9395 enableLights(true )
9496 }
9597
96- val friendSpecialChannel = NotificationChannel (NOTIFY_FRIEND_SPECIAL_CHANNEL_ID ,
97- prefix + context.getString(R .string.notify_friend_special_channel_name),
98- NotificationManager .IMPORTANCE_HIGH ).apply {
98+ val friendSpecialChannel = NotificationChannel (
99+ NOTIFY_FRIEND_SPECIAL_CHANNEL_ID ,
100+ prefix + context.getString(R .string.notify_friend_special_channel_name),
101+ NotificationManager .IMPORTANCE_HIGH
102+ ).apply {
99103 description = context.getString(R .string.notify_friend_special_channel_des)
100104 setSound(RingtoneManager .getDefaultUri(RingtoneManager .TYPE_NOTIFICATION ), att)
101105 enableVibration(true )
102106 enableLights(true )
103107 }
104108
105- val groupChannel = NotificationChannel (NOTIFY_GROUP_CHANNEL_ID ,
106- prefix + context.getString(R .string.notify_group_channel_name),
107- NotificationManager .IMPORTANCE_HIGH ).apply {
109+ val groupChannel = NotificationChannel (
110+ NOTIFY_GROUP_CHANNEL_ID ,
111+ prefix + context.getString(R .string.notify_group_channel_name),
112+ NotificationManager .IMPORTANCE_HIGH
113+ ).apply {
108114 description = context.getString(R .string.notify_group_channel_des)
109115 setSound(RingtoneManager .getDefaultUri(RingtoneManager .TYPE_NOTIFICATION ), att)
110116 enableVibration(true )
111117 enableLights(true )
112118 }
113119
114- val qzoneChannel = NotificationChannel (NOTIFY_QZONE_CHANNEL_ID ,
115- prefix + context.getString(R .string.notify_qzone_channel_name),
116- NotificationManager .IMPORTANCE_DEFAULT ).apply {
120+ val qzoneChannel = NotificationChannel (
121+ NOTIFY_QZONE_CHANNEL_ID ,
122+ prefix + context.getString(R .string.notify_qzone_channel_name),
123+ NotificationManager .IMPORTANCE_DEFAULT
124+ ).apply {
117125 description = context.getString(R .string.notify_qzone_channel_des)
118126 setSound(RingtoneManager .getDefaultUri(RingtoneManager .TYPE_NOTIFICATION ), att)
119127 enableLights(true )
@@ -124,7 +132,8 @@ fun getNotificationChannels(context: Context, nevo: Boolean): List<NotificationC
124132
125133private fun getCacheDir (context : Context ): File {
126134 return if (Environment .MEDIA_MOUNTED == Environment .getExternalStorageState()
127- || ! Environment .isExternalStorageRemovable()) {
135+ || ! Environment .isExternalStorageRemovable()
136+ ) {
128137 context.externalCacheDir!!
129138 } else {
130139 context.cacheDir
@@ -133,7 +142,8 @@ private fun getCacheDir(context: Context): File {
133142
134143private fun getDataDir (context : Context ): File {
135144 return if (Environment .MEDIA_MOUNTED == Environment .getExternalStorageState()
136- || ! Environment .isExternalStorageRemovable()) {
145+ || ! Environment .isExternalStorageRemovable()
146+ ) {
137147 context.getExternalFilesDir(null )!!
138148 } else {
139149 context.filesDir
0 commit comments