Giter VIP home page Giter VIP logo

Comments (11)

danielpaulus avatar danielpaulus commented on May 18, 2024 1

Haha no worries. It's a hobby project so I enjoy spending some extra time :-D

from go-ios.

danielpaulus avatar danielpaulus commented on May 18, 2024

Interestimg, which device and which ios version is that?

from go-ios.

shamanec avatar shamanec commented on May 18, 2024

iPhone SE, iOS 13.5.1, Ubuntu 18.04.5 LTS

from go-ios.

danielpaulus avatar danielpaulus commented on May 18, 2024

I can actually reproduce it on my iphone 5s with iOS 12, should be an easy fix but I see you sent a PR already

from go-ios.

danielpaulus avatar danielpaulus commented on May 18, 2024

The issue is actually here:

You can see that I am getting a dictionary or map[string] interface{} as response from the device

signatures, ok := resp["ImageSignature"]
	if !ok {
		return nil, fmt.Errorf("invalid response: %+v", signatures)
	}

and I am expecting it to contain an ImageSignature array.
For iOS 14 and above this seems to work. Apparently in earlier versions of iOS that dictionary did not exist in the response and you just get an empty response back.
If you can set a breakpoint at line 60 and try with two different iOS devices, one on iOS 14+ and one with iOS 12/13 you will see what I mean.

For a fix, I would grab the version of the device first and then modify the code to treat devices depending on their version.

from go-ios.

shamanec avatar shamanec commented on May 18, 2024

:D I wish I knew how to debug this project but I'll check how it happens :P But what you are saying makes sense, you can reject my PR, unfortunately I have only device available so I can't do very comprehensive testing :( Can you explain to me why it returns proper response when there are images but empty response when there are none? What exactly is missing in the case without images?

from go-ios.

danielpaulus avatar danielpaulus commented on May 18, 2024

What IDE are you using?
You should really attend my Appium talk next month :-D I will talk a bit about how to use dproxy.
Ah ok if you have only one device than this will be hard to test. Luckily I kept a few old iPhones my wife had years ago around and have a new iPhone 12.

Both responses are proper, it is just that Apple changes their interfaces now and then.
For iOS 13 and below if you send the LookupImage request, you receive an empty dictionary.
For iOS 14+ you receive a dictionary that contains one key "ImageSignature" containing an array with signatures that will be empty if no images are installed.

I usually write my code in a fail fast manner to prevent inexplicable or unpredictable behavior, so if anything unexpected happens it immediately fails. That makes it easier to quickly find errors and fix them properly.

from go-ios.

shamanec avatar shamanec commented on May 18, 2024

I am using Visual Studio Code but I don't actually run the project through it, I just use 'go build' to make the executable and test with it ( this is as far as my current Go knowledge goes :D ) I am inclined to try and contribute to the project but it will probably take me months to understand everything and do something on my own :) Maybe I should just go and find one more second hand device to test on at least 14+. Thank you for the comprehensive answer! About the Appium talk - how can I attend it?

from go-ios.

danielpaulus avatar danielpaulus commented on May 18, 2024

I'll be at Appium Conf https://appiumconf.com/
but since you are a sponsor we can also have a zoom chat or sth.
Happy to explain a little more on how this actually works.

I can write a quick fix for the image mounting issue btw. This will take like 5 minutes so I can do it later today after work.

from go-ios.

shamanec avatar shamanec commented on May 18, 2024

Fixing this will be great, I can keep working without updating my iPhone yet :D I'll do my best to attend the conf, wasn't actually aware it is happening so thanks for the notice. If you are willing to explain a little more that will be great but please only on your own accord, since using up your time because I give you 10$ makes me feel bad :D

from go-ios.

shamanec avatar shamanec commented on May 18, 2024

Seems to work as expected - thanks a bunch!

from go-ios.

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.