Giter VIP home page Giter VIP logo

Comments (8)

H4oK3 avatar H4oK3 commented on June 8, 2024

Hey, I don't think that matters; it is in the loop and the temporary variable name should not matter. Let me know if you can find a case it is giving you the wrong outputs, otherwise I would just close the issue.
Also an issue with one line of word really confused me at the first place, I did not even know what are you talking about at the first place.

from house.

howmp avatar howmp commented on June 8, 2024

{{ method_hook }} variable will always the last of overloads

If print the argumentTypes in implementation function

{{method_hook}}.argumentTypes.map(function(t){
    console.log(t.className)
}

With different overloads,the output always the last overload's argumentTypes

from house.

H4oK3 avatar H4oK3 commented on June 8, 2024

Yes if u print them out; but it is a temp variable and not being used anywhere. If you want to print out the individual ones; you can add the print in the for loop. Am I making sense here? I am not sure what problem it is causing you, but House does not reuse the same overloaded function.

from house.

howmp avatar howmp commented on June 8, 2024

In House hook,the argType is javascript's type in sendback.

It should print java type for sendback,but can't use {{method_hook}}

from house.

H4oK3 avatar H4oK3 commented on June 8, 2024

That is also wrapped IN the for loop; in the example APK testing; it is returning the correct arg type and return type for each overloaded function. Did you try that? Can you give me a solid example showing House is returning something wrong?

from house.

howmp avatar howmp commented on June 8, 2024

java.security.MessageDigest.update with 4 overload, try to hook it.

Call with each overload in APK, and print argumentTypes[index].className.

You will see what's wrong.

var a = [{
  cb:null,
  name:"name1"
},{
  cb:null,
  name:"name2"
}]

for(var i=0;i<a.length;i++){
  var method = a[i].name;
  a[i].cb = function(){
    console.log(method)
  }
}

a[0].cb()
a[1].cb()
// output :
// name2
// name2

from house.

howmp avatar howmp commented on June 8, 2024

The example with right way

var a = [{
  cb: null,
  name: "name1"
}, {
  cb: null,
  name: "name2"
}]

for (var i = 0; i < a.length; i++) {
  var method = a[i].name;
  a[i].cb = function (name) {
    return function () {
      console.log(name)
    }
  }(method)
}

a[0].cb()
a[1].cb()
// output :
// name1
// name2

from house.

H4oK3 avatar H4oK3 commented on June 8, 2024

I know what are you talking about; the thing is House does not use a[i] outside the for loop; it is a temporary variable and is not carry on for further use; if what you need is to print it out; print it out in the loop where the temporary variable is assigned the correct value;

But I can see a possible downside is; if you want to use a[i] as not only a temporary variable; I can update it a bit so it would be easier for you. Nevertheless; House is working fine at this point, a[i] value is not being carried on and all the return value/type are correct, because again, they are wrapped in the loop.

from house.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.