Menu

#668 reflection method has been shrinked

v5.3.3
closed-fixed
None
9
2018-02-05
2017-11-09
No

method testForReflaction called by reflection,no other call,but testForReflaction will be skrinked,testForReflaction should not be shrinked,right?

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
 //  System.err.println(getTestData().toString());
    setContentView(R.layout.activity_main3);
    try {
        Class clazz= Class.forName("com.test.TmpUtils");
    Method method= clazz.getDeclaredMethod("testForReflaction",null);
    method.invoke(null,null);

    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    }
    }

Discussion

  • Eric Lafortune

    Eric Lafortune - 2017-11-12

    ProGuard 6.0 beta1 recognizes this construct. You can download its zip file from https://sourceforge.net/projects/proguard/files

    ProGuard 5.3.3 recognizes the construct if you replace the argument "null" by "new Class[0]".

     
  • Eric Lafortune

    Eric Lafortune - 2017-11-12
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     method testForReflaction called by reflection,no other call,but testForReflaction will be skrinked,testForReflaction should not be shrinked,right?
    
         @Override
    
    • status: open --> open-fixed
    • assigned_to: Eric Lafortune
     
  • Eric Lafortune

    Eric Lafortune - 2018-02-05
    • Status: open-fixed --> closed-fixed
     

Log in to post a comment.