WebParamsUtils.java 875 B

12345678910111213141516171819202122232425262728293031323334
  1. package com.cooleshow.base.utils;
  2. import android.text.TextUtils;
  3. import org.json.JSONArray;
  4. import org.json.JSONObject;
  5. /**
  6. * Author by pq, Date on 2022/11/4.
  7. */
  8. public class WebParamsUtils {
  9. public static boolean isCopyLink(JSONObject jsonObject) {
  10. try {
  11. JSONArray button = (JSONArray) jsonObject.opt("button");
  12. if (button != null && button.length() > 0) {
  13. String s = (String) button.get(0);
  14. return TextUtils.equals(s, "copy");
  15. }
  16. } catch (Exception e) {
  17. e.printStackTrace();
  18. }
  19. return false;
  20. }
  21. public static String getShareUrl(JSONObject jsonObject) {
  22. try {
  23. String url =jsonObject.optString("url");
  24. return url;
  25. } catch (Exception e) {
  26. e.printStackTrace();
  27. }
  28. return "";
  29. }
  30. }