Commit 1d4cc8d7 authored by pengjunjing's avatar pengjunjing

添加华为推送

parent fce7f7d5
......@@ -14,3 +14,4 @@
.cxx
local.properties
/.idea/
/app/laihua_video.jks
\ No newline at end of file
[submodule "push"]
path = push
url = git@gitlab.ilaihua.com:Mobile/android/common-libs/base/push.git
/build
\ No newline at end of file
/build
/laihua_kt.jks
{
"agcgw":{
"backurl":"connect-drcn.dbankcloud.cn",
"url":"connect-drcn.hispace.hicloud.com",
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.cn",
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.com"
},
"agcgw_all":{
"CN":"connect-drcn.hispace.hicloud.com",
"CN_back":"connect-drcn.dbankcloud.cn",
"DE":"connect-dre.hispace.hicloud.com",
"DE_back":"connect-dre.dbankcloud.cn",
"RU":"connect-drru.hispace.hicloud.com",
"RU_back":"connect-drru.dbankcloud.cn",
"SG":"connect-dra.hispace.hicloud.com",
"SG_back":"connect-dra.dbankcloud.cn"
},
"client":{
"cp_id":"890086000102092497",
"product_id":"736430079245720589",
"client_id":"629543953040945536",
"client_secret":"E04E30FD74B4778C51A5884672E5F8F28BC95A6A66DF5D167D69F774CDC5A84A",
"project_id":"736430079245720589",
"app_id":"104334951",
"api_key":"CgB6e3x9A2AtbcGG/Nc1QfhV1cvPtPxXC6aL84dVS6iRrDtQl1qqPsuJAQcsTDhWfwM4cnYZEZ2UO7tgUZ8TPwQ+",
"package_name":"com.laihua.pushtestproject"
},
"oauth_client":{
"client_id":"104334951",
"client_type":1
},
"app_info":{
"app_id":"104334951",
"package_name":"com.laihua.pushtestproject"
},
"service":{
"analytics":{
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"resource_id":"p1",
"channel_id":""
},
"search":{
"url":"https://search-drcn.cloud.huawei.com"
},
"cloudstorage":{
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn"
},
"ml":{
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
}
},
"region":"CN",
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"com.laihua.pushtestproject",
"client":{
"app_id":"104334951"
},
"app_info":{
"package_name":"com.laihua.pushtestproject",
"app_id":"104334951"
},
"oauth_client":{
"client_type":1,
"client_id":"104334951"
}
}
]
}
\ No newline at end of file
......@@ -4,11 +4,25 @@ plugins {
}
android {
signingConfigs {
debug {
storeFile file('\\app\\test_key.jks')
storePassword 'test_key'
keyPassword 'test_key'
keyAlias 'test_key'
}
config {
storeFile file('C:/Android/workspace/pushplatformdemo/app/test_key.jks')
storePassword 'test_key'
keyPassword 'test_key'
keyAlias 'test_key'
}
}
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.pjj.pushtestproject"
applicationId "com.laihua.pushtestproject"
minSdkVersion 23
targetSdkVersion 30
versionCode 1
......@@ -18,7 +32,11 @@ android {
}
buildTypes {
debug {
signingConfig signingConfigs.config
}
release {
signingConfig signingConfigs.config
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
......@@ -42,4 +60,7 @@ dependencies {
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
\ No newline at end of file
implementation project(':push')
implementation 'com.huawei.hms:push:5.0.4.302'
}
apply plugin: 'com.huawei.agconnect'
......@@ -18,4 +18,13 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
#-renamesourcefileattribute SourceFile
-ignorewarnings
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes SourceFile,LineNumberTable
-keep class com.hianalytics.android.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pjj.pushtestproject">
package="com.laihua.pushtestproject">
<application
android:allowBackup="true"
......@@ -8,6 +8,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:name=".MyApplication"
android:theme="@style/Theme.PushTestProject">
<activity android:name=".MainActivity">
<intent-filter>
......
package com.pjj.pushtestproject
package com.laihua.pushtestproject
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Toast.makeText(this,""+ Test.teststr,Toast.LENGTH_SHORT).show()
}
}
\ No newline at end of file
package com.laihua.pushtestproject
import android.app.Application
import com.laihua.push.PushManager
import com.laihua.push.platform.InitParam
/**
* Author: pengjunjing
* Date: 2021/5/18
* Description:
*/
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
PushManager.instance.initContext(this)
PushManager.instance.initMiPush(initParam = InitParam("2882303761519924093", "5121992433093"))
PushManager.instance.initHmsPush()
}
}
\ No newline at end of file
......@@ -4,13 +4,14 @@ buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.huawei.agconnect:agcp:1.3.1.300'
classpath 'com.huawei.agconnect:agcp:1.4.2.300'
}
}
......@@ -18,10 +19,10 @@ allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven {url 'https://developer.huawei.com/repo/'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
\ No newline at end of file
}
push @ 67230ba3
Subproject commit 325f5aba902c2e9266e38c67c82e4bebf639ddd4
Subproject commit 67230ba365669b46d69dcc126b970e2853f7f6b4
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment