private JSONObject dumpStructureWindow( AssistStructure.WindowNode window, JSONObject json) throws JSONException { json.put("displayId", wrap(window.getDisplayId())); json.put("height", wrap(window.getHeight())); json.put("left", wrap(window.getLeft())); json.put("title", wrap(window.getTitle())); json.put("top", wrap(window.getTop())); json.put("width", wrap(window.getWidth())); json.put("root", dumpStructureNode(window.getRootViewNode(), new JSONObject())); return (json); }
protected JSONObject dumpStructureWindow( AssistStructure.WindowNode window, JSONObject json) throws JSONException { json.put("displayId", wrap(window.getDisplayId())); json.put("height", wrap(window.getHeight())); json.put("left", wrap(window.getLeft())); json.put("title", wrap(window.getTitle())); json.put("top", wrap(window.getTop())); json.put("width", wrap(window.getWidth())); json.put("root", dumpStructureNode(window.getRootViewNode(), new JSONObject())); return(json); }
Result parse() { result = new Result(); usernameCandidate = null; for (int i=0; i<structure.getWindowNodeCount(); ++i) { AssistStructure.WindowNode windowNode = structure.getWindowNodeAt(i); result.title.add(windowNode.getTitle()); result.webDomain.add(windowNode.getRootViewNode().getWebDomain()); parseViewNode(windowNode.getRootViewNode()); } // If not explicit username field found, add the field just before password field. if (result.username.isEmpty() && result.email.isEmpty() && !result.password.isEmpty() && usernameCandidate != null) result.username.add(usernameCandidate); return result; }