title: Smali type cast to primitive type
body: <p>I get the following dalvikvm verifier error:</p>
  
  <pre><code>Line 1041: W/dalvikvm( 2610): VFY: register1 v5 type 13, wanted 5
  Line 1042: W/dalvikvm( 2610): VFY:  rejecting opcode 0x70 at 0x0032
  Line 1043: W/dalvikvm( 2610): VFY:  rejected Lcom/cleanmaster/notification/aj;.b 
  </code></pre>
  
  <p>Smali code:</p>
  
  <pre><code>.method private b(Lcom/cleanmaster/notification/normal/NotificationSetting;Lcom/cleanmaster/notification/normal/o;Landroid/widget/RemoteViews;)V
  .registers 11
  .prologue
  const/4 v5, 0x1
  .line 126
  iget-object v0, p2, Lcom/cleanmaster/notification/normal/o;-&gt;s:Landroid/content/Intent;
  if-eqz v0, :cond_c
  .line 127
  iget-object v0, p2, Lcom/cleanmaster/notification/normal/o;-&gt;s:Landroid/content/Intent;
  .line 128
  const-string v1, "notify_style_type"
  .line 129
  invoke-static {v5}, Ljava/lang/Byte;-&gt;valueOf(B)Ljava/lang/Byte;
  move-result-object v5
  const-string v6, "putExtra(Ljava/lang/String;B)Landroid/content/Intent;"
  invoke-static {v6, v0, v1, v5}, La;-&gt;c(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
  invoke-virtual {v5}, Ljava/lang/Byte;-&gt;byteValue()B
  move-result v5
  :cond_c
  .line 130
  invoke-static {}, Lcom/keniu/security/c;-&gt;a()Landroid/content/Context;
  move-result-object v1
  .line 131
  const-string v0, "notification"
  .line 132
  const-string v6, "getSystemService(Ljava/lang/String;)Ljava/lang/Object;"
  invoke-static {v6, v1, v0}, Lb;-&gt;a(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
  move-result-object v6
  check-cast v6, Ljava/lang/Object;
  move-object v0, v6
  check-cast v0, Landroid/app/NotificationManager;
  iget-boolean v2, p1, Lcom/cleanmaster/notification/normal/NotificationSetting;-&gt;i:Z
  iget-boolean v3, p1, Lcom/cleanmaster/notification/normal/NotificationSetting;-&gt;o:Z
  .line 133
  invoke-direct {p0, v1, p2, v2, v3}, Lcom/cleanmaster/notification/aj;-&gt;a(Landroid/content/Context;Lcom/cleanmaster/notification/normal/o;ZZ)Landroid/app/Notification;
  move-result-object v2
  iget v3, p2, Lcom/cleanmaster/notification/normal/o;-&gt;d:I
  const/4 v4, 0x0
  .line 134
  invoke-direct {p0, v3, v4, v5}, Lcom/cleanmaster/notification/aj;-&gt;a(IZZ)I
  </code></pre>
  
  <p>It looks to me like the last invoke-direct parameter v5 is a problem. Somehow dalvik things its not a primitive type and therefore cannot be cast to boolean. Altough there is a:</p>
  
  <pre><code>invoke-virtual {v5}, Ljava/lang/Byte;-&gt;byteValue()B
  move-result v5
  </code></pre>
  
  <p>Is there a check-cast missing?</p>