最近发现unity生成的包在Nexus上如果打开带Input控件的界面时,关闭屏幕再打开,则永远无法显示输入法界面了。
一开始还以为是unity自己本身的bug,后来发现release版本并无这个问题,于是弄了个最简单的测试版本分别打了
两个包,然后apktool解码对比发现,com/unity3d/player/UnityPlayer.smali在development模式下多了几行代码如下:
diff -r Untitled/smali/com/unity3d/player/UnityPlayer.smali keyboard/smali/com/unity3d/player/UnityPlayer.smali
310a311,355
> iget-object v0, p0, Lcom/unity3d/player/UnityPlayer;->h:Landroid/content/ContextWrapper;
>
> instance-of v0, v0, Landroid/app/Activity;
>
> if-eqz v0, :cond_5
>
> iget-object v0, p0, Lcom/unity3d/player/UnityPlayer;->h:Landroid/content/ContextWrapper;
>
> check-cast v0, Landroid/app/Activity;
>
> invoke-virtual {v0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;
>
> move-result-object v0
>
> con