Commit 61bdb26b by 刘鹏

Merge remote-tracking branch 'origin/d/v4.4.05' into feat/lp/lp_sub_pay

# Conflicts:
#	config.gradle
parents e3843af7 a518e9b8
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.4'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.3'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.ydl.home.api">
</manifest>
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.3'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
......@@ -116,6 +116,8 @@ interface IUserService : IProvider {
* */
fun loginByOneKeyLogin(context: Context, isOpenDialog: Boolean) :Boolean
fun checkOneLoginEnvAvailable(): Boolean
/**
* 调用优先使用一键登录,并返回调用时的登录状态,
* @param isOpenDialog true:一键登录使用弹窗展示 false:一键登录使用全屏模式
......
......@@ -31,7 +31,6 @@ android {
flavorDimensions "versionCode"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
arguments = [AROUTER_MODULE_NAME: project.getName(), AROUTER_GENERATE_DOC: "enable"]
}
}
......@@ -178,6 +177,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.github.feeeei:CircleSeekbar:v1.1.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation(rootProject.ext.dependencies["appcompat-v7"])
testImplementation 'junit:junit:4.13.2'
......
......@@ -3,7 +3,7 @@ apply from: "config.gradle"
buildscript {
ext {
kotlin_version = '1.3.50'
kotlin_version = '1.6.10'
support_version = '26.1.0'
minSdkVersion = 21
targetSdkVersion = 28
......@@ -13,42 +13,45 @@ buildscript {
arouter_compiler = '1.2.2'
ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2'
componentVersion = "0.3.0.5-SNAPSHOT"
}
repositories {
maven {
url 'http://nexus.yidianling.com/repository/android/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
google()
mavenLocal()
// maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.ydl.plugins:modular:1.0.3'
classpath 'com.ydl:notracepoint-gradle-plugin:0.0.3'
}
}
allprojects {
allprojects { p ->
if (p.path.startsWith(":ydl-")) {
p.version = componentVersion
}
if (p.path.startsWith(":m-")) {
p.version = componentVersion
}
if (p.path.startsWith(":api:")) {
p.version = componentVersion
}
repositories {
//壹点灵android maven私服 开发版
maven {
url 'http://nexus.yidianling.com/repository/android/'
allowInsecureProtocol true
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
google()
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
allowInsecureProtocol true
}
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
mavenLocal()
}
}
......@@ -56,26 +59,6 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}
task packYdl1 {
doLast {
println("doLast packYdl1!!!!")
}
}
task packYdl2 {
doLast {
println("doLast packYdl2!!!!")
}
}
task packYdl {
doLast {
println("doLast packYdl!!!!")
}
}
task packM{
doLast {
println("doLast packM!!!!")
}
}
subprojects {
project.configurations.all {
......@@ -88,27 +71,3 @@ subprojects {
}
}
}
apply plugin: 'modular-plugin'
modular {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
repositories {
maven {
url 'http://nexus.yidianling.com/repository/AndroidReleases/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
}
}
ext {
dev_mode = false //组件发布的时候需要设置为false
ydl2PublishVersion = "0.3.0.4-lp"
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.50",
"m-consultant" : "0.0.60.78",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.72",
"m-home" : "0.0.24.09",
"m-im" : "0.0.21.69",
"m-dynamic" : "0.0.7.80",
"m-article" : "0.0.0.11",
"m-muse" : "0.0.28.87",
"m-tests" : "0.0.24.24",
"m-course" : "0.0.43.39",
//-------------- 功能组件 --------------
//mdt 组件
"ydl-tuicore" : "0.0.25",
//第一步
"ydl-platform" : "0.0.41.54",
//第二步 若干
"ydl-webview" : "0.2.0.7",
"ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.21",
"m-audioim" : "0.0.49.30.23",
"ydl-flutter-base": "0.0.14.44",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.12",
//-------------- 业务模块 API 层 --------------
"m-home-api" : "0.0.4.4",
]
ydl_app = [
appName : "壹点灵心理咨询",
applicationId: "com.cxzapp.yidianling",
......@@ -208,33 +172,9 @@ ext {
"ydl-hnet" : "com.ydl:h-net:0.0.8",
"ydl-user-router" : "com.ydl:router:1.0.0-SNAPSHOT@aar",
"ydl-device" : "com.ydl:device-id:0.0.31",
"ydl-net" : "com.ydl:ydl-net:${ydl2PublishVersion}",
"ydl-utils" : "com.ydl:ydl-utils:${ydl2PublishVersion}",
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydl2PublishVersion}", //组件化项目中的flutter base模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.51@aar", //flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号
"ydl-platform" : "com.ydl:ydl-platform:${ydl2PublishVersion}",
"ydl-tuicore" : "com.ydl:ydl-tuicore:${ydlPublishVersion["ydl-tuicore"]}",
//功能组件 <<--- 再发这些,发完改这里的版本号
"ydl-webview" : "com.ydl:ydl-webview:${ydl2PublishVersion}",
"ydl-media" : "com.ydl:ydl-media:${ydl2PublishVersion}",
"ydl-pay" : "com.ydl:ydl-pay:${ydl2PublishVersion}",
"m-audioim" : "com.ydl:m-audioim:${ydl2PublishVersion}",
//业务组件 <<--- 最后发这些(只发改过的)
"ydl-m-user-api" : "com.ydl:m-user-api:1.0.0",
"ydl-m-fm-api" : "com.ydl:m-fm-api:1.0.0",
"ydl-m-tests-api" : "com.ydl:m-tests-api:1.0.0",
"ydl-m-im-api" : "com.ydl:m-im-api:1.0.3",
"ydl-m-home-api" : "com.ydl:m-home-api:${ydlPublishVersion["m-home-api"]}",
"ydl-m-consultant-api" : "com.ydl:m-consultant-api:1.0.3",
"ydl-m-dynamic-api" : "com.ydl:m-dynamic-api:1.0.0",
"ydl-m-confide-api" : "com.ydl:m-confide-api:1.0.4",
"ydl-m-course-api" : "com.ydl:m-course-api:1.0.0",
]
}
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from : '../maven_push.gradle'
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -44,7 +44,7 @@ android {
}
dependencies {
api fileTree(dir: 'libs', include: ['*.aar','*.jar'])
api fileTree(dir: 'libs', include: ['*.aar', '*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
......@@ -59,17 +59,7 @@ dependencies {
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(':ydl-flutter-base')
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
implementation rootProject.ext.dependencies["ydl-flutter-base"]
}
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(':ydl-flutter-base')
}
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -71,19 +71,8 @@ dependencies {
api "com.ydl:ydl-av:1.4.4"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-platform')
api project(':ydl-webview')
implementation project(":api:user")
implementation project(":api:im")
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-webview"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
api project(':ydl-platform')
api project(':ydl-webview')
implementation project(":api:user")
implementation project(":api:im")
}
......@@ -48,6 +48,7 @@ import com.ydl.ydl_av.voice.listener.IYDLVoiceEventHandler
import com.ydl.ydl_av.voice.manager.YDLVoiceManager
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.app.Apm
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService
......@@ -318,6 +319,7 @@ class AudioHomeActivity :
if (err == 0 || err == 18) {
return
}
Apm.reportEvent("agora_android", "occur_error", "$err")
channelId?.let { YDLavManager.instances.callEndStatusUpdate(it, 4, "频道的错误回调信息$err") }
}
......@@ -369,8 +371,8 @@ class AudioHomeActivity :
override fun onRtcStats(stats: IRtcEngineEventHandler.RtcStats?) {
super.onRtcStats(stats)
writeAgoraLog("声网onRtcStats:users:${stats?.users}")
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "声网onRtcStats:users:${stats?.users} channelId:${channelId}")
// AliYunRichLogsHelper.getInstance()
// .sendRichLog(AliYunLogConfig.AGORA, "声网onRtcStats:users:${stats?.users} channelId:${channelId}")
// 不需要移动端做离开房间逻辑,服务端会判断进行踢人逻辑
//因为用户端直接加入了频道,防止该回调执行时,专家还未加入频道,因此在连接成功之后,才进行频道人数判断
// if (isConnectSuccess && null != stats?.users && stats.users == 1) {
......@@ -388,6 +390,7 @@ class AudioHomeActivity :
override fun onConnectionStateChanged(state: Int, reason: Int) {
super.onConnectionStateChanged(state, reason)
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
Apm.reportEvent("agora_android", "rtc_connection_failure", "$state,$reason")
if (reason == 3) {
callEventSave("50", "通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason}")
writeAgoraLog("通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})")
......
......@@ -166,7 +166,7 @@ class YDLavManager {
LogUtil.e("[agora]呼叫${response?.calleeId}用户失败:${response?.response}")
AliYunRichLogsHelper.getInstance().sendRichLog(
AliYunLogConfig.AGORA,
"呼叫${response?.calleeId}用户失败:${response?.response}"
"呼叫${response?.calleeId}用户失败:${response?.response},${errorCode}"
)
val dimension = hashMapOf(
"call" to "call_fail",
......@@ -432,7 +432,7 @@ class YDLavManager {
override fun onFailure(msg: String?) {
if (msg != "LOGIN_ERR_ALREADY_LOGGED_IN") {
Apm.reportCustom("agora_login_error", msg ?: "", Exception(msg))
Apm.reportEvent("rtm_android", "connectionstate_error", msg ?: "")
}
LogUtil.e("[agora]实时消息登录失败:$msg")
writeAgoraLog(
......@@ -449,6 +449,7 @@ class YDLavManager {
}
})
} else {
Apm.reportEvent("rtm_android", "login_failure", "${it.code},${it.msg}")
LogUtil.e("声网token获取失败uid:" + userId + " error:" + it.msg)
LogHelper.getInstance()
.writeLogSync("声网token获取失败uid:" + userId + " error:" + it.msg)
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from : '../maven_push.gradle'
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -69,30 +69,14 @@ dependencies {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-media')
api project(':ydl-platform')
api project(':m-audioim')
api project(":ydl-pay")
api project(':ydl-webview')
api project(':ydl-utils')
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:consultant")
implementation project(':api:confide')
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-media"]
api rootProject.ext.dependencies["m-audioim"]
api rootProject.ext.dependencies["ydl-pay"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
}
api project(':ydl-media')
api project(':ydl-platform')
api project(':m-audioim')
api project(":ydl-pay")
api project(':ydl-webview')
api project(':ydl-utils')
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:consultant")
implementation project(':api:confide')
}
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -50,23 +50,11 @@ dependencies {
implementation(rootProject.ext.dependencies["ydl-ijkplayer-jjdxm"]) {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
if (rootProject.ext.dev_mode){
//开发时使用
implementation project(":api:user")
implementation project(":api:im")
implementation modularPublication('com.ydl:m-home-api')
implementation project(":api:consultant")
api project(":ydl-webview")
api project(":ydl-platform")
} else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-home-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
implementation project(":api:user")
implementation project(":api:im")
implementation project(":api:home")
implementation project(":api:consultant")
api project(":ydl-webview")
api project(":ydl-platform")
}
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......@@ -51,35 +51,15 @@ dependencies {
api rootProject.ext.dependencies["ydl-user-router"]
compileOnly "com.ydl.aar:resource:0.0.1-ydl"
if (rootProject.ext.dev_mode){
//开发时使用
implementation project(":api:consultant")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:course")
api project(":ydl-webview")
api project(":ydl-platform")
api project(":ydl-media")
api project(":ydl-pay")
implementation project(':ydl-flutter-base')
} else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies['ydl-m-consultant-api']
compileOnly rootProject.ext.dependencies['ydl-m-course-api']
// compileOnlyrootProject.ext.dependencies['com.ydl:m-consultant-api']
api rootProject.ext.dependencies["ydl-webview"]
api (rootProject.ext.dependencies["ydl-media"]){
transitive = true
}
api rootProject.ext.dependencies["ydl-pay"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
implementation project(":api:consultant")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:course")
api project(":ydl-webview")
api project(":ydl-platform")
api project(":ydl-media")
api project(":ydl-pay")
implementation project(':ydl-flutter-base')
implementation rootProject.ext.dependencies["ydl-flutter-base"]
}
}
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from : '../maven_push.gradle'
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -72,33 +72,16 @@ dependencies {
implementation 'com.daimajia.numberprogressbar:library:1.4@aar'
implementation 'me.toptas.fancyshowcase:fancyshowcaseview:1.1.5'
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
api project(":ydl-pay")
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:tests")
implementation project(":api:course")
implementation project(":api:fm")
implementation project(":api:consultant")
implementation project(':api:confide')
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-pay"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
compileOnly rootProject.ext.dependencies["ydl-m-course-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
api project(':ydl-webview')
api project(':ydl-platform')
api project(":ydl-pay")
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:tests")
implementation project(":api:course")
implementation project(":api:fm")
implementation project(":api:consultant")
implementation project(':api:confide')
}
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from : '../maven_push.gradle'
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -51,22 +51,11 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(":ydl-platform")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:fm")
implementation project(':ydl-media')
} else {
//发布时使用
implementation rootProject.ext.dependencies["ydl-media"]
implementation rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
implementation (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
api project(":ydl-platform")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:fm")
implementation project(':ydl-media')
}
......@@ -3,6 +3,8 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from: "../publish.gradle"
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
......@@ -62,37 +64,20 @@ dependencies {
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api "com.airbnb.android:lottie:3.4.0"
api(rootProject.ext.dependencies["ydl-device"])
implementation "com.alibaba:arouter-api:$arouter_api"
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
implementation rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
implementation project(":api:consultant")
implementation project(":api:user")
implementation project(":api:tests")
implementation modularPublication('com.ydl:m-home-api')
implementation project(":api:im")
implementation project(':api:confide')
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(":ydl-platform")
} else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-home-api"]
compileOnly rootProject.ext.dependencies['ydl-m-tests-api']
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
api rootProject.ext.dependencies["ydl-webview"]
api rootProject.ext.dependencies["ydl-media"]
api rootProject.ext.dependencies["ydl-media"]
}
implementation project(":api:consultant")
implementation project(":api:user")
implementation project(":api:tests")
implementation project(":api:home")
implementation project(":api:im")
implementation project(':api:confide')
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(":ydl-platform")
}
modular {
//模块包名
packageName "com.yidianling.home"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-home-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-home-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
// 壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-home-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -63,31 +63,20 @@ dependencies {
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"]
api 'com.tencent.tbs.tbssdk:sdk:43903'
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:tests")
implementation project(":api:course")
implementation project(":api:fm")
implementation project(":api:consultant")
implementation project(':api:confide')
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
compileOnly rootProject.ext.dependencies["ydl-m-course-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
implementation('com.netease.yunxin.kit:call-ui:1.5.9-SNAPSHOT') {
exclude group: "com.netease.nimlib", module: "avsignalling"
exclude group: "com.netease.nimlib", module: "basesdk"
}
implementation "com.netease.nimlib:avsignalling:9.1.1"
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:tests")
implementation project(":api:course")
implementation project(":api:fm")
implementation project(":api:consultant")
implementation project(':api:confide')
}
......@@ -10,6 +10,7 @@ import androidx.annotation.DrawableRes;
import com.alibaba.fastjson.JSON;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.SDKOptions;
import com.netease.nimlib.sdk.auth.LoginInfo;
import com.netease.nimlib.sdk.mixpush.MixPushMessageHandler;
import com.netease.nimlib.sdk.mixpush.NIMPushClient;
......@@ -42,6 +43,7 @@ import de.greenrobot.event.EventBus;
public class NimApplication {
private String appKey;
private NimApplication() {
}
......@@ -54,10 +56,16 @@ public class NimApplication {
return InstanceHolder.nimApplication;
}
public String getAppKey() {
return appKey;
}
public void initIm(Application app, Class activity, IMInitConfigBean configBean) {
IMCache.setContext(app);
// 初始化云信SDK
NIMClient.init(app, loginInfo(), NimSDKOptionConfig.prepareSDKOptions(app,activity,configBean));
SDKOptions sdkOptions = NimSDKOptionConfig.prepareSDKOptions(app, activity, configBean);
appKey = sdkOptions.appKey;
NIMClient.init(app, loginInfo(), sdkOptions);
// 以下逻辑只在主进程初始化时执行
if (NIMUtil.isMainProcess(app)) {
......
......@@ -31,7 +31,7 @@ import java.io.IOException;
* 云信sdk 自定义的SDK选项设置
*/
class NimSDKOptionConfig {
public class NimSDKOptionConfig {
static SDKOptions prepareSDKOptions(Context context, Class activity, IMInitConfigBean configBean) {
SDKOptions options = new SDKOptions();
......@@ -82,7 +82,9 @@ class NimSDKOptionConfig {
options.shouldConsiderRevokedMessageUnreadCount = true;
options.mixPushConfig = buildMixPushConfig(configBean);
//https://faq.yunxin.163.com/kb/main/#/item/KB0373
//disableAwake为true来禁止后台进程唤醒UI进程。
options.disableAwake = true;
return options;
}
......@@ -91,7 +93,7 @@ class NimSDKOptionConfig {
* 配置 APP 保存图片/语音/文件/log等数据的目录
* 这里示例用SD卡的应用扩展存储目录
*/
static String getAppCacheDir(Context context) {
public static String getAppCacheDir(Context context) {
String storageRootPath = null;
try {
// SD卡应用扩展存储区(APP卸载后,该目录下被清除,用户也可以在设置界面中手动清除),请根据APP对数据缓存的重要性及生命周期来决定是否采用此缓存目录.
......
......@@ -17,6 +17,7 @@ import com.netease.nimlib.sdk.msg.model.IMMessage
import com.netease.nimlib.sdk.msg.model.RevokeMsgNotification
import com.netease.nimlib.sdk.team.TeamServiceObserver
import com.netease.nimlib.sdk.team.model.Team
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.utils.LogUtil
import com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack
import com.yidianling.im.api.event.AccountChangeEvent
......@@ -91,6 +92,9 @@ class ImObserversHelper {
if (code.wontAutoLoginForever()) {
EventBus.getDefault().post(AccountChangeEvent(1))
}
if (code == StatusCode.LOGINED) {
NimUICallInit.initNim2(BaseApp.getApp())
}
}
private var messageRevokeObserver: Observer<RevokeMsgNotification> = NimMessageRevokeObserver()
......
......@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
import com.yidianling.im.session.extension.CustomAttachmentFilter;
import com.yidianling.nimbase.common.ToastHelper;
import com.netease.nimlib.sdk.NIMClient;
......@@ -120,6 +121,9 @@ public class NIMInitManager{
return true;
}
}
if(message.getMsgType() == MsgTypeEnum.nrtc_netcall){
return true;
}
return false;
}
});
......
package com.yidianling.im.helper;
import android.annotation.SuppressLint;
import android.content.Context;
import android.text.TextUtils;
import com.netease.lava.nertc.sdk.NERtcEx;
import com.netease.lava.nertc.sdk.NERtcOption;
import com.netease.lava.nertc.sdk.video.NERtcEncodeConfig;
import com.netease.lava.nertc.sdk.video.NERtcVideoConfig;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.yunxin.nertc.nertcvideocall.bean.InvitedInfo;
import com.netease.yunxin.nertc.ui.CallKitNotificationConfig;
import com.netease.yunxin.nertc.ui.CallKitUI;
import com.netease.yunxin.nertc.ui.CallKitUIOptions;
import com.netease.yunxin.nertc.ui.extension.SelfConfigExtension;
import com.netease.yunxin.nertc.ui.service.DefaultIncomingCallEx;
import com.ydl.ydlcommon.modular.ModularServiceManagerKt;
import com.ydl.ydlcommon.utils.log.XLog;
import com.yidianling.im.R;
import com.yidianling.im.config.NimApplication;
import com.yidianling.im.config.NimSDKOptionConfig;
import com.yidianling.im.http.ImHttpImpl;
import com.yidianling.user.api.bean.UserResponseBean;
import com.yidianling.user.api.service.IUserService;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.Map;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
public class NimUICallInit {
private static boolean hasReportSupportLine = false;
private static String curChannelName;
public static void initNim2(Context context) {
UserResponseBean.UserInfo userInfo = ModularServiceManagerKt.findRouteService(IUserService.class).getUserInfo();
if (userInfo == null) return;
String userId = userInfo.getUid();
android.util.Log.e("qwert", userId);
String appKey = NimApplication.getInstance().getAppKey();
CallKitUIOptions options = new CallKitUIOptions.Builder()
// 必要:音视频通话 sdk appKey,用于通话中使用
.rtcAppKey(appKey)
.logRootPath(NimSDKOptionConfig.getAppCacheDir(context) + "/yidianling")
// 必要:当前用户 AccId
.currentUserAccId(userId)
.currentUserRtcUId(Long.parseLong(userId))
// 通话接听成功的超时时间单位 毫秒,默认30s
.timeOutMillisecond(30 * 1000L)
.rtcCallExtension(new SelfConfigExtension(){
@Override
public void configVideoConfig() {
NERtcVideoConfig videoConfig = new NERtcVideoConfig();
videoConfig.frameRate = NERtcEncodeConfig.NERtcVideoFrameRate.FRAME_RATE_FPS_15;
videoConfig.bitrate = 600;
videoConfig.width = 640;
videoConfig.height = 480;
NERtcEx.getInstance().setLocalVideoConfig(videoConfig);
}
})
// 此处为 收到来电时展示的 notification 相关配置,如图标,提示语等。
.notificationConfigFetcher(invitedInfo -> new CallKitNotificationConfig(R.drawable.avchat_imcoming_call))
// 收到被叫时若 app 在后台,在恢复到前台时是否自动唤起被叫页面,默认为 true
.resumeBGInvitation(true)
.incomingCallEx(new DefaultIncomingCallEx() {
@Override
public boolean onIncomingCall(@NotNull InvitedInfo invitedInfo) {
XLog.INSTANCE.i("incomingCallEx", invitedInfo.toString());
curChannelName = invitedInfo.channelName;
return super.onIncomingCall(invitedInfo);
}
})
.enableOrder(false)
// .p2pAudioActivity(TestActivity.class)
// .p2pVideoActivity(TestActivity.class)
// 请求 rtc token 服务,若非安全模式则不需设置
.rtcTokenService((uid, callback) -> requestRtcToken(uid, callback)) // 自己实现的 token 请求方法
// 设置初始化 rtc sdk 相关配置,按照所需进行配置
.rtcSdkOption(new NERtcOption())
// 呼叫组件初始化 rtc 范围,true-全局初始化,false-每次通话进行初始化以及销毁
// 全局初始化有助于更快进入首帧页面,当结合其他组件使用时存在rtc初始化冲突可设置false
.rtcInitScope(true)
.build();
// 若重复初始化会销毁之前的初始化实例,重新初始化
CallKitUI.init(context.getApplicationContext(), options);
}
@SuppressLint("CheckResult")
private static void requestRtcToken(long uid, RequestCallback<String> callback) {
Map<String, String> body = new HashMap<>();
if (curChannelName != null) {
body.put("channelName", curChannelName);
}
body.put("uid", String.valueOf(uid));
ImHttpImpl.Companion.getInstance().getImApi().nim2Token(body)
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe(resp -> {
curChannelName = null;
if (resp.code == 200) {
callback.onSuccess(resp.data);
} else {
XLog.INSTANCE.i("requestRtcToken", resp.msg);
callback.onFailed(resp.code);
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
curChannelName = null;
callback.onException(throwable);
}
});
}
@SuppressLint("CheckResult")
public static void reportSupportLine() {
if (hasReportSupportLine) return;
Map<String, Object> report = new HashMap<>();
report.put("callKeys", new String[]{"netease_app2"});//支持云信2.0呼叫通话
ImHttpImpl.Companion.getInstance().getImApi()
.reportSupportLine(report)
.subscribeOn(Schedulers.io())
.subscribe(resp -> {
if (TextUtils.equals(resp.code, "200")) {
hasReportSupportLine = true;
}
});
}
}
......@@ -5,8 +5,12 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.im.api.bean.*
import com.yidianling.im.bean.*
import com.yidianling.im.api.bean.IMExpertBuild
import com.yidianling.im.api.bean.MsgDetail
import com.yidianling.im.api.bean.UpdateStatusBean
import com.yidianling.im.bean.MsgData
import com.yidianling.im.bean.MsgHome
import com.yidianling.im.bean.SystemMsgBean
import com.yidianling.im.ui.page.fragment.bean.ChatModelBean
import com.yidianling.im.ui.page.fragment.bean.InteractBean
import com.yidianling.im.ui.page.fragment.bean.NoticeItemBean
......@@ -21,6 +25,14 @@ import retrofit2.http.*
*/
interface ImApi {
@POST("call/v2/dial/yunxin")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun nim2Token(@Body body: Map<String, String>): Observable<BaseResponse<String?>>
@POST("counselor/device/callline")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun reportSupportLine(@Body body: Map<String, @JvmSuppressWildcards Any>): Observable<BaseAPIResponse<Any?>>
//获得消息列表
@FormUrlEncoded
@POST("sms/list")
......
......@@ -41,7 +41,7 @@ class ImHttpImpl private constructor() : ImHttp {
private var imApi: ImApi? = null
private var imJavaApi: ImApi? = null
private fun getImApi(): ImApi {
fun getImApi(): ImApi {
if (imApi == null) {
imApi = YDLHttpUtils.obtainApi(ImApi::class.java)
}
......
......@@ -27,6 +27,7 @@ import com.yidianling.fm.api.service.IFMService
import com.yidianling.im.api.bean.ReceiveRedPacketParam
import com.yidianling.im.api.service.IImService
import com.yidianling.im.config.constants.UserPreferences
import com.yidianling.im.helper.NimUICallInit
import com.yidianling.im.preference.IMCache
import com.yidianling.tests.api.service.ITestsApiService
import com.yidianling.uikit.api.NimUIKit
......@@ -202,6 +203,8 @@ object ImIn {
IMCache.setAccount(uid)
//此代码进行登录,并且会进行回调
NimUIKit.login(info, callback);
NimUICallInit.reportSupportLine()//登录nim时上报支持的线路
}
fun loginIm(uid : String,pwd : String,callback: RequestCallback<LoginInfo>){
......
......@@ -345,12 +345,12 @@ public class WatchMessagePictureActivity extends UI {
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + i);
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + throwable.getMessage());
}
});
}
......
......@@ -509,12 +509,12 @@ public class WatchVideoActivity extends UI implements Callback {
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + i);
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + throwable.getMessage());
}
});
downloading = true;
......
......@@ -1367,7 +1367,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
public void onFailed(int code) {
if (msg != null) {
sendFailWithBlackList(code, msg);
Apm.INSTANCE.reportCustom("yx_sendmessage_error", "sessionId:" + msg.getSessionId(), new Exception(String.valueOf(code)));
Apm.INSTANCE.reportEvent("yxim_android", "sendmessage_error", " 云信IM发送消息失败" + code + msg);
}
}
......
......@@ -849,12 +849,12 @@ public class MessageListPanelEx {
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + i);
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + throwable.getMessage());;
}
});
}
......@@ -1163,8 +1163,7 @@ public class MessageListPanelEx {
@Override
public void onFailed(int code) {
String sessionId = item.getSessionId();
Apm.INSTANCE.reportCustom("yx_revoke_error", "sessionId:" + sessionId, new Exception(String.valueOf(code)));
Apm.INSTANCE.reportEvent("yxim_android", "revoke_error", "云信IM回撤消息失败" + code);
if (code == ResponseCode.RES_OVERDUE) {
ToastHelper.showToast(container.activity, R.string.im_revoke_failed);
} else {
......
......@@ -82,12 +82,12 @@ public class MsgViewHolderAudio extends MsgViewHolderBase {
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + i);
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + throwable.getMessage());
}
});
......
......@@ -151,12 +151,12 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + i);
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + throwable.getMessage());
}
});
}
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from : '../maven_push.gradle'
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -56,25 +56,10 @@ dependencies {
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
if (rootProject.ext.dev_mode){
//开发时使用
api project(":ydl-platform")
implementation project(':ydl-media')
implementation project(":api:user")
implementation project(':ydl-flutter-base')
implementation project(':ydl-webview')
api project(":ydl-platform")
implementation project(':ydl-media')
implementation project(":api:user")
implementation project(':ydl-flutter-base')
implementation project(':ydl-webview')
} else {
//发布时使用
api rootProject.ext.dependencies["ydl-media"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
api (rootProject.ext.dependencies["ydl-webview"]){
transitive = true
}
api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
implementation rootProject.ext.dependencies["ydl-flutter-base"]
}
}
......@@ -26,7 +26,5 @@
android:screenOrientation="portrait"
android:theme="@style/un_full_screen_activity"/>
<service android:name=".service.MeditationWindowService"/>
</application>
</manifest>
......@@ -453,7 +453,7 @@ class PlayMeditationActivity : BaseActivity() {
meditation = currentMeditation?.copy(
meditationType = mMeditationType, meditationId =
mMeditationId ?: 0
)
),meditations = meditations
)
EventBus.getDefault().post(event)
......@@ -1070,7 +1070,7 @@ class PlayMeditationActivity : BaseActivity() {
}
override fun onBackPressed() {
val event = MeditationFloatEvent(true, meditation = currentMeditation)
val event = MeditationFloatEvent(true, meditation = currentMeditation,meditations = meditations)
EventBus.getDefault().post(event)
super.onBackPressed()
}
......
......@@ -7,6 +7,6 @@ class MeditationFloatEvent(
val stop: Boolean? = null,
val time: Long? = null,
val meditation: MeditationPlayModuleBean.MeditationDetail? = null,
val meditations: ArrayList<MeditationPlayModuleBean.MeditationDetail>? = null
val meditations: MutableList<MeditationPlayModuleBean.MeditationDetail>? = null
)
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -42,27 +42,12 @@ dependencies {
compileOnly "com.ydl.aar:resource:0.0.1-ydl"
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(':ydl-flutter-base')
implementation project(":api:tests")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:im")
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
implementation rootProject.ext.dependencies["ydl-flutter-base"]
}
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(':ydl-flutter-base')
implementation project(":api:tests")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:im")
}
\ No newline at end of file
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -45,42 +45,23 @@ android {
}
dependencies {
api fileTree(dir: 'libs', include: ['*.aar','*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.annotation:annotation:1.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.ydl.aar:phonenumber-authsdk:2.11.1.1'
kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.ydl.aar:resource:0.0.1-ydl"
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
api project(":ydl-pay")
api project(':ydl-webview')
api project(':ydl-platform')
api project(":ydl-pay")
// implementation project(":ydl-tuicore")
implementation project(":api:user")
implementation project(":api:course")
implementation project(":api:im")
implementation project(":api:fm")
implementation project(":api:dynamic")
implementation project(":api:consultant")
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies['ydl-m-course-api']
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies['ydl-m-consultant-api']
api rootProject.ext.dependencies["ydl-webview"]
api rootProject.ext.dependencies["ydl-pay"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
// implementation rootProject.ext.dependencies["ydl-tuicore"]
}
implementation project(":api:user")
implementation project(":api:course")
implementation project(":api:im")
implementation project(":api:fm")
implementation project(":api:dynamic")
implementation project(":api:consultant")
}
......@@ -4,8 +4,8 @@ import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.content.Intent
import androidx.fragment.app.Fragment
import android.text.TextUtils
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.bean.VersionData
......@@ -319,6 +319,10 @@ public class UserServiceImp : IUserService {
return OneKeyLoginHelp.startLoginByStatus(context,isOpenDialog)
}
override fun checkOneLoginEnvAvailable(): Boolean {
return OneKeyLoginHelp.mPhoneNumberAuthHelper!!.checkEnvAvailable()
}
override fun loginByOneKeyLoginCallBack(
context: Context,
isOpenDialog: Boolean,
......
......@@ -73,7 +73,7 @@ class LoginObservable(val activity: Activity, private val media: SHARE_MEDIA): O
}
override fun onError(p0: SHARE_MEDIA?, p1: Int, p2: Throwable?) {
Apm.reportCustom("login", "third_auth_error", p2 ?: Exception("${p0},$p1"))
Apm.reportEvent("login_android", "third_auth_error", "三方授权失败${p2?.message ?: p1}")
observer?.onError(p2?:Throwable("未知异常"))
}
......
......@@ -507,7 +507,7 @@ object OneKeyLoginHelp {
"一键登录失败 msg:${it.msg}"
)
ToastUtil.toastShort(it.msg)
Apm.reportCustom("login", "oneKey_error", Exception("${it.code},${it.msg}"))
Apm.reportEvent("login_android", "oneKey_error", "一键登录失败报错${it.code},${it.msg}")
mPhoneNumberAuthHelper?.hideLoginLoading()
}
}, {
......@@ -515,7 +515,7 @@ object OneKeyLoginHelp {
AliYunLogConfig.LOGIN,
"一键登录Error msg:${it.message}"
)
Apm.reportCustom("login", "oneKey_error", it)
Apm.reportEvent("login_android", "oneKey_error", "一键登录失败报错${it.message}")
ToastUtil.toastShort(it.message)
mPhoneNumberAuthHelper?.hideLoginLoading()
})
......@@ -527,7 +527,7 @@ object OneKeyLoginHelp {
}
override fun onTokenFailed(s: String) {
Apm.reportCustom("login", "oneKey_error", Exception("TokenFailed:${s}"))
Apm.reportEvent("login_android", "oneKey_error", "一键登录失败TokenFailed:${s}")
LogUtil.e("onTokenFailed"+s)
mIsGetTokenSuccess = false
val tokenRet = TokenRet.fromJson(s)
......
......@@ -115,12 +115,12 @@ class InputPassWordPresenterImpl :
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.LOGIN, "手机号密码 登录失败 msg: ${it.msg}")
ToastUtil.toastShort(it.msg)
Apm.reportCustom("login", "password_error", Exception("密码登录失败,$phoneCountryCode-$phone"))
Apm.reportEvent("login_android", "password_error", "密码登录失败,$phoneCountryCode-$phone")
mView.startAnim()
} else {
if (it.data.userInfo?.user_type == 2) {
mView.showNormalDialog()
Apm.reportCustom("login", "isexpert", Exception("登录—专家帐号,$phoneCountryCode-$phone"))
Apm.reportEvent("login_android", "isexpert", "登录—专家帐号,$phoneCountryCode-$phone")
} else {
saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册
......@@ -140,7 +140,7 @@ class InputPassWordPresenterImpl :
}
}, {
YdlCommonOut.showToast(it.message!!)
Apm.reportCustom("login", "password_error", it)
Apm.reportEvent("login_android", "password_error", "密码登录失败${it.message}")
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.LOGIN, "手机号密码 Error msg: ${it.message}")
......
......@@ -168,7 +168,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
if (it.data.isRegistered == 1) {
mView.showLoading(false)
mView.showHasBindedDialog()
Apm.reportCustom("login", "mobile_isbind", Exception("登录-手机被绑定,$countryCode-$phone"))
Apm.reportEvent("login_android", "mobile_isbind", "登录-手机被绑定,$countryCode-$phone")
} else {
mView.checkPhoneStatusSuccess(it.data, phone)
}
......@@ -176,7 +176,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
if (it.data.isDoctor == 1) {//是专家账号
mView.showLoading(false)
mView.showNormalDialog()
Apm.reportCustom("login", "isexpert", Exception("登录—专家帐号,$countryCode-$phone"))
Apm.reportEvent("login_android", "isexpert", "登录—专家帐号,$countryCode-$phone")
} else {
mView.checkPhoneStatusSuccess(it.data, phone)
}
......@@ -214,7 +214,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
.subscribe({
mView.dismissProgressView()
if (it?.data == null) {
Apm.reportCustom("login", "third_login_error", Exception("${it.code},${it.msg}"))
Apm.reportEvent("login_android", "third_login_error", "三方登录失败${it.code},${it.msg}")
ToastUtil.toastShort(it.msg)
return@subscribe
}
......@@ -268,7 +268,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
}, {
mView.dismissProgressView()
Apm.reportCustom("login", "third_login_error", it)
Apm.reportEvent("login", "third_login_error", it.message ?: "")
YdlCommonOut.showToast(it.message!!)
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.LOGIN, media.getName() + "登录失败")
......
......@@ -47,12 +47,12 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
mView.startCountdown(60)
} else {
mView.startAnim()
Apm.reportCustom("login", "getcode_error", Exception("${phone},${it.code},${it.msg}"))
Apm.reportEvent("login_android", "getcode_error", "获取验证码失败${phone},${it.code},${it.msg}")
ToastUtil.toastShort(it.msg)
}
}, {
mView.startAnim()
Apm.reportCustom("login", "getcode_error", it)
Apm.reportEvent("login", "getcode_error", "获取验证码失败${it.message}")
ToastUtil.toastShort(it.message)
})
}
......@@ -115,13 +115,13 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
} else {
ToastUtil.toastShort(it.msg)//服务端返回{验证码错误&异常}信息
// mView.startAnim()
Apm.reportCustom("login", "bind_mobile_error", Exception("${param.countryCode}-${param.phoneNumber},${it.code},${it.msg}"))
Apm.reportEvent("login_android", "bind_mobile_error", " 手机号绑定失败${param.countryCode}-${param.phoneNumber},${it.code},${it.msg}")
mView.verificationErrorCode()
}
}, {
// mView.startAnim()
mView.verificationErrorCode()
Apm.reportCustom("login", "bind_mobile_error", it)
Apm.reportEvent("login_android", "bind_mobile_error", " 手机号绑定失败${param.countryCode}-${param.phoneNumber},${it.message}")
ToastUtil.toastShort(it.message)
})
......@@ -193,12 +193,12 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
} else {
ToastUtil.toastShort(it.msg)//服务端返回{验证码错误&异常}信息
// mView.startAnim()
Apm.reportCustom("login", "code_error", Exception("${phoneCountryCode}-${phone},${it.code},${it.msg}"))
Apm.reportEvent("login_android", "code_error", "验证码登录失败${phoneCountryCode}-${phone},${it.code},${it.msg}")
mView.verificationErrorCode()
}
}, {
mView.startAnim()
Apm.reportCustom("login", "code_error", it)
Apm.reportEvent("login", "code_error", it.message ?: "")
ToastUtil.toastShort(it.message)
})
}
......
apply plugin: 'maven'
def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
def mavenRepositoryUrl2 = "http://nexus.yidianling.com/repository/AndroidSnapshots/"
def getVersionName() {
def publishVersion = rootProject.ext.ydl2PublishVersion
return publishVersion
}
def isLocal(){
Properties properties = new Properties()
InputStream inputStream = project.rootProject.file('local.properties').newDataInputStream()
properties.load(inputStream)
def local = properties.getProperty("packageLocal")
return local
}
task sourceJar(type:Jar){
classifier = 'source'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives sourceJar
}
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
pom.artifactId = project.getName().replace('_', "-")
pom.groupId = "com.ydl"
pom.version = getVersionName()
def local = isLocal()
if (local == "true") {
repository(url: mavenLocal().url)
} else if (local == "false") {
def snapshot = getVersionName().endsWith("-SNAPSHOT")
repository(url: snapshot ? mavenRepositoryUrl2 : mavenRepositoryUrl) {
authentication(userName: "admin", password: "fjoi#1+#@")
}
} else {
println("请在local.properties中指定packageLocal的值[true|false]")
}
}
}
}
uploadArchives.doFirst {
// log
println String.format(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n>>>>> [%s] 正在将[%s]版本的[%s]包上传到Maven的[%s]仓库 >>>>>\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
, project.getName()
, getVersionName()
, "aar"
, "packageLocal:" + isLocal()
)
}
// rootProject.getTasksByName("aa",false).forEach{println(it)}
//pay依赖platform,platform依赖utils和net
//confide依赖audioim
if (project.name.startsWith("ydl")) {
if (project.name == "ydl-utils" || project.name == "ydl-net") {
rootProject.getTasksByName("packYdl1", false).forEach { it.dependsOn(uploadArchives) }
}
if (project.name == "ydl-platform") {
rootProject.getTasksByName("packYdl2", false).forEach { it.dependsOn(uploadArchives) }
}
rootProject.getTasksByName("packYdl", false).forEach { it.dependsOn(uploadArchives) }
} else {
if (project.name != "m-audioim") {
rootProject.getTasksByName("packM", false).forEach { it.dependsOn(uploadArchives) }
}
}
}
\ No newline at end of file
apply plugin: 'maven'
def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
def getVersionName() {
return hasProperty('VERSION_NAME') ? VERSION_NAME : rootProject.ext.ydlPublishVersion[project.getName()]
}
task sourceJar(type:Jar){
classifier = 'source'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives sourceJar
}
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
pom.artifactId = "m-" + project.name + "-api"
pom.groupId = "com.ydl"
pom.version = project.version
repository(url: mavenRepositoryUrl) {
authentication(userName: "admin", password: "fjoi#1+#@")
}
// repository(url:mavenLocal().url)
}
}
}
uploadArchives.doFirst {
// log
println String.format(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n>>>>> [%s] 正在将[%s]版本的[%s]包上传到Maven的[%s]仓库 >>>>>\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
, project.getName()
, project.version
, "aar"
, "release"
)
}
}
\ No newline at end of file
apply plugin: 'maven-publish'
def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
def mavenRepositoryUrl2 = "http://nexus.yidianling.com/repository/AndroidSnapshots/"
def sourceJar(String name, String path, String ext) {
return project.tasks.create("source${name.capitalize()}Jar", Jar) {
group = "publishing"
description = "package ${name} source to jar"
from "$path/src/main/java"
from "$path/src/main/kotlin"
if (!ext.isEmpty()) {
from "$path/src/${ext}/java"
}
destinationDir = file("$path/build/libs/")
classifier = 'sources'
}
}
def setScm(scm) {
// scm.appendNode('connection', "https://github.com/${System.getenv("GITHUB_ACTOR")}/Shadow.git")
//
// def commit
// if ("${System.env.CI}".equalsIgnoreCase("true")) {
// commit = System.getenv("GITHUB_SHA")
// } else {
// commit = gitShortRev()
// }
// scm.appendNode('url', "https://github.com/${System.getenv("GITHUB_ACTOR")}/Shadow/commit/$commit")
}
def checkPomVersion = {
def root = asNode()
def dependencyNodes = root.get('dependencies')
for (def dependency : dependencyNodes) {
def children = dependency.children()
for (def child : children) {
def versionNode = child.get("version").first()
def version = versionNode.value().first()
def groupId = child.get("groupId").first().value().first()
def artifactId = child.get("artifactId").first().value().first()
def scope = child.get("scope").first().value().first()
println "$scope $groupId:$artifactId:$version"
if (version == "unspecified") {
throw new IllegalStateException("版本检查出错了!")
}
}
}
}
def multiComponent = [':m-home', ':ydl-resource']
afterEvaluate {
def pVersion = ''
if (project.version == "unspecified") {
throw new IllegalStateException("请指定${project.name}的Version")
} else {
pVersion = project.version
}
def isApiModule = project.path.startsWith(":api:")
publishing {
publications {
if (multiComponent.contains(project.path)) {
ydlComponent(MavenPublication) {
group 'com.ydl'
version "ydl-" + pVersion
from components.ydlRelease
artifact sourceJar(getName(), "${project.projectDir}", "ydl")
pom.withXml(checkPomVersion)
}
xlzxComponent(MavenPublication) {
group 'com.ydl'
version "xlzx-" + pVersion
from components.xlzxRelease
artifact sourceJar(getName(), "${project.projectDir}", "xlzx")
pom.withXml(checkPomVersion)
}
} else {
component(MavenPublication) {
group isApiModule ? 'com.ydl.api' : 'com.ydl'
version pVersion
from components.release
artifact sourceJar(getName(), "${project.projectDir}", "")
pom.withXml(checkPomVersion)
}
}
}
repositories {
def snapshot = pVersion.endsWith("-SNAPSHOT")
maven {
url snapshot ? mavenRepositoryUrl2 : mavenRepositoryUrl
allowInsecureProtocol true
credentials {
username "admin"
password "fjoi#1+#@"
}
}
}
}
}
\ No newline at end of file
......@@ -3,6 +3,6 @@ include ':app',
':ydl-platform', ':ydl-webview', ':ydl-pay', ':m-home', 'ydl-resource',
':m-home',
':m-consultant', ':m-muse', ':m-fm', ':m-tests', ":m-course",
":m-im",":m-dynamic","m-article","m-audioim","m-user", "m-confide"
":m-im",":m-dynamic",":m-article",":m-audioim",":m-user", ":m-confide"
include ':ydl-tuicore', ':api:confide', ':api:dynamic', ':api:fm', ':api:consultant',
':api:course', ':api:user', ':api:tests', ':api:im'
':api:course', ':api:user', ':api:tests', ':api:im',':api:home'
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -56,25 +56,8 @@ dependencies {
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
if (rootProject.ext.dev_mode){
//开发时使用
implementation project(":ydl-platform")
// api fileTree(include: ['*.aar'], dir: 'aars')
api rootProject.ext.dependencies["ydl-flutter"]
// api rootProject.ext.dependencies["ydl-flutter-sp"]
} else {
//发布时使用
api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
//以下为flutter端的所有aar
api rootProject.ext.dependencies["ydl-flutter"]
// api rootProject.ext.dependencies["ydl-flutter-sp"]
}
implementation project(":ydl-platform")
api rootProject.ext.dependencies["ydl-flutter"]
}
repositories {
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
android {
compileSdkVersion 28
......@@ -43,15 +43,7 @@ dependencies {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-platform')
}else {
//发布时使用
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
api project(':ydl-platform')
}
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
android {
compileSdkVersion 28
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
android {
compileSdkVersion 28
......@@ -33,25 +33,13 @@ android {
}
dependencies {
api fileTree(dir: 'libs', include: ['*.jar','*.aar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.ydl.aar:alipaysdk-noutdid:15.6.5'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-platform')
implementation project(":api:im")
}else {
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
//发布时使用
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
api project(':ydl-platform')
implementation project(":api:im")
}
repositories {
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -80,10 +80,8 @@ dependencies {
exclude group: 'com.ydl', module: 'pictureselector'
}
api rootProject.ext.dependencies["ydl-utils"]
// api project(':ydl-utils')
api rootProject.ext.dependencies["ydl-js"]
api rootProject.ext.dependencies["ydl-net"]
api project(':ydl-utils')
api project(':ydl-net')
api rootProject.ext.dependencies["ydl-js"]
api rootProject.ext.dependencies["ptr-lib-release"]
api(rootProject.ext.dependencies["ydl-device"]) {
......
......@@ -4,9 +4,11 @@ import android.content.Context
import com.apm.insight.MonitorCrash
import com.apm.insight.log.VLog
import com.bytedance.apm.insight.ApmInsight
import com.bytedance.apm.insight.ApmInsightAgent
import com.bytedance.apm.insight.ApmInsightInitConfig
import com.bytedance.apm.insight.IDynamicParams
import com.meituan.android.walle.WalleChannelReader
import org.json.JSONObject
object Apm {
......@@ -46,6 +48,33 @@ object Apm {
crash?.reportCustomErr(msg, type, throwable)
}
}
fun reportEvent(event: String, dimension: String, value: String) {
try {
if (hasInit) {
val d = hashMapOf(dimension to value)
ApmInsightAgent.monitorEvent(event, d, hashMapOf())
}
} catch (throwable: Throwable) {
VLog.e("reportEvent", throwable.message)
}
}
fun reportEventWithExt(event: String, dimension: String, value: String, ext: Map<String, String>) {
try {
if (hasInit) {
val d = hashMapOf(dimension to value)
if (ext.isNotEmpty()) {
val json = JSONObject(ext)
ApmInsightAgent.monitorEvent(event, d, hashMapOf(), json)
} else {
ApmInsightAgent.monitorEvent(event, d, hashMapOf())
}
}
} catch (throwable: Throwable) {
VLog.e("reportEvent", throwable.message)
}
}
}
private class ApmParams(val crash: MonitorCrash?, val uidCall: () -> String?) : IDynamicParams() {
......
......@@ -194,16 +194,16 @@ class HttpConfig {
val message = resp.message()
val api = req.url().encodedPath()
if (!resp.isSuccessful) {
Apm.reportCustom("network_request_error", "${api}(${code},${message})", Exception("${api}(${code},${message})"))
Apm.reportEventWithExt("network_api", "resp_fail", api, mapOf("code" to code.toString(), "msg" to message))
} else {
try {
val body = resp.body() ?: return@Interceptor resp
val buffer = body.source().buffer()
if(!isPlaintext(buffer)) return@Interceptor resp
if (!isPlaintext(buffer)) return@Interceptor resp
val readString = buffer.clone().readString(Charset.forName("UTF-8"))
val fromJson = Gson().fromJson<BaseAPIResponse<Any>>(readString, BaseAPIResponse::class.java)
if (fromJson.code != "200" && fromJson.code != "0") {
Apm.reportCustom("network_business_error", "${api}(${fromJson.code},${fromJson.msg})", Exception("${api}(${fromJson.code},${fromJson.msg})"))
Apm.reportEventWithExt("network_api", "business_fail", api, mapOf("code" to code.toString(), "msg" to message))
}
} catch (throwable: Throwable) {
LogUtil.e(throwable.message)
......
package com.ydl.ydlcommon.utils.log
import com.apm.insight.log.VLog
object XLog {
fun d(tag: String, msg: String) {
VLog.i(tag, msg)
}
fun i(tag: String, msg: String) {
VLog.i(tag, msg)
}
fun w(tag: String, msg: String) {
VLog.i(tag, msg)
}
fun e(tag: String, msg: String) {
VLog.e(tag, msg)
}
}
\ No newline at end of file
apply plugin: 'com.android.library'
//apply from: "../publish.gradle"
android {
compileSdkVersion 28
......
......@@ -6,7 +6,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: 'publish.gradle'
apply from: "../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'maven'
def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
def getVersionName() {
return hasProperty('VERSION_NAME') ? VERSION_NAME : rootProject.ext.ydlPublishVersion[project.getName()]
}
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
repository(url: mavenRepositoryUrl) {
authentication(userName: "admin", password: "fjoi#1+#@")
}
pom.project {
artifactId project.getName().replace('_', "-")
groupId "com.ydl"
version getVersionName()
packaging 'aar' //填写aar
}
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
arg("AROUTER_MODULE_NAME", "webview")
......@@ -50,20 +50,10 @@ dependencies {
api rootProject.ext.dependencies["ydl-user-router"]
api fileTree(include: ['*.jar'], dir: 'libs')
api 'com.tencent.tbs.tbssdk:sdk:43903'
if (rootProject.ext.dev_mode) {
//开发时使用
api project(':ydl-platform')
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:im")
} else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
api project(':ydl-platform')
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:im")
}
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