diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index 53ee3d29..50be8f64 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -281,7 +281,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList username+="@"+AccountSessionManager.getInstance().getAccount(accountID).domain; } getActivity().getSystemService(ClipboardManager.class).setPrimaryClip(ClipData.newPlainText(null, "@"+username)); - if(Build.VERSION.SDK_INT props=Class.forName("android.os.SystemProperties"); + Method get=props.getMethod("get", String.class); + return (String)get.invoke(null, key); + }catch(Exception ignore){} + return null; + } + + public static boolean isMIUI(){ + return !TextUtils.isEmpty(getSystemProperty("ro.miui.ui.version.code")); + } }