Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PushPlatformDemo
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pengjunjing
PushPlatformDemo
Commits
1d4cc8d7
Commit
1d4cc8d7
authored
May 18, 2021
by
pengjunjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加华为推送
parent
fce7f7d5
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
140 additions
and
11 deletions
+140
-11
.gitignore
.gitignore
+1
-0
.gitmodules
.gitmodules
+3
-0
.gitignore
app/.gitignore
+2
-1
agconnect-services.json
app/agconnect-services.json
+70
-0
build.gradle
app/build.gradle
+23
-2
proguard-rules.pro
app/proguard-rules.pro
+10
-1
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
MainActivity.kt
app/src/main/java/com/laihua/pushtestproject/MainActivity.kt
+3
-1
MyApplication.kt
...src/main/java/com/laihua/pushtestproject/MyApplication.kt
+20
-0
test_key.jks
app/test_key.jks
+0
-0
build.gradle
build.gradle
+5
-4
push
push
+1
-1
No files found.
.gitignore
View file @
1d4cc8d7
...
@@ -14,3 +14,4 @@
...
@@ -14,3 +14,4 @@
.cxx
.cxx
local.properties
local.properties
/.idea/
/.idea/
/app/laihua_video.jks
\ No newline at end of file
.gitmodules
0 → 100644
View file @
1d4cc8d7
[submodule "push"]
path = push
url = git@gitlab.ilaihua.com:Mobile/android/common-libs/base/push.git
app/.gitignore
View file @
1d4cc8d7
/build
/build
\ No newline at end of file
/laihua_kt.jks
app/agconnect-services.json
0 → 100644
View file @
1d4cc8d7
{
"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
app/build.gradle
View file @
1d4cc8d7
...
@@ -4,11 +4,25 @@ plugins {
...
@@ -4,11 +4,25 @@ plugins {
}
}
android
{
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
compileSdkVersion
30
buildToolsVersion
"30.0.3"
buildToolsVersion
"30.0.3"
defaultConfig
{
defaultConfig
{
applicationId
"com.
pjj
.pushtestproject"
applicationId
"com.
laihua
.pushtestproject"
minSdkVersion
23
minSdkVersion
23
targetSdkVersion
30
targetSdkVersion
30
versionCode
1
versionCode
1
...
@@ -18,7 +32,11 @@ android {
...
@@ -18,7 +32,11 @@ android {
}
}
buildTypes
{
buildTypes
{
debug
{
signingConfig
signingConfigs
.
config
}
release
{
release
{
signingConfig
signingConfigs
.
config
minifyEnabled
false
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
}
}
...
@@ -42,4 +60,7 @@ dependencies {
...
@@ -42,4 +60,7 @@ dependencies {
testImplementation
'junit:junit:4.+'
testImplementation
'junit:junit:4.+'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
}
implementation
project
(
':push'
)
\ No newline at end of file
implementation
'com.huawei.hms:push:5.0.4.302'
}
apply
plugin:
'com.huawei.agconnect'
app/proguard-rules.pro
View file @
1d4cc8d7
...
@@ -18,4 +18,13 @@
...
@@ -18,4 +18,13 @@
# If you keep the line number information, uncomment this to
# If you keep the line number information, uncomment this to
# hide the original source file name.
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
\ No newline at end of file
-
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
.
**
{
*
;}
app/src/main/AndroidManifest.xml
View file @
1d4cc8d7
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.
pjj
.pushtestproject"
>
package=
"com.
laihua
.pushtestproject"
>
<application
<application
android:allowBackup=
"true"
android:allowBackup=
"true"
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:name=
".MyApplication"
android:theme=
"@style/Theme.PushTestProject"
>
android:theme=
"@style/Theme.PushTestProject"
>
<activity
android:name=
".MainActivity"
>
<activity
android:name=
".MainActivity"
>
<intent-filter>
<intent-filter>
...
...
app/src/main/java/com/
pjj
/pushtestproject/MainActivity.kt
→
app/src/main/java/com/
laihua
/pushtestproject/MainActivity.kt
View file @
1d4cc8d7
package
com.
pjj
.pushtestproject
package
com.
laihua
.pushtestproject
import
androidx.appcompat.app.AppCompatActivity
import
androidx.appcompat.app.AppCompatActivity
import
android.os.Bundle
import
android.os.Bundle
import
android.widget.Toast
class
MainActivity
:
AppCompatActivity
()
{
class
MainActivity
:
AppCompatActivity
()
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_main
)
setContentView
(
R
.
layout
.
activity_main
)
// Toast.makeText(this,""+ Test.teststr,Toast.LENGTH_SHORT).show()
}
}
}
}
\ No newline at end of file
app/src/main/java/com/laihua/pushtestproject/MyApplication.kt
0 → 100644
View file @
1d4cc8d7
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
app/test_key.jks
0 → 100644
View file @
1d4cc8d7
File added
build.gradle
View file @
1d4cc8d7
...
@@ -4,13 +4,14 @@ buildscript {
...
@@ -4,13 +4,14 @@ buildscript {
repositories
{
repositories
{
google
()
google
()
mavenCentral
()
mavenCentral
()
maven
{
url
'https://developer.huawei.com/repo/'
}
}
}
dependencies
{
dependencies
{
classpath
"com.android.tools.build:gradle:4.2.1"
classpath
"com.android.tools.build:gradle:4.2.1"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
classpath
'com.huawei.agconnect:agcp:1.3.1.300'
// in the individual module build.gradle files
classpath
'com.huawei.agconnect:agcp:1.4.2.300'
}
}
}
}
...
@@ -18,10 +19,10 @@ allprojects {
...
@@ -18,10 +19,10 @@ allprojects {
repositories
{
repositories
{
google
()
google
()
mavenCentral
()
mavenCentral
()
jcenter
()
// Warning: this repository is going to shut down soon
maven
{
url
'https://developer.huawei.com/repo/'
}
}
}
}
}
task
clean
(
type:
Delete
)
{
task
clean
(
type:
Delete
)
{
delete
rootProject
.
buildDir
delete
rootProject
.
buildDir
}
}
\ No newline at end of file
push
@
67230ba3
Subproject commit
325f5aba902c2e9266e38c67c82e4bebf639ddd
4
Subproject commit
67230ba365669b46d69dcc126b970e2853f7f6b
4
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment