Skip to content

Conversation

@KingOfBrian
Copy link

This is not quite ready, and full of terrible python, but the basics are there. It's sort of comical how long it takes to run and the amount of commands sent to generate the output. But I think it will be helpful with some tuning. Any suggestions would be good to get.

It adds a pae command that prints out the accessibility tree starting from the current object. If the current object is a UIView, it will also traverse subviews to find accessibility elements, as I think that's what voice over is doing.

@KingOfBrian
Copy link
Author

I cleaned it up a bit, and I'm starting to like python. I moved some functions into helpers, as I think they're nice and re-usable, but whatever you want organization wise works for me.

Brian King added 2 commits November 21, 2014 10:00
@kastiglione
Copy link
Contributor

@KingOfBrian Argh, kind of forgot about this. I'll try to look at it soon. I'm no expert on accessibility so I kind of procrastinated 😞. Feel free to ping.

@KingOfBrian
Copy link
Author

No problem! The basic interplay with accessibility, is that if accessibilityElementCount != NSNotFound, traverse the accessibility tree, otherwise, traverse the subviews. This is the same method that voice over uses. It then print out every element, if isAccessibilityElement = YES, print the accessibilityLabel/Value, otherwise print out a no-op string.

If there's any other info you want, just ask!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a triple-space between the sentences, not sure if intended. One is the norm in Chisel.

@kastiglione
Copy link
Contributor

For anyone else looking, here's a compare view to see relevant changes in this diff:

facebook:master...KingOfBrian:feature/KingOfBrian/AccessibiltyTree

@KingOfBrian

  1. Can you merge in master for easier reviewing and so it can be merged when ready?
  2. Can you edit the summary to add some example output of the pae command?

As for the number of commands evaluated to get the output, one of the things Chisel does elsewhere is call private methods which generate similar output, and from there Chisel scrapes the output. Perhaps there's a private method that could be used to do some of the work that's being done in this PR. You could look at these headers for any leads: https://github.com/nst/iOS-Runtime-Headers. Turns out there's dozens if not hundreds of accessibility related methods in NSObject.

Along these lines, I've had the thought that Chisel could benefit from having a library of its own that would be dynamically loaded into the app so that the code we want evaluated is run more directly.

@kastiglione kastiglione mentioned this pull request Dec 10, 2014
@KingOfBrian
Copy link
Author

Hey @kastiglione , I did a number of updates to address most of your issues (I think). I'm a bit nervous about the integer fix, but I believe it's correct.

I searched the private headers and wasn't able to find one. That would of been nice!

@kastiglione
Copy link
Contributor

@KingOfBrian Is this pull request superseded by #70? Or is there functionality here that's missing in #70?

@kastiglione
Copy link
Contributor

Closing since I understand this to be superseded by #70. @KingOfBrian if this is incorrect, feel free to re-open.

Thanks so much for your time, effort and contribution! 💎

@KingOfBrian
Copy link
Author

Yea, no worries, glad we got something better in. I may add some thing to print out more information when I have some ax work, but thanks for following up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants