VFY:修改后的索尼爱立信启动器中出现死代码错误

发布于 2024-12-10 04:46:55 字数 1857 浏览 5 评论 0原文

我正在使角圈在 hdpi 设备上工作。除了按“添加”按钮(也长按屏幕)和按应用程序抽屉中的排序样式按钮外,一切正常。两者都会产生发射器的 F/c。奇怪的是,它可以在我的 OG Droid 和 Xoom 上运行,但不能在我的 Droid Incredible 2 上运行。

Logcat:

     I/ActivityManager(24294): Displayed
     com.sonyericsson.home/.HomeActivity: +1s573ms W/cornerbuttons(26412):
     Customization file not found:
     /etc/customization/settings/com/sonyericsson/home/default_settings_topleftcornerbutton.xml
     W/cornerbuttons(26412): Customization file not found:
     /etc/customization/settings/com/sonyericsson/home/default_settings_toprightcornerbutton.xml
     W/cornerbuttons(26412): Customization file not found:
     /etc/customization/settings/com/sonyericsson/home/default_settings_bottomleftcornerbutton.xml
     W/cornerbuttons(26412): Customization file not found:
     /etc/customization/settings/com/sonyericsson/home/default_settings_bottomrightcornerbutton.xml
     W/app-tray(26412): Customization file not found:
     /etc/customization/settings/com/sonyericsson/home/default_settings_apptray.xml
     I/dalvikvm(26412): Could not find method
     android.app.AlertDialog$Builder.<init>, referenced from method
    com.sonyericsson.home.HomeActivity$AddDialog.createDialog
     D/dalvikvm(26412): VFY: dead code 0x0011-0034 in
     Lcom/sonyericsson/home/HomeActivity$AddDialog;.createDialog
     ()Landroid/app/Dialog; I/ActivityManager(24294): Displayed
     com.sonyericsson.home/.HomeActivity: +1s651ms I/dalvikvm(26442): Could
     not find method android.app.AlertDialog$Builder.<init>, referenced
     from method com.sonyericsson.home.HomeActivity$SortDialog.createDialog
     D/dalvikvm(26442): VFY: dead code 0x0019-0047 in
     Lcom/sonyericsson/home/HomeActivity$SortDialog;.createDialog
     ()Landroid/app/Dialog;
   PS: the f/cs occur even without my modifications  

I am in the process of making the corner circles work on hdpi devices. Everything works except pressing the "add" button (long pressing screen as well), and pressing the sorting style button in the app drawer. Both result in a F/c of the launcher. The odd thing is it is working on both my OG Droid as well as my Xoom, but not my Droid Incredible 2.

The Logcat:

     I/ActivityManager(24294): Displayed
     com.sonyericsson.home/.HomeActivity: +1s573ms W/cornerbuttons(26412):
     Customization file not found:
     /etc/customization/settings/com/sonyericsson/home/default_settings_topleftcornerbutton.xml
     W/cornerbuttons(26412): Customization file not found:
     /etc/customization/settings/com/sonyericsson/home/default_settings_toprightcornerbutton.xml
     W/cornerbuttons(26412): Customization file not found:
     /etc/customization/settings/com/sonyericsson/home/default_settings_bottomleftcornerbutton.xml
     W/cornerbuttons(26412): Customization file not found:
     /etc/customization/settings/com/sonyericsson/home/default_settings_bottomrightcornerbutton.xml
     W/app-tray(26412): Customization file not found:
     /etc/customization/settings/com/sonyericsson/home/default_settings_apptray.xml
     I/dalvikvm(26412): Could not find method
     android.app.AlertDialog$Builder.<init>, referenced from method
    com.sonyericsson.home.HomeActivity$AddDialog.createDialog
     D/dalvikvm(26412): VFY: dead code 0x0011-0034 in
     Lcom/sonyericsson/home/HomeActivity$AddDialog;.createDialog
     ()Landroid/app/Dialog; I/ActivityManager(24294): Displayed
     com.sonyericsson.home/.HomeActivity: +1s651ms I/dalvikvm(26442): Could
     not find method android.app.AlertDialog$Builder.<init>, referenced
     from method com.sonyericsson.home.HomeActivity$SortDialog.createDialog
     D/dalvikvm(26442): VFY: dead code 0x0019-0047 in
     Lcom/sonyericsson/home/HomeActivity$SortDialog;.createDialog
     ()Landroid/app/Dialog;
   PS: the f/cs occur even without my modifications  

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的他你的她 2024-12-17 04:46:55

