Merge remote-tracking branch 'origin/dev' into dev-5.31.0
This commit is contained in:
@ -188,6 +188,7 @@ android {
|
||||
buildConfigField "String", "DEV_VAPI_HOST", "\"${DEV_VAPI_HOST}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPID", "\"${DEV_QUICK_LOGIN_APPID}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPKEY", "\"${DEV_QUICK_LOGIN_APPKEY}\""
|
||||
buildConfigField "String", "CSJ_APPID", "\"${DEV_CSJ_APPID}\""
|
||||
}
|
||||
|
||||
// publish, 发布时候使用的 flavor,接口仅包含正式环境
|
||||
@ -199,6 +200,7 @@ android {
|
||||
buildConfigField "String", "DEV_VAPI_HOST", "\"${VAPI_HOST}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPID", "\"${QUICK_LOGIN_APPID}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPKEY", "\"${QUICK_LOGIN_APPKEY}\""
|
||||
buildConfigField "String", "CSJ_APPID", "\"${CSJ_APPID}\""
|
||||
}
|
||||
|
||||
tea {
|
||||
@ -209,6 +211,7 @@ android {
|
||||
buildConfigField "String", "DEV_VAPI_HOST", "\"${VAPI_HOST}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPID", "\"${QUICK_LOGIN_APPID}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPKEY", "\"${QUICK_LOGIN_APPKEY}\""
|
||||
buildConfigField "String", "CSJ_APPID", "\"${CSJ_APPID}\""
|
||||
|
||||
manifestPlaceholders.put("APPLOG_SCHEME", "rangersapplog.byAx6uYt".toLowerCase())
|
||||
}
|
||||
@ -221,6 +224,7 @@ android {
|
||||
buildConfigField "String", "DEV_VAPI_HOST", "\"${VAPI_HOST}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPID", "\"${QUICK_LOGIN_APPID}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPKEY", "\"${QUICK_LOGIN_APPKEY}\""
|
||||
buildConfigField "String", "CSJ_APPID", "\"${CSJ_APPID}\""
|
||||
}
|
||||
|
||||
gdt {
|
||||
@ -231,6 +235,7 @@ android {
|
||||
buildConfigField "String", "DEV_VAPI_HOST", "\"${VAPI_HOST}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPID", "\"${QUICK_LOGIN_APPID}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPKEY", "\"${QUICK_LOGIN_APPKEY}\""
|
||||
buildConfigField "String", "CSJ_APPID", "\"${CSJ_APPID}\""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import com.gh.common.exposure.ExposureManager
|
||||
import com.gh.common.util.DirectUtils.directToLinkPage
|
||||
import com.gh.common.util.LogUtils
|
||||
import com.gh.common.util.NewFlatLogUtils.logOpenScreenAdSkip
|
||||
import com.gh.gamecenter.BuildConfig
|
||||
import com.gh.gamecenter.MainActivity
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
@ -159,7 +160,7 @@ object AdDelegateHelper {
|
||||
if (mIsCsjRequired && mCsjAdImpl == null) {
|
||||
mCsjAdImpl =
|
||||
ARouter.getInstance().build(RouteConsts.provider.csjAd).navigation() as? ICsjAdProvider
|
||||
mCsjAdImpl?.initSDK(context, HaloApp.getInstance().oaid)
|
||||
mCsjAdImpl?.initSDK(context, BuildConfig.CSJ_APPID, HaloApp.getInstance().oaid)
|
||||
// 监听亮色/暗色模式切换
|
||||
DarkModeUtils.registerModeChangeListener {
|
||||
val topActivity = CurrentActivityHolder.getCurrentActivity() ?: return@registerModeChangeListener
|
||||
|
||||
1
feature/csj_ad/proguard-rules.pro
vendored
1
feature/csj_ad/proguard-rules.pro
vendored
@ -19,3 +19,4 @@
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
-keep class android.content.ContentProvider {<fields>;}
|
||||
@ -54,6 +54,12 @@
|
||||
android:authorities="${applicationId}.TTMultiProvider"
|
||||
android:exported="false" />
|
||||
|
||||
<provider
|
||||
android:name="com.bytedance.sdk.openadsdk.stub.server.MainServerManager"
|
||||
android:authorities="${applicationId}.pangle.servermanager.main"
|
||||
android:exported="false"
|
||||
tools:node="remove"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@ -12,20 +12,33 @@ import com.bytedance.sdk.openadsdk.TTAdNative.CSJSplashAdListener
|
||||
import com.bytedance.sdk.openadsdk.TTAdNative.NativeExpressAdListener
|
||||
import com.bytedance.sdk.openadsdk.TTAdSdk.InitCallback
|
||||
import com.bytedance.sdk.openadsdk.TTNativeExpressAd.ExpressAdInteractionListener
|
||||
import com.bytedance.sdk.openadsdk.stub.server.MainServerManager
|
||||
import com.gh.gamecenter.common.utils.PackageFlavorHelper
|
||||
import com.gh.gamecenter.common.utils.doOnFragmentDestroy
|
||||
import com.lightgame.utils.Utils
|
||||
import java.lang.reflect.Field
|
||||
|
||||
object CsjAdHelper {
|
||||
|
||||
const val TAG = "CsjAdHelper"
|
||||
|
||||
fun init(context: Context, oaid: String) {
|
||||
fun init(context: Context, csjId: String, oaid: String) {
|
||||
|
||||
try {
|
||||
val serverContentProvider = MainServerManager()
|
||||
val contextField: Field = serverContentProvider.javaClass.superclass.superclass.getDeclaredField("mContext")
|
||||
contextField.isAccessible = true
|
||||
contextField.set(serverContentProvider, context)
|
||||
serverContentProvider.onCreate()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
// 强烈建议在应用对应的Application#onCreate()方法中调用,避免出现content为null的异常
|
||||
TTAdSdk.init(
|
||||
context,
|
||||
TTAdConfig.Builder()
|
||||
.appId("5410486")// xxxxxxx为穿山甲媒体平台注册的应用ID
|
||||
.appId(csjId)// xxxxxxx为穿山甲媒体平台注册的应用ID
|
||||
.useTextureView(true) // 默认使用SurfaceView播放视频广告,当有SurfaceView冲突的场景,可以使用TextureView
|
||||
.appName("光环助手")
|
||||
.titleBarTheme(TTAdConstant.TITLE_BAR_THEME_DARK)//落地页主题
|
||||
|
||||
@ -10,8 +10,8 @@ import com.gh.gamecenter.core.provider.ICsjAdProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.csjAd, name = "csj广告暴露服务")
|
||||
class CsjAdProviderImpl : ICsjAdProvider {
|
||||
override fun initSDK(context: Context, oaid: String) {
|
||||
CsjAdHelper.init(context, oaid)
|
||||
override fun initSDK(context: Context, id: String, oaid: String) {
|
||||
CsjAdHelper.init(context, id, oaid)
|
||||
}
|
||||
|
||||
override fun requestSplashAd(
|
||||
|
||||
@ -52,6 +52,9 @@ QUICK_LOGIN_APPKEY=002BAABA2C078342DA33BEAB0A4C6A25
|
||||
DEV_QUICK_LOGIN_APPID=300012281661
|
||||
DEV_QUICK_LOGIN_APPKEY=1BFAB6E349F1D69CC06ABAD9D7A43FB8
|
||||
|
||||
DEV_CSJ_APPID=5410486
|
||||
CSJ_APPID=5429125
|
||||
|
||||
# hosts
|
||||
DEV_API_HOST=https\://dev-and-api.ghzs.com/v5d5d0/
|
||||
API_HOST=https\://and-api.ghzs.com/v5d5d0/
|
||||
|
||||
@ -86,7 +86,9 @@ allprojects { project ->
|
||||
"com/gh/gamecenter/common/util/MtaHelper#onEventWithBasicDeviceInfo#(Ljava/lang/String;[Ljava/lang/String;)V"
|
||||
]
|
||||
onlyCheckList = []
|
||||
whiteList = []
|
||||
whiteList = [
|
||||
"com/tencent/qqmini/minigame/opensdk/share/OpenSdkShareHelper*",
|
||||
]
|
||||
}
|
||||
|
||||
project.field_assign_opt {
|
||||
|
||||
@ -8,7 +8,7 @@ import com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
interface ICsjAdProvider : IProvider {
|
||||
|
||||
fun initSDK(context: Context, oaid: String)
|
||||
fun initSDK(context: Context, id: String, oaid: String)
|
||||
|
||||
fun requestSplashAd(
|
||||
activity: Activity,
|
||||
|
||||
@ -16,5 +16,8 @@ data class MessageGameEntity(
|
||||
var content: Content? = null,
|
||||
var links: List<LinkEntity>? = null
|
||||
) {
|
||||
data class Content(var link: LinkEntity)
|
||||
data class Content(
|
||||
var link: LinkEntity? = null,
|
||||
var images: List<String> = listOf()
|
||||
)
|
||||
}
|
||||
@ -317,6 +317,37 @@ class MessageListAdapter(
|
||||
spannableText.copyTextAndToast("已复制:$spannableText")
|
||||
}
|
||||
|
||||
if (!entity.content?.images.isNullOrEmpty()) {
|
||||
holder.binding.messageKefuImagesContainer.removeAllViews()
|
||||
holder.binding.messageKefuImagesContainer.visibility = View.VISIBLE
|
||||
entity.content?.images?.forEachIndexed { i, image ->
|
||||
val draweeView = SimpleDraweeView(mContext)
|
||||
val padding = 2F.dip2px()
|
||||
draweeView.setPadding(padding, padding, padding, padding)
|
||||
val params: FlexboxLayout.LayoutParams = FlexboxLayout.LayoutParams(mImageSize, mImageSize)
|
||||
draweeView.layoutParams = params
|
||||
draweeView.setImageURI(image)
|
||||
draweeView.setOnClickListener {
|
||||
ARouter.getInstance().build(RouteConsts.activity.imageViewerActivity)
|
||||
.withStringArrayList(
|
||||
EntranceConsts.KEY_URL_LIST,
|
||||
entity.content?.images!! as ArrayList<String>
|
||||
)
|
||||
.withInt(EntranceConsts.KEY_CURRENT, i)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, "(消息中心-系统)")
|
||||
.navigation()
|
||||
}
|
||||
val hierarchy = draweeView.hierarchy
|
||||
val roundingParams = RoundingParams.fromCornersRadius(18F)
|
||||
hierarchy.roundingParams = roundingParams
|
||||
hierarchy.setPlaceholderImage(R.drawable.occupy)
|
||||
holder.binding.messageKefuImagesContainer.addView(draweeView)
|
||||
}
|
||||
holder.binding.messageKefuImagesContainer.requestLayout()
|
||||
} else {
|
||||
holder.binding.messageKefuImagesContainer.visibility = View.GONE
|
||||
}
|
||||
|
||||
val commentUtilsProvider =
|
||||
ARouter.getInstance().build(RouteConsts.provider.commentUtils).navigation() as? ICommentUtilsProvider
|
||||
commentUtilsProvider?.setCommentTime(messageKefuTime, entity.time.create)
|
||||
|
||||
Reference in New Issue
Block a user