Merge branch 'dev_robotaxi-d_230711_3.4.0' into dev_20230708_unmanned_3.5.0

# Conflicts:
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/RomaBusView.kt
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/RomaPassengerView.kt
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/RomaTaxiView.kt
#	core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyDataManager.kt
#	gradle.properties
This commit is contained in:
wangmingjun
2023-08-01 09:57:11 +08:00
662 changed files with 9613 additions and 9793 deletions

View File

@@ -125,22 +125,26 @@ android {
mogo {
dimension "project"
buildConfigField 'boolean', 'secure', "true"
buildConfigField 'String', 'URLs', "\"${readFileToJson("mogo").replace("\"", "\\\"")}\""
buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("mogo").replace("\"", "\\\"")}\""
}
yantai {
dimension "project"
buildConfigField 'boolean', 'secure', "false"
buildConfigField 'String', 'URLs', "\"${readFileToJson("yantai").replace("\"", "\\\"")}\""
buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("yantai").replace("\"", "\\\"")}\""
}
dali {
dimension "project"
buildConfigField 'boolean', 'secure', "false"
buildConfigField 'String', 'URLs', "\"${readFileToJson("dali").replace("\"", "\\\"")}\""
buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("dali").replace("\"", "\\\"")}\""
}
saas {
dimension "project"
buildConfigField 'boolean', 'secure', "false"
buildConfigField 'String', 'URLs', "\"${readFileToJson("saas").replace("\"", "\\\"")}\""
buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("saas").replace("\"", "\\\"")}\""
}
@@ -326,7 +330,8 @@ def variantName() {
}else if (taskName.contains("Dali")) {
project.dependencies.add('implementation', project.project(':tts:tts-pad'))
}else {
// 不能再else 加任何逻辑 是android dlc的特效
println("-----------$taskName")
}
taskName = taskName.replace("Debug", "")

View File

@@ -10,7 +10,10 @@
"eagle_mis_url": "",
"eagle_dns_url": "",
"bind_driver_qr_url": "",
"chart_socket_url":""
"chart_socket_url":"",
"secure_active_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/active",
"secure_refresh_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/refresh",
"secure_auth_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/auth"
},
"online": {
"och_url": "https://tech.zhidaohulian.com",
@@ -22,7 +25,10 @@
"eagle_mis_url": "",
"eagle_dns_url": "",
"bind_driver_qr_url": "",
"chart_socket_url":""
"chart_socket_url":"",
"secure_active_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/active",
"secure_refresh_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/refresh",
"secure_auth_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/auth"
},
"demo": {
"och_url": "http://tech-dev.zhidaohulian.com",
@@ -34,7 +40,10 @@
"eagle_mis_url": "",
"eagle_dns_url": "",
"bind_driver_qr_url": "",
"chart_socket_url":""
"chart_socket_url":"",
"secure_active_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/active",
"secure_refresh_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/refresh",
"secure_auth_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/auth"
}
},
"dali": {

View File

@@ -8,9 +8,10 @@
-keeppackage com/elegant/log/
-keeppackage org/slf4j/
-keeppackage kotlin/
-keeppackage androidx/
-keepclass com.mogo.eagle.core.function.main.MainMoGoApplication
-keepclass com.mogo.commons.AbsMogoApplication
-keepclass com.bytedance.apm.agent.v2.instrumentation.AppAgent
-keepclass androidx.core.app.CoreComponentFactory
# -keepclass androidx.core.app.CoreComponentFactory
-keepclass com.mogo.eagle.core.utilcode.util.ProcessUtils
-keepclass com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils

View File

@@ -15,7 +15,7 @@
},
"taxi" :{
"driver": ["ochDFHQ"],
"driverpassenger": ["ochDFHQ"],
"driverPassenger": ["ochDFHQ"],
"passenger": ["ochDFHQ"]
},
"taxiunmanned" :{
@@ -25,7 +25,7 @@
},
"bus" :{
"driver": ["ochJL"],
"driverpassenger": ["ochJL"],
"driverPassenger": ["ochJL"],
"passenger": ["ochJL"]
},
"charter" :{
@@ -63,7 +63,7 @@
},
"bus" :{
"driver": ["ochJL"],
"driverpassenger": ["ochJL"],
"driverPassenger": ["ochJL"],
"passenger": ["ochJL"]
}
}

