Merge pull request #39 from gedoor/master

get google-services
pull/481/head
Antecer 5 years ago committed by GitHub
commit a90207214b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 69
      app/google-services .json
  2. 69
      app/src/debug/google-services .json
  3. 8
      app/src/main/java/io/legado/app/service/ShareService.kt
  4. 25
      app/src/main/java/io/legado/app/service/WebService.kt
  5. 6
      app/src/main/res/menu/book_source.xml
  6. 1
      app/src/main/res/values/strings.xml

@ -0,0 +1,69 @@
{
"project_info": {
"project_number": "453392274790",
"firebase_url": "https://legado-fca69.firebaseio.com",
"project_id": "legado-fca69",
"storage_bucket": "legado-fca69.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:453392274790:android:1d2b1eefbe0e78cff624a7",
"android_client_info": {
"package_name": "io.legado.app"
}
},
"oauth_client": [
{
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyD90mfNLhA7cAzzI9SonpSz5mrF5BnmyJA"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:453392274790:android:c4eac14b1410eec5f624a7",
"android_client_info": {
"package_name": "io.legado.app.debug"
}
},
"oauth_client": [
{
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyD90mfNLhA7cAzzI9SonpSz5mrF5BnmyJA"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

@ -0,0 +1,69 @@
{
"project_info": {
"project_number": "453392274790",
"firebase_url": "https://legado-fca69.firebaseio.com",
"project_id": "legado-fca69",
"storage_bucket": "legado-fca69.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:453392274790:android:1d2b1eefbe0e78cff624a7",
"android_client_info": {
"package_name": "io.legado.app"
}
},
"oauth_client": [
{
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyD90mfNLhA7cAzzI9SonpSz5mrF5BnmyJA"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:453392274790:android:c4eac14b1410eec5f624a7",
"android_client_info": {
"package_name": "io.legado.app.debug"
}
},
"oauth_client": [
{
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyD90mfNLhA7cAzzI9SonpSz5mrF5BnmyJA"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

@ -1,8 +0,0 @@
package io.legado.app.service
import io.legado.app.base.BaseService
class ShareService : BaseService() {
}

@ -2,8 +2,12 @@ package io.legado.app.service
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import androidx.core.app.NotificationCompat
import io.legado.app.R
import io.legado.app.base.BaseService import io.legado.app.base.BaseService
import io.legado.app.constant.Action import io.legado.app.constant.Action
import io.legado.app.constant.AppConst
import io.legado.app.help.IntentHelp
import org.jetbrains.anko.startService import org.jetbrains.anko.startService
class WebService : BaseService() { class WebService : BaseService() {
@ -28,6 +32,7 @@ class WebService : BaseService() {
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
isRun = true isRun = true
updateNotification(getString(R.string.service_starting))
} }
override fun onDestroy() { override fun onDestroy() {
@ -41,4 +46,24 @@ class WebService : BaseService() {
} }
return super.onStartCommand(intent, flags, startId) return super.onStartCommand(intent, flags, startId)
} }
/**
* 更新通知
*/
private fun updateNotification(content: String) {
val builder = NotificationCompat.Builder(this, AppConst.channelIdWeb)
.setSmallIcon(R.drawable.ic_web_service_noti)
.setOngoing(true)
.setContentTitle(getString(R.string.web_service))
.setContentText(content)
builder.addAction(
R.drawable.ic_stop_black_24dp,
getString(R.string.cancel),
IntentHelp.servicePendingIntent<WebService>(this, Action.stop)
)
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
val notification = builder.build()
val notificationId = 1122
startForeground(notificationId, notification)
}
} }

@ -120,10 +120,4 @@
android:title="@string/check_select_source" android:title="@string/check_select_source"
app:showAsAction="never" /> app:showAsAction="never" />
<item
android:id="@+id/menu_share_wifi"
android:icon="@drawable/ic_share"
android:title="@string/wifi_share"
app:showAsAction="never" />
</menu> </menu>

@ -534,5 +534,6 @@
<string name="screen_find">筛选发现</string> <string name="screen_find">筛选发现</string>
<string name="dur_pos">当前位置:</string> <string name="dur_pos">当前位置:</string>
<string name="precision_search">精准搜索</string> <string name="precision_search">精准搜索</string>
<string name="service_starting">正在启动服务</string>
</resources> </resources>

Loading…
Cancel
Save