反编译后,您会发现在SortDialog内部类“HomeActivity$SortDialog.smali”的createDialog()方法中引用了Util类来找出要装饰AlertDialogBu​​ilder<的主题/strong> 与。

SMALI :

 .line 2507
    new-instance v0, Landroid/app/AlertDialog$Builder;

    iget-object v2, p0, Lcom/sonyericsson/home/HomeActivity$SortDialog;->this$0:Lcom/sonyericsson/home/HomeActivity;

    iget-object v3, p0, Lcom/sonyericsson/home/HomeActivity$SortDialog;->this$0:Lcom/sonyericsson/home/HomeActivity;

    invoke-virtual {v3}, Lcom/sonyericsson/home/HomeActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    invoke-static {v3}, Lcom/sonyericsson/home/bidi/Utils;->getDialogAlertThemeStyle(Landroid/content/Context;)I

    move-result v3

    invoke-direct {v0, v2, v3}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;I)V

或者在 Java 中,

int i = Utils.getDialogAlertThemeStyle(HomeActivity.this.getApplicationContext());

它们的 Utils 类然后检查要应用于 SortDialog 的已保存主题。由于主题未设置(我怎么不知道?),它返回 0 或 -1 的 int(不确定)。

public static final int getDialogAlertThemeStyle(Context paramContext)
  {
    if ((sReflectionOk) && (isRtlAlphabet(paramContext)));
    for (int i = sThemeBidiDialogAlert; ; i = sThemeDialogAlert)
      return i;
  }

  public static final boolean isRtlAlphabet(Context paramContext)
  {
    int i = 0;
    if (sReflectionOk);
    try
    {
      Resources localResources = paramContext.getResources();
      int j = **sRtlAlphabetField**;
      boolean bool = localResources.getBoolean(j);
      i = bool;
      return i;
    }
    catch (Resources.NotFoundException localNotFoundException)
    {
      while (true)
        LogUtil.reportError("Bidi", "Get rtl alphabet resource failed", localNotFoundException);
    }
  }

j 是返回的内容,并且 sRtlAlphabetField 未正确初始化,我猜您会

**sRtlAlphabetField** = Class.forName("com.android.internal.R$bool").getField("alphabet_isRtl").getInt(null);

看到上面的调用正在调用在启动器的 Android R.java 文件中找到的 Alphabet_isRtl 的资源 id 。它一定不能返回有效的资源标识符,因此为什么当 Util 方法返回 -1 时?或 0 无法使用给定的 int 参数创建 AlertDialog 的新实例。输出 HomeActivity$SortDialog 或 Util 类中 i 的值的简单日志行将向您显示它尝试用作主题值的内容,无论哪种方式,它都可能是 Gumpf。

这可能是一个漫长的过程,但我很确定这就是发生此问题的原因,并且您希望在 AddToStageDialog、PickActivityDialog、AddDialog 和 SortDialog“onCreate() 方法中出现此错误。

因为它们都调用相同的方法line :

int i = Utils.getDialogAlertThemeStyle(HomeActivity.this.getApplicationContext());

我猜解决方案是编辑以下内容的 SMALI 类:AddToStageDialog、PickActivityDialog、AddDialog 和 SortDialog,以便它们使用构造函数创建 AlertDialog.Builder只需将上下文作为参数即可,

AlertDialog.Builder localBuilder1 = new AlertDialog.Builder(localHomeActivity);

如果没有主题部分,您可能会到处寻找类似的调用,

您好运!

祝 编辑后的 ​​smali 代码是:

from:

invoke-direct {v0, v2, v3}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;I)V

to:

invoke-direct {v0, v2}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

在我上面提到的对话框类中执行此操作,它将解决问题:)

When decompiled you'll find that in the createDialog() method of the SortDialog inner class "HomeActivity$SortDialog.smali" is referencing the Util class to find out what theme to decorate the AlertDialogBuilder with.

SMALI :

 .line 2507
    new-instance v0, Landroid/app/AlertDialog$Builder;

    iget-object v2, p0, Lcom/sonyericsson/home/HomeActivity$SortDialog;->this$0:Lcom/sonyericsson/home/HomeActivity;

    iget-object v3, p0, Lcom/sonyericsson/home/HomeActivity$SortDialog;->this$0:Lcom/sonyericsson/home/HomeActivity;

    invoke-virtual {v3}, Lcom/sonyericsson/home/HomeActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    invoke-static {v3}, Lcom/sonyericsson/home/bidi/Utils;->getDialogAlertThemeStyle(Landroid/content/Context;)I

    move-result v3

    invoke-direct {v0, v2, v3}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;I)V

or in Java

int i = Utils.getDialogAlertThemeStyle(HomeActivity.this.getApplicationContext());

Their Utils class then checks the saved theme in which it is to apply to the SortDialog. Since the theme isn't set (how I don't know?) it returns back an int of 0 or -1 (not sure).

public static final int getDialogAlertThemeStyle(Context paramContext)
  {
    if ((sReflectionOk) && (isRtlAlphabet(paramContext)));
    for (int i = sThemeBidiDialogAlert; ; i = sThemeDialogAlert)
      return i;
  }

  public static final boolean isRtlAlphabet(Context paramContext)
  {
    int i = 0;
    if (sReflectionOk);
    try
    {
      Resources localResources = paramContext.getResources();
      int j = **sRtlAlphabetField**;
      boolean bool = localResources.getBoolean(j);
      i = bool;
      return i;
    }
    catch (Resources.NotFoundException localNotFoundException)
    {
      while (true)
        LogUtil.reportError("Bidi", "Get rtl alphabet resource failed", localNotFoundException);
    }
  }

j is what is being returned and the sRtlAlphabetField was not initialized properly I'm guessing

**sRtlAlphabetField** = Class.forName("com.android.internal.R$bool").getField("alphabet_isRtl").getInt(null);

You see that call above is calling for the resource id of alphabet_isRtl which is found in the Android R.java file of the launcher. It mustn't be getting back a valid resource identifier hence why when the Util method returns -1? or 0 it is unable to create a new instance of the AlertDialog with the given int param. A simple log line to output the value of either i in the HomeActivity$SortDialog or Util class would show you what it's trying to use as the theme value, either way it's probably gumpf.

This may be a long shot but I'm pretty sure that's why this issue is occurring and you'd expect to have this error in the AddToStageDialog, PickActivityDialog, AddDialog and SortDialog "onCreate() methods.

Since they're all calling the same line :

int i = Utils.getDialogAlertThemeStyle(HomeActivity.this.getApplicationContext());

I'm guessing the solution would be to edit the SMALI classes for : AddToStageDialog, PickActivityDialog, AddDialog and SortDialog so that they create an AlertDialog.Builder using the constructor that just takes the context as the parameter.

i.e

AlertDialog.Builder localBuilder1 = new AlertDialog.Builder(localHomeActivity);

That may do it but without the theming part you may be hunting for similar calls like this all over the place.

Good luck!

Edit : I tested this myself and I've got it working, the edited smali code is :

from:

invoke-direct {v0, v2, v3}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;I)V

to:

invoke-direct {v0, v2}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

Do this in the dialog classes I mentioned above and it will solve the problem :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文