@@ -0,0 +1,1464 @@
+/**%0A * Copyright (c) 2015-present, Facebook, Inc.%0A * All rights reserved.%0A *%0A * This source code is licensed under the BSD-style license found in the%0A * LICENSE file in the root directory of this source tree. An additional grant%0A * of patent rights can be found in the PATENTS file in the same directory.%0A */%0A%0Apackage com.facebook.react.uimanager;%0A%0Aimport javax.annotation.Nullable;%0A%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0A%0Aimport com.facebook.react.bridge.UiThreadUtil;%0A%0Aimport org.json.JSONArray;%0Aimport org.json.JSONException;%0Aimport org.json.JSONObject;%0A%0Apublic class ViewHierarchyDumper %7B%0A%0A  public static @Nullable JSONObject toJSON(@Nullable View view) %7B%0A    UiThreadUtil.assertOnUiThread();%0A    if (view == null) %7B%0A      return null;%0A    %7D%0A    JSONObject result = new JSONObject();%0A    try %7B%0A      result.put(%22class%22, view.getClass().getSimpleName());%0A      Object tag = view.getTag();%0A      if (tag != null && tag instanceof String) %7B%0A        result.put(%22id%22, tag);%0A      %7D%0A      if (view instanceof ViewGroup) %7B%0A        ViewGroup viewGroup = (ViewGroup) view;%0A        if (viewGroup.getChildCount() %3E 0) %7B%0A          JSONArray children = new JSONArray();%0A          for (int i = 0; i %3C viewGroup.getChildCount(); i++) %7B%0A            children.put(i, toJSON(viewGroup.getChildAt(i)));%0A          %7D%0A          result.put(%22children%22, children);%0A        %7D%0A      %7D%0A    %7D catch (JSONException ex) %7B%0A      return null;%0A    %7D%0A    return result;%0A  %7D%0A%7D%0A

Add ability to dump a Native View Hierarchy