View File

@@ -14,20 +14,23 @@ project.android.productFlavors {
// ②连接的工控机IP地址
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.1.102\""
// ③是否需要重写状态栏
buildConfigField 'boolean', 'IS_REPLACE_STATUSVIEW', 'false'
// ④构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
if (isCurrentDriver("taxi")) {
// 在启动的时候把Task给清空
manifestPlaceholders.put("ACTIVITY_ROOT", true)
// ③是否需要重写状态栏
buildConfigField 'boolean', 'IS_REPLACE_STATUSVIEW', 'false'
}else if (isCurrentPassenger("taxi")) {
// 在启动的时候把Task给清空
manifestPlaceholders.put("ACTIVITY_ROOT", false)
// ③是否需要重写状态栏
buildConfigField 'boolean', 'IS_REPLACE_STATUSVIEW', 'true'
}else {
manifestPlaceholders.put("ACTIVITY_ROOT", false)
// ③是否需要重写状态栏
buildConfigField 'boolean', 'IS_REPLACE_STATUSVIEW', 'false'
}
}
}

View File

@@ -1,5 +1,5 @@
project.android.productFlavors {
driverpassenger {
driverPassenger {
dimension "role"
externalNativeBuild {
ndk {

File diff suppressed because one or more lines are too long

View File

@@ -27,6 +27,8 @@ class CrashFix {
@TargetMethod(methodName = "startService")
@ReplaceInvoke
fun fixStartServiceCrash(context: Context, intent: Intent): ComponentName? {
return try {
context.startService(intent)
} catch (t: Throwable) {
@@ -57,4 +59,15 @@ class CrashFix {
t.printStackTrace()
}
}
@Insert
@TargetClass("com.aispeech.lite.tts.n")
@TargetMethod(methodName = "c")
fun fixTtsCrash() {
try {
Origin.callVoid()
} catch (t: Throwable) {
t.printStackTrace()
}
}
}

View File

@@ -0,0 +1,574 @@
package com.mogo.launcher.lancet
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.graphics.Canvas
import android.os.*
import android.util.*
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.*
import androidx.collection.ArrayMap
import com.knightboost.lancet.api.*
import com.knightboost.lancet.api.Scope.ALL
import com.knightboost.lancet.api.Scope.LEAF
import com.knightboost.lancet.api.annotations.*
import com.knightboost.lancet.api.annotations.Weaver
import com.mogo.eagle.core.block.runtime.config.recorder.*
import com.mogo.eagle.core.block.runtime.utils.TimeUtils.Companion.now
import com.mogo.eagle.core.function.call.devatools.*
import com.mogo.eagle.core.utilcode.util.*
import kotlinx.coroutines.*
import kotlinx.coroutines.Runnable
import java.util.LinkedList
import java.util.concurrent.ConcurrentHashMap
import com.mogo.eagle.core.block.runtime.message.Message as Holder
@Keep
@Weaver
@Group("main_block_check")
class MainBlockCheck {
companion object {
@JvmStatic
val tokens = ArrayMap<Any, Holder>(128)
@JvmStatic
val whats by lazy { ConcurrentHashMap<Int, LinkedList<Holder>>() }
@JvmStatic
fun getRecorder(): IMessageRecorder? {
val block = CallerDevaToolsManager.block()
if (block == null || !block.hasInit()) {
return null
}
return block.recorder()
}
@JvmStatic val HANDLER by lazy {
Handler(Looper.getMainLooper()) { msg ->
val enclose = msg.obj as? Holder ?: throw AssertionError()
enclose.what?.also {
whats[it]?.remove(enclose)
}
val h = enclose.handler
val action = enclose.action
val oldMsg = enclose.origin
val oldObj = enclose.obj
val now = now()
if (enclose.enqueueTime <= 0) {
throw AssertionError("illegal: $enclose")
}
val elapsedTime = now - enclose.enqueueTime
try {
if (action != null) {
action.run()
} else {
if (oldMsg == null) {
h?.dispatchMessage(msg)
} else {
oldMsg.obj = oldObj
h?.dispatchMessage(oldMsg)
}
}
} finally {
val duration = now() - now
getRecorder()?.recycle(enclose.id, elapsedTime, duration)
}
true
}
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "post")
@ReplaceInvoke
fun handlerPostProxy(handler: Handler, action: Runnable): Boolean {
if (Looper.getMainLooper() != handler.looper) {
return handler.post(action)
}
val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
val msg = Message.obtain(handler, action)
msg.what = what
val holder = Holder.acquire(handler, action = action, what = what)
msg.obj = holder
val inserted = HANDLER.sendMessage(msg)
if (inserted) {
getRecorder()?.insert(holder)
whats.getOrPut(what) { LinkedList() }.add(holder)
}
return inserted
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "sendEmptyMessage")
@ReplaceInvoke
fun handlerSendEmptyMessage(handler: Handler, what: Int): Boolean {
if (Looper.getMainLooper() != handler.looper) {
return handler.sendEmptyMessage(what)
}
val msg = Message.obtain(handler, what)
val holder = Holder.acquire(handler, what = what)
msg.obj = holder
val inserted = HANDLER.sendMessage(msg)
if (inserted) {
getRecorder()?.insert(holder)
whats.getOrPut(what) { LinkedList() }.add(holder)
}
return inserted
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "sendEmptyMessageAtTime")
@ReplaceInvoke
fun handlerSendEmptyMessageAtTime(handler: Handler, what: Int, uptimeMillis: Long): Boolean {
if (Looper.getMainLooper() != handler.looper) {
return handler.sendEmptyMessageAtTime(what, uptimeMillis)
}
val msg = Message.obtain(handler, what)
val holder = Holder.acquire(handler, what = what, delay = uptimeMillis - SystemClock.uptimeMillis())
msg.obj = holder
val inserted = HANDLER.sendMessageAtTime(msg, uptimeMillis)
if (inserted) {
getRecorder()?.insert(holder)
whats.getOrPut(what) { LinkedList() }.add(holder)
}
return inserted
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "sendEmptyMessageDelayed")
@ReplaceInvoke
fun handlerSendEmptyMessageDelayed(handler: Handler, what: Int, delayMillis: Long): Boolean {
if (Looper.getMainLooper() != handler.looper) {
return handler.sendEmptyMessageDelayed(what, delayMillis)
}
val msg = Message.obtain(handler, what)
val holder = Holder.acquire(handler, what = what, delay = delayMillis)
msg.obj = holder
val inserted = HANDLER.sendMessageDelayed(msg, delayMillis)
if (inserted) {
getRecorder()?.insert(holder)
whats.getOrPut(what) { LinkedList() }.add(holder)
}
return inserted
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "sendMessage")
@ReplaceInvoke
fun handlerSendMessage(handler: Handler, msg: Message): Boolean {
if (Looper.getMainLooper() != handler.looper) {
return handler.sendMessage(msg)
}
val obj: Holder = Holder.acquire(handler, msg, obj = msg.obj, what = msg.what)
val oldObj = msg.obj
msg.obj = obj
if (oldObj != null) {
synchronized(tokens) {
tokens[oldObj] = obj
}
}
val inserted = HANDLER.sendMessage(msg)
if (inserted) {
getRecorder()?.insert(obj)
whats.getOrPut(msg.what) { LinkedList() }.add(obj)
}
return inserted
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "sendMessageAtTime")
@ReplaceInvoke
fun handlerSendMessageAtTime(handler: Handler, msg: Message, uptimeMillis: Long): Boolean {
if (Looper.getMainLooper() != handler.looper) {
return handler.sendMessageAtTime(msg, uptimeMillis)
}
val obj= Holder.acquire(handler, msg, obj = msg.obj, what = msg.what, delay = uptimeMillis - SystemClock.uptimeMillis())
val oldObj = msg.obj
msg.obj = obj
if (oldObj != null) {
synchronized(tokens) {
tokens[oldObj] = obj
}
}
val inserted = HANDLER.sendMessageAtTime(msg, uptimeMillis)
if (inserted) {
whats.getOrPut(msg.what) { LinkedList() }.add(obj)
getRecorder()?.insert(obj)
}
return inserted
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "sendMessageAtFrontOfQueue")
@ReplaceInvoke
fun handlerSendMessageAtFrontOfQueue(handler: Handler, msg: Message): Boolean {
if (Looper.getMainLooper() != handler.looper) {
return handler.sendMessageAtFrontOfQueue(msg)
}
val obj = Holder.acquire(handler, msg, obj = msg.obj, what = msg.what)
val old = msg.obj
msg.obj = obj
if (old != null) {
synchronized(tokens) {
tokens[old] = obj
}
}
val inserted = HANDLER.sendMessageAtFrontOfQueue(msg)
if (inserted) {
whats.getOrPut(msg.what) { LinkedList() }.add(obj)
getRecorder()?.insert(obj)
}
return inserted
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "postDelayed")
@ReplaceInvoke
fun handlerPostDelayProxy(handler: Handler, action: Runnable, delayMillis: Long): Boolean {
if (Looper.getMainLooper() != handler.looper) {
return handler.postDelayed(action, delayMillis)
}
val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
val msg = Message.obtain(handler, action)
msg.what = what
val holder = Holder.acquire(handler, action = action, what = what, delay = delayMillis)
msg.obj = holder
val inserted = HANDLER.sendMessageDelayed(msg, delayMillis)
if (inserted) {
getRecorder()?.insert(holder)
whats.getOrPut(what) { LinkedList() }.add(holder)
}
return inserted
}
@JvmStatic
@TargetClass(value = "android.app.Activity", scope = ALL)
@TargetMethod(methodName = "post")
@ReplaceInvoke
fun runOnUiThreadOfActivityProxy(activity: Activity, action: Runnable) {
val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
val msg = Message.obtain()
msg.what = what
val holder = Holder.acquire(null, action = action, what = what)
msg.obj = holder
val inserted = HANDLER.sendMessage(msg)
if (inserted) {
getRecorder()?.insert(holder)
whats.getOrPut(what) { LinkedList() }.add(holder)
}
}
@JvmStatic
@TargetClass(value = "android.view.View", scope = ALL)
@TargetMethod(methodName = "post")
@ReplaceInvoke
fun postOfViewProxy(view: View, action: Runnable): Boolean {
val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
val msg = Message.obtain()
msg.what = what
val holder = Holder.acquire(null, action = action, what = what)
msg.obj = holder
val inserted = HANDLER.sendMessage(msg)
if (inserted) {
getRecorder()?.insert(holder)
whats.getOrPut(what) { LinkedList() }.add(holder)
}
return inserted
}
@JvmStatic
@TargetClass(value = "android.view.View", scope = ALL)
@TargetMethod(methodName = "postDelayed")
@ReplaceInvoke
fun postDelayedOfViewProxy(view: View, action: Runnable, delayMillis: Long): Boolean {
val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
val msg = Message.obtain()
msg.what = what
val holder = Holder.acquire(null, action = action, what = what, delay = delayMillis)
msg.obj = holder
val inserted = HANDLER.sendMessageDelayed(msg, delayMillis)
if (inserted) {
getRecorder()?.insert(holder)
whats.getOrPut(what) { LinkedList() }.add(holder)
}
return inserted
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "removeCallbacks")
@ReplaceInvoke
fun handlerRemoveCallbacks(handler: Handler, action: Runnable) {
if (Looper.getMainLooper() != handler.looper) {
return handler.removeCallbacks(action)
}
val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
HANDLER.removeMessages(what)
val holders = whats.remove(what)
if (!holders.isNullOrEmpty()) {
getRecorder()?.remove(holders)
}
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "removeCallbacks")
@ReplaceInvoke
fun handlerRemoveCallbacksWithToken(handler: Handler, action: Runnable, token: Any?) {
if (Looper.getMainLooper() != handler.looper) {
return handler.removeCallbacks(action, token)
}
val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
val holders = whats.remove(what)
if (!holders.isNullOrEmpty()) {
getRecorder()?.remove(holders)
}
HANDLER.removeMessages(what, if (token != null) { synchronized(tokens) { tokens.remove(token) } } else null)
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "removeMessages")
@ReplaceInvoke
fun handlerRemoveMessages(handler: Handler, what: Int) {
if (Looper.getMainLooper() != handler.looper) {
return handler.removeMessages(what)
}
val holders = whats.remove(what)
if (!holders.isNullOrEmpty()) {
getRecorder()?.remove(holders)
}
HANDLER.removeMessages(what)
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "removeMessages")
@ReplaceInvoke
fun handlerRemoveMessagesWithToken(handler: Handler, what: Int, token: Any?) {
if (Looper.getMainLooper() != handler.looper) {
return handler.removeMessages(what, token)
}
val holders = whats.remove(what)
if (!holders.isNullOrEmpty()) {
getRecorder()?.remove(holders)
}
HANDLER.removeMessages(what, if (token != null) synchronized(tokens) { tokens.remove(token) } else null)
}
}
@TargetClass(value = "android.view.View", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onMeasure")
fun proxyViewOnMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
val now = now()
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
} finally {
val spend = now() - now
getRecorder()?.insert(Holder.acquire(spend, "View[${This.get().javaClass.name}]:onMeasure"))
}
}
@TargetClass(value = "android.view.View", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onLayout")
fun proxyViewOnLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
val holder = Holder.acquire(handler = null, obj = "View[${This.get().javaClass.name}]:onLayout")
getRecorder()?.insert(holder)
val now = now()
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
} finally {
val spend = now() - now
getRecorder()?.recycle(holder.id, 0, spend)
}
}
@TargetClass(value = "android.view.View", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onDraw")
fun proxyViewOnDraw(canvas: Canvas) {
val holder = Holder.acquire(handler = null, obj = "View[${This.get().javaClass.name}]:onDraw")
getRecorder()?.insert(holder)
val now = now()
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
} finally {
val spend = now() - now
getRecorder()?.recycle(holder.id, 0, spend)
}
}
@TargetClass(value = "android.app.Activity", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onCreate")
fun proxyActivityOnCreate(savedInstanceState: Bundle?) {
val holder = Holder.acquire(handler = null, obj = "Activity[${This.get().javaClass.name}]:onCreate")
getRecorder()?.insert(holder)
val now = now()
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
} finally {
val spend = now() - now
CallerDevaToolsManager.block()?.monitor((This.get() as Activity).window)
getRecorder()?.recycle(holder.id, 0, spend)
}
}
@TargetClass(value = "android.app.Activity", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onStart")
fun proxyActivityOnStart() {
val holder = Holder.acquire(handler = null, obj = "Activity[${This.get().javaClass.name}]:onStart")
getRecorder()?.insert(holder)
val now = now()
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
} finally {
val spend = now() - now
getRecorder()?.recycle(holder.id, 0, spend)
}
}
@TargetClass(value = "android.app.Activity", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onResume")
fun proxyActivityOnResume() {
val holder = Holder.acquire(handler = null, obj = "Activity[${This.get().javaClass.name}]:onResume")
getRecorder()?.insert(holder)
val now = now()
CallerDevaToolsManager.block()?.resume((This.get() as Activity).window)
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
} finally {
val spend = now() - now
getRecorder()?.recycle(holder.id, 0, spend)
}
}
@TargetClass(value = "android.app.Activity", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onPause")
fun proxyActivityOnPause() {
val holder = Holder.acquire(handler = null, obj = "Activity[${This.get().javaClass.name}]:onPause")
getRecorder()?.insert(holder)
CallerDevaToolsManager.block()?.pause((This.get() as Activity).window)
val now = now()
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
} finally {
val spend = now() - now
getRecorder()?.recycle(holder.id, 0, spend)
}
}
@TargetClass(value = "android.app.Activity", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onDestroy")
fun proxyActivityOnDestroy() {
CallerDevaToolsManager.block()?.pop((This.get() as Activity).window)
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
}
}
@TargetClass(value = "androidx.fragment.app.Fragment", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onCreateView")
fun proxyFragmentOnCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle?) {
val holder = Holder.acquire(handler = null, obj = "Fragment[${This.get().javaClass.name}]:onCreateView")
getRecorder()?.insert(holder)
val startTime = now()
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
} finally {
val spend = now() - startTime
getRecorder()?.recycle(holder.id, 0, spend)
}
}
@TargetClass(value = "androidx.fragment.app.Fragment", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onCreate")
fun proxyFragmentOnCreate(savedInstanceState: Bundle?) {
val holder = Holder.acquire(handler = null, obj = "Fragment[${This.get().javaClass.name}]:onCreate")
getRecorder()?.insert(holder)
val startTime = now()
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
} finally {
val spend = now() - startTime
getRecorder()?.recycle(holder.id, 0, spend)
}
}
@TargetClass(value = "androidx.fragment.app.Fragment", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onViewCreated")
fun proxyFragmentOnViewCreated(view: View, savedInstanceState: Bundle?) {
val holder = Holder.acquire(handler = null, obj = "Fragment[${This.get().javaClass.name}]:onViewCreated")
getRecorder()?.insert(holder)
val startTime = now()
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
} finally {
val spend = now() - startTime
getRecorder()?.recycle(holder.id, 0, spend)
}
}
@TargetClass(value = "android.content.BroadcastReceiver", scope = LEAF)
@Insert(mayCreateSuper = true)
@TargetMethod(methodName = "onReceive")
fun proxyBroadcastReceiver(ctx: Context?, intent: Intent?) {
val holder = Holder.acquire(handler = null, obj = "Receiver[${This.get().javaClass.name}]:onReceive")
getRecorder()?.insert(holder)
val startTime = now()
try {
Origin.callVoid()
} catch (t: Throwable) {
throw t
} finally {
val spend = now() - startTime
getRecorder()?.recycle(holder.id, 0, spend)
}
}
}

View File

@@ -63,6 +63,9 @@ public class WindowCallbackLancet {
@TargetMethod(methodName = "addView")
@ReplaceInvoke
public static void proxyWindowManagerAddView(WindowManager manager, View view, ViewGroup.LayoutParams params) {
if (view == null) {
return;
}
view.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
private final GlobalFocusChangedListener listener = new GlobalFocusChangedListener();
private boolean isAdd = false;
@@ -93,6 +96,9 @@ public class WindowCallbackLancet {
@TargetMethod(methodName = "setContentView")
@ReplaceInvoke
public static void proxyPopupWindowSetContentView(PopupWindow window, View view) {
if (view == null) {
return;
}
view.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
private final GlobalFocusChangedListener listener = new GlobalFocusChangedListener();
private boolean isAdd = false;

View File

@@ -68,6 +68,8 @@ object ConfigStartUp {
// }
// 不同身份对应不同的IP地址
FunctionBuildConfig.adasConnectIP = BuildConfig.ADAS_CONNECT_IP
// 是否开启secure校验
FunctionBuildConfig.isSecure = BuildConfig.secure
}
private fun initDebugConfig() {
@@ -120,10 +122,8 @@ object ConfigStartUp {
HmiBuildConfig.isShowLimitingVelocityView = false
//白天模式
FunctionBuildConfig.skinMode = 1
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
//是否显示 限速UI
HmiBuildConfig.isShowLimitingVelocityView = false
} else if (AppIdentityModeUtils.isCharter(FunctionBuildConfig.appIdentityMode)) {
} else if (AppIdentityModeUtils.isCharter(FunctionBuildConfig.appIdentityMode)||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
//是否显示 限速UI
HmiBuildConfig.isShowLimitingVelocityView = false
//白天模式
@@ -132,9 +132,10 @@ object ConfigStartUp {
}
val mapParams = MapParams.init()
mapParams.setDebugMode(false) // 1-使用本地地图数据0-使用在线地图数据
mapParams.setDebugMode(DebugConfig.isDebug()) // 1-使用本地地图数据0-使用在线地图数据
//.setDataFileSource(1)
.setIsRecordLogs(false)
.setIsWeatherEnable(false)
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_UP_CAR)
.setHDVisibileArray(