解决,M3、M4 因为hook 无法启动的bug
This commit is contained in:
@@ -65,15 +65,6 @@ public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusCh
|
||||
Log.d(TAG, "小地图模块初始化……");
|
||||
mContext = context;
|
||||
|
||||
try {
|
||||
// 替换高德地图的方法,解决因为加入换肤框架导致地图初始化失败
|
||||
Method srcMethod = lg.class.getDeclaredMethod("a", Context.class, int.class, ViewGroup.class);
|
||||
Method destMethod = lg2.class.getDeclaredMethod("a", Context.class, int.class, ViewGroup.class);
|
||||
HookManager.get().hookMethod(srcMethod, destMethod);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
@@ -148,6 +139,17 @@ public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusCh
|
||||
*/
|
||||
private void addSmallMapView() {
|
||||
Logger.d(TAG, "addSmallMapView");
|
||||
|
||||
try {
|
||||
// 替换高德地图的方法,解决因为加入换肤框架导致地图初始化失败
|
||||
Method srcMethod = lg.class.getDeclaredMethod("a", Context.class, int.class, ViewGroup.class);
|
||||
Method destMethod = lg2.class.getDeclaredMethod("a", Context.class, int.class, ViewGroup.class);
|
||||
HookManager.get().hookMethod(srcMethod, destMethod);
|
||||
Logger.d(TAG, "hook 高德地图成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// 初始化小地图控件
|
||||
if (mSmallMapDirectionView == null) {
|
||||
mSmallMapDirectionView = new SmallMapDirectionView(mContext);
|
||||
|
||||
Reference in New Issue
Block a user