File tree 2 files changed +50
-0
lines changed
src/main/java/remix/myplayer/service
2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -264,3 +264,50 @@ dependencies {
264
264
val googleImplementation by configurations
265
265
googleImplementation(libs.billingclient)
266
266
}
267
+
268
+ // 上传mapping文件
269
+ if (properties.getProperty(" BUGLY_UPLOAD" ) == " 1" ) {
270
+ val uploadMapping by tasks.registering(Exec ::class ) {
271
+ val jarFile = File (properties.getProperty(" BUGLY_JAR" ) ? : " " )
272
+ if (! jarFile.exists()) {
273
+ logger.warn(" jarFile: ${jarFile.absolutePath} don't exist" )
274
+ return @registering
275
+ }
276
+
277
+ val appId = properties.getProperty(" BUGLY_APPID" )
278
+ val appKey = properties.getProperty(" BUGLY_APPKEY" )
279
+ if (appId.isNullOrEmpty() || appKey.isNullOrEmpty()) {
280
+ logger.warn(" appId or appKey for bugly is invalid" )
281
+ return @registering
282
+ }
283
+
284
+ val mappingFile =
285
+ file(" ${project.layout.buildDirectory.asFile.get()} /outputs/mapping/nonGoogleWithUpdaterRelease/mapping.txt" )
286
+ val args = listOf (
287
+ " -appid" ,
288
+ appId,
289
+ " -appkey" ,
290
+ appKey,
291
+ " -bundleid" ,
292
+ android.defaultConfig.applicationId,
293
+ " -version" ,
294
+ android.defaultConfig.versionName,
295
+ " -buildNo" ,
296
+ android.defaultConfig.versionCode.toString(),
297
+ " -platform" ,
298
+ " Android" ,
299
+ " -inputMapping" ,
300
+ mappingFile.absolutePath
301
+ )
302
+
303
+ commandLine = listOf (" java" , " -jar" , jarFile.absolutePath) + args
304
+ standardOutput = System .out
305
+ errorOutput = System .out
306
+ }
307
+
308
+ tasks.whenTaskAdded {
309
+ if (name == " assembleNonGoogleWithUpdaterRelease" ) {
310
+ finalizedBy(uploadMapping)
311
+ }
312
+ }
313
+ }
Original file line number Diff line number Diff line change 1
1
package remix.myplayer.service
2
2
3
3
import android.os.CountDownTimer
4
+ import android.os.DeadSystemException
4
5
import android.os.Handler
5
6
import androidx.annotation.FloatRange
6
7
import timber.log.Timber
@@ -46,6 +47,8 @@ class VolumeController(private val service: MusicService) {
46
47
mediaPlayer.pause()
47
48
} catch (e: IllegalStateException ) {
48
49
Timber .v(e)
50
+ } catch (e: DeadSystemException ) {
51
+ Timber .v(e)
49
52
}
50
53
}
51
54
You can’t perform that action at this time.
0 commit comments