FrenchYeti / dexcalibur

[Official] Android reverse engineering tool focused on dynamic instrumentation automation leveraging Frida. It disassembles dex, analyzes it statically, generates hooks, discovers reflected methods, stores intercepted data and does new things from it. Its aim is to be an all-in-one Android reverse engineering platform.
Apache License 2.0
1.06k stars 126 forks source link

DeviceManager: Fix updateDeviceList() #58

Closed mgp25 closed 3 years ago

mgp25 commented 3 years ago

Env

Expected behaviour

Actual behaviour

Issue

...
            if(this.devices[i].id=="<pending...>"){
                for(let k in this.devices[i].bridges){
                    b = this.devices[i].bridges[k];
                    if(b.isNetworkTransport()){
                        d = this.getDeviceByIP(b.ip, b.port, false);
                        if(d == null){
                            devs[this.devices[i].uid] = this.devices[i];
                        }
                    }else{
                        d = this.getDeviceByID(b.deviceID);

                        if(d == null){
                            devs[this.devices[i].uid] = this.devices[i];
                        }
                    }
                }
....

As seen in above piece of code, when doing d = this.getDeviceByIP(b.ip, b.port, false); afterwards d wont have a null value, but since the if statement is set to == null, the device wont be added to the active devices list.

Solution

The solution is easy, as proposed in this pull request, just needs to update the if statement to != null.

CC: @cryptax

FrenchYeti commented 3 years ago

Very thank you for debug and patch :)