title: Displaying logs in Android Studio by adding code to Smali
body: <p>In a decompiled application, I am trying to insert the information output into the logcat, but I can not figure out what I am doing wrong.</p>
  <p>There is a code that displays the version number in the application, when the condition changes, I get the information I need in the application, but I cannot get it in the logcat</p>
  <pre><code>.method private F()V
  .locals 4
  
  .line 2
  invoke-direct {p0}, Lcom/xiaoxun/xun/activitys/SystemUpdateActivity;-&gt;J()V
  
  .line 3
  invoke-direct {p0}, Lcom/xiaoxun/xun/activitys/SystemUpdateActivity;-&gt;K()V
  
  .line 4
  invoke-virtual {p0}, Landroid/app/Activity;-&gt;getApplicationContext()Landroid/content/Context;
  
  move-result-object v0
  
  invoke-static {v0}, Lcom/xiaoxun/xun/J;-&gt;a(Landroid/content/Context;)Lcom/xiaoxun/xun/J;
  
  move-result-object v0
  
  invoke-virtual {v0}, Lcom/xiaoxun/xun/J;-&gt;a()Ljava/lang/String;
  
  move-result-object v0
  
  .line 5
  new-instance v1, Ljava/lang/StringBuilder;
  
  invoke-direct {v1}, Ljava/lang/StringBuilder;-&gt;&lt;init&gt;()V
  
  const v2, 0x7f0e0205
  
  .line 6
  invoke-virtual {p0, v2}, Landroid/app/Activity;-&gt;getString(I)Ljava/lang/String;
  
  move-result-object v3
  
  invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;-&gt;append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  
  .line 7
  invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;-&gt;append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  
  .line 8
  iget-object v0, p0, Lcom/xiaoxun/xun/activitys/SystemUpdateActivity;-&gt;z:Landroid/widget/TextView;
  
  invoke-virtual {v1}, Ljava/lang/StringBuilder;-&gt;toString()Ljava/lang/String;
  
  move-result-object v1
  
  invoke-virtual {v0, v1}, Landroid/widget/TextView;-&gt;setText(Ljava/lang/CharSequence;)V
  
  .line 9
  iget-object v0, p0, Lcom/xiaoxun/xun/activitys/NormalActivity;-&gt;a:Lcom/xiaoxun/xun/ImibabyApp;
  
  invoke-virtual {v0}, Lcom/xiaoxun/xun/ImibabyApp;-&gt;getCurUser()Lcom/xiaoxun/xun/beans/u;
  
  move-result-object v0
  
  invoke-virtual {v0}, Lcom/xiaoxun/xun/beans/u;-&gt;j()Lcom/xiaoxun/xun/beans/H;
  
  move-result-object v0
  
  if-nez v0, :cond_0
  
  return-void
  
  .line 10
  :cond_0
  iget-object v0, p0, Lcom/xiaoxun/xun/activitys/NormalActivity;-&gt;a:Lcom/xiaoxun/xun/ImibabyApp;
  
  invoke-virtual {v0}, Lcom/xiaoxun/xun/ImibabyApp;-&gt;getCurUser()Lcom/xiaoxun/xun/beans/u;
  
  move-result-object v0
  
  invoke-virtual {v0}, Lcom/xiaoxun/xun/beans/u;-&gt;j()Lcom/xiaoxun/xun/beans/H;
  
  move-result-object v0
  
  invoke-virtual {v0}, Lcom/xiaoxun/xun/beans/H;-&gt;D()Ljava/lang/String;
  
  move-result-object v0
  
  invoke-static {v0}, Lcom/xiaoxun/xun/utils/LogUtil;-&gt;v(Ljava/lang/String;)V
  invoke-static {v0}, Lcom/xiaoxun/xun/utils/LogUtil;-&gt;i(Ljava/lang/String;)V
  invoke-static {v0}, Lcom/xiaoxun/xun/utils/LogUtil;-&gt;d(Ljava/lang/String;)V
  invoke-static {v0}, Lcom/xiaoxun/xun/utils/LogUtil;-&gt;e(Ljava/lang/String;)V
  invoke-static {v0}, Lcom/xiaoxun/xun/utils/LogUtil;-&gt;w(Ljava/lang/String;)V
  
  if-eqz v0, :cond_1
  
  .line 11
  invoke-virtual {v0}, Ljava/lang/String;-&gt;length()I
  
  move-result v1
  
  const/16 v3, 0x20
  
  if-le v1, v3, :cond_1
  
  const/16 v1, 0xf
  
  const/16 v3, 0x17
  
  .line 12
  invoke-virtual {v0, v1, v3}, Ljava/lang/String;-&gt;substring(II)Ljava/lang/String;
  
  move-result-object v0
  
  .line 13
  :cond_1
  new-instance v1, Ljava/lang/StringBuilder;
  
  invoke-direct {v1}, Ljava/lang/StringBuilder;-&gt;&lt;init&gt;()V
  
  .line 14
  invoke-virtual {p0, v2}, Landroid/app/Activity;-&gt;getString(I)Ljava/lang/String;
  
  move-result-object v2
  
  invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;-&gt;append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  
  if-eqz v0, :cond_2
  
  .line 15
  invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;-&gt;append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  
  .line 16
  :cond_2
  iget-object v0, p0, Lcom/xiaoxun/xun/activitys/SystemUpdateActivity;-&gt;A:Landroid/widget/TextView;
  
  invoke-virtual {v1}, Ljava/lang/StringBuilder;-&gt;toString()Ljava/lang/String;
  
  move-result-object v1
  
  invoke-virtual {v0, v1}, Landroid/widget/TextView;-&gt;setText(Ljava/lang/CharSequence;)V
  
  .line 17
  iget-object v0, p0, Lcom/xiaoxun/xun/activitys/SystemUpdateActivity;-&gt;aa:Ljava/lang/String;
  
  if-nez v0, :cond_3
  
  .line 18
  iget-object v0, p0, Lcom/xiaoxun/xun/activitys/SystemUpdateActivity;-&gt;t:Landroid/widget/Button;
  
  const/4 v1, 0x4
  
  invoke-virtual {v0, v1}, Landroid/widget/Button;-&gt;setVisibility(I)V
  
  :cond_3
  return-void
  </code></pre>
  <p>.end method</p>
  <p>I have used all possible levels of log output, but none of them are displayed in the logcat. Although in the application, the string has a textual meaning.</p>
  <pre><code>    public void m11F() {
      m19J();
      m21K();
      String a = J.a(getApplicationContext()).a();
      this.f65z.setText(getString(2131624453) + a);
      if (((NormalActivity) this).a.getCurUser().j() != null) {
          String D = ((NormalActivity) this).a.getCurUser().j().D();
          LogUtil.v(D);
          LogUtil.i(D);
          LogUtil.d(D);
          LogUtil.e(D);
          LogUtil.w(D);
          if (D != null &amp;&amp; D.length() &gt; 32) {
              D = D.substring(15, 23);
          }
          StringBuilder sb = new StringBuilder();
          sb.append(getString(2131624453));
          if (D != null) {
              sb.append(D);
          }
          this.f2A.setText(sb.toString());
          if (this.f28aa == null) {
              this.f59t.setVisibility(4);
          }
      }
  }
  </code></pre>