package com.mogo.cloud.util;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Devices {

    private static final String PROPERTIES = "android.os.SystemProperties";
    private static final String GSM_SERIAL = "gsm.serial";
    private static final String GET = "get";

    public static String getSn(){
        return getSystemProperties(GSM_SERIAL);
    }

    public static String getSystemProperties(String name ) {
        String value = "";
        try {
            Class< ? > c = Class.forName( PROPERTIES );
            Method get = c.getMethod( GET, String.class );
            value = (String) get.invoke( c, name );
        } catch ( ClassNotFoundException var3 ) {
            var3.printStackTrace();
        } catch ( NoSuchMethodException var4 ) {
            var4.printStackTrace();
        } catch ( InvocationTargetException var5 ) {
            var5.printStackTrace();
        } catch ( IllegalAccessException var6 ) {
            var6.printStackTrace();
        }
        return value;
    }
}
