Categories
爪机爪机

HTC Droid DNA无法开启Wifi 热点的问题的解决方案(不存在VZW UICC)

原创内容,转载请务必注明本博文地址

http://blog.dayandcarrot.net/2013/06/htc-droid-dna-wifi-ap-problem/

/system/app/WifiRounter.apk里面找到了点线索,这个程序是负责WifiAP的,但是它不掌权,还需要向一个WifiService去Request开启WiFiAP,如果不行就通过TetheringGuard.apk提示出错,然后就有了错误信息,不存在VZW UICC之类的。
一开始我以为WifiService是掌权的,里面有个CustomUtils很是可疑,但是修改之后发现没用。
之后根据Logcat找哪里出了问题,发现有错误提示说什么DENY之类的,发出log的tag叫WifiService。想了一下可能这个东西在/system/framework/services.jar里面,解包了一下果然如此。
然后就是修改过程了,里面有个方法叫
.method private setWifiApMhsRequest(ZZILandroid/net/wifi/WifiConfiguration;)Z
翻译成Java代码差不多这样(感谢Java Decompiler):
 

private boolean setWifiApMhsRequest(boolean paramBoolean1, boolean paramBoolean2, int paramInt, WifiConfiguration paramWifiConfiguration)
  {
    Slog.e("WifiService", "setWifiApMhsRequest enter");
    boolean bool;
    if (SystemProperties.get("net.frisbee.enabled", "0").equals("1"))
    {
      Slog.e("WifiService", "ignore MHS for Frisbee");
      setParameterMHS(paramBoolean1, paramBoolean2, paramInt, paramWifiConfiguration);
      this.mWifiApMhsPermission = true;
      this.mProcessingMHS = false;
      checkWifiApRemindDialog();
      bool = true;
    }
    while (true)
    {
      return bool;
      if ((this.mProcessingMHS == true) && (paramBoolean1 == true))
      {
        Slog.e("WifiService", "MHS is processing");
        bool = false;
      }
      else if ((this.mEnableMhsFeature) && (!paramBoolean1))
      {
        this.mWifiApMhsPermission = false;
        this.mProcessingMHS = false;
        setWifiApEnabled(null, false);
        bool = true;
      }
      else
      {
        setParameterMHS(paramBoolean1, paramBoolean2, paramInt, paramWifiConfiguration);
        this.mCm = ((ConnectivityManager)this.mContext.getSystemService("connectivity"));
        this.mMhsStatus = this.mCm.htcRequestPermittedTether(-19, -1, null);
        if (this.mMhsStatus == 0)
        {
          Slog.e("WifiService", "MHS HTC_PERMITTED_TETHER_ALLOW");
          this.mWifiApMhsPermission = true;
          this.mProcessingMHS = false;
          checkWifiApRemindDialog();
        }
        label236:
        do
          while (true)
          {
            bool = true;
            break;
            if (this.mMhsStatus != 1)
              break label236;
            Slog.e("WifiService", "MHS HTC_PERMITTED_TETHER_DENY");
            this.mWifiApMhsPermission = false;
            this.mProcessingMHS = false;
          }
        while (this.mMhsStatus != 2);
        Slog.e("WifiService", "MHS HTC_PERMITTED_TETHER_PROGRASSING");
        this.mWifiApMhsPermission = false;
        bool = false;
      }
    }
  }

然后里面有个不知道什么东西的特权参数,叫做

net.frisbee.enabled

如果这个的值是1的话,那么就直接给权限,显然我们要做的任务很简单
把那个.equals(“1”)改成”0″就行啦~
改完了之后差不多这样:

    .line 4506
    const-string v0, "net.frisbee.enabled"
    const-string v3, "0"
    invoke-static {v0, v3}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    move-result-object v0
    #const-string v3, "1"
#MODIFIED
    const-string v3, "0"
    invoke-virtual {v0, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    move-result v0
    if-eqz v0, :cond_2d
    .line 4507
    const-string v0, "WifiService"
    const-string v3, "ignore MHS for Frisbee"
    invoke-static {v0, v3}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I

回编译回去就搞定了~
刚好2点,继续复习操作系统软

One reply on “HTC Droid DNA无法开启Wifi 热点的问题的解决方案(不存在VZW UICC)”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.