Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void setPrivateValueBoth(Class var0, Object var1, String obf, String mcp, Object var3) {
- try {
- try {
- setPrivateValue(var0, var1, obf, var3);
- } catch (NoSuchFieldException ex) {
- setPrivateValue(var0, var1, mcp, var3);
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- public static Object getPrivateValueBoth(Class var0, Object var1, String obf, String mcp) {
- try {
- try {
- return getPrivateValue(var0, var1, obf);
- } catch (NoSuchFieldException ex) {
- return getPrivateValue(var0, var1, mcp);
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- return null;
- }
- public static Object getPrivateValue(Class class1, Object obj, int i)
- throws IllegalArgumentException, SecurityException, NoSuchFieldException
- {
- try
- {
- Field field = class1.getDeclaredFields()[i];
- field.setAccessible(true);
- return field.get(obj);
- }
- catch (IllegalAccessException illegalaccessexception)
- {
- ThrowException("An impossible error has occured!", illegalaccessexception);
- return null;
- }
- }
- public static Object getPrivateValue(Class class1, Object obj, String s)
- throws IllegalArgumentException, SecurityException, NoSuchFieldException
- {
- try
- {
- Field field = class1.getDeclaredField(s);
- field.setAccessible(true);
- return field.get(obj);
- }
- catch (IllegalAccessException illegalaccessexception)
- {
- ThrowException("An impossible error has occured!", illegalaccessexception);
- return null;
- }
- }
- public static void setPrivateValue(Class class1, Object obj, int i, Object obj1)
- throws IllegalArgumentException, SecurityException, NoSuchFieldException
- {
- try
- {
- Field field = class1.getDeclaredFields()[i];
- field.setAccessible(true);
- int j = field_modifiers.getInt(field);
- if ((j & 0x10) != 0)
- {
- field_modifiers.setInt(field, j & 0xffffffef);
- }
- field.set(obj, obj1);
- }
- catch (IllegalAccessException illegalaccessexception)
- {
- ThrowException("An impossible error has occured!", illegalaccessexception);
- }
- }
- public static void setPrivateValue(Class class1, Object obj, String s, Object obj1)
- throws IllegalArgumentException, SecurityException, NoSuchFieldException
- {
- try
- {
- Field field = class1.getDeclaredField(s);
- int i = field_modifiers.getInt(field);
- if ((i & 0x10) != 0)
- {
- field_modifiers.setInt(field, i & 0xffffffef);
- }
- field.setAccessible(true);
- field.set(obj, obj1);
- }
- catch (IllegalAccessException illegalaccessexception)
- {
- ThrowException("An impossible error has occured!", illegalaccessexception);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement