title: Frida - access to a class attribute that has the desired type
body: <p>I have an android program that has been obfuscated. And in this program classes have attributes with the same name.
  Decompiled code like this</p>
  
  <pre><code>public class d implements c
  {
      public int a;
      public Cache$Entry a;
      public Cache a;
      public volatile a a;
      public e a;
      public ByteArrayOutputStream a;
      public volatile AtomicBoolean a;
  </code></pre>
  
  <p>or smali code like this</p>
  
  <pre><code># interfaces
  .implements Le/a/x/c;
  # instance fields
  .field public a:I
  .field public a:Lanetwork/channel/cache/Cache$Entry;
  .field public a:Lanetwork/channel/cache/Cache;
  .field public volatile a:Ld/a/w/a;
  .field public a:Le/a/x/e;
  .field public a:Ljava/io/ByteArrayOutputStream;
  .field public volatile a:Ljava/util/concurrent/atomic/AtomicBoolean;  
  </code></pre>
  
  <p>I create a hook to one method asd() and i need to access to attribute "a" of this class. But I need attribute "a" with type "e.a.x.e"</p>
  
  <pre><code>Java.perform(function () {
     var var_ddd = Java.use("e.a.x.d");
      var_ddd.asd.implementation = function() {
         this.asd();
         console.log("e.a.x.d.asd()",Java.cast(this.a.value,Java.use("e.a.x.e")));
      };
  });
  </code></pre>
  
  <p>When I try to write this.a.value - I get a wrong attribute.
  When I write Java.cast(this.a.value,Java.use("e.a.x.e"))
  I get message</p>
  
  <pre><code>TypeError: cannot read property 'hasOwnProperty' of undefined
  </code></pre>
  
  <p>Please tell me how to get the right attribute with the right type</p>