SourceForge has been redesigned. Learn more.
Close

#402 applymapping conflicts with keep

v4.6
closed-works-for-me
None
5
2013-03-20
2011-07-06
Anonymous
No

I have just found a bug which takes ma 2 hours to understand... :D
I have this in my conf :
-keep public class net.altys.moon.view.** {
*;
}

Some methods weren't kept! For example "net.altys.moon.view.ExportBean: void setStartDate(java.util.Date)" while this methods was print by "-printseeds"

I have just realized that the cause is that in my conf I apply a mapping (with -applymapping) and that all methods that wasn't kept have a corresponding method with the same signature (but in a different class) in the map applied.
For my exemple, I had this lines in the applied map :
......
net.altys.moon.dal.PduExportDal -> altys.m:
......
103:104:void setStartDate(java.util.Date) -> a
......

If I remove this line in the map file, the my method setStartDate of ExportBean will be correctly kept....

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2011-07-06

    Sorry for my english... I even have difficulties to understand what I have written...

     
  • Eric Lafortune

    Eric Lafortune - 2011-07-06
    • assigned_to: nobody --> lafortune
    • status: open --> open-works-for-me
     
  • Eric Lafortune

    Eric Lafortune - 2011-07-06

    This is done on purpose. The mapping file gets precedence, since the result might otherwise be incompatible with the first run of ProGuard. ProGuard prints out warnings if this happens. The combination with -useuniqueclassmembernames might be confusing, since unrelated but identical names are then mapped to the same obfuscated names, but I'm not sure this can be avoided.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2011-07-07

    All right! "-useuniqueclassmembernames" conflicts with the mapping file and my conf which is totally logical! I have added "-useuniqueclassmembernames" long time ago and just to see the result... Ont the other side, I have double check my logs and i have no warning (except duplicate...)
    This is really a functionnality, not a bug... I think that you can close the bug and sort it in the "pekbac" folder :D

    BTW, ProGuard is really an awesome tool, really stable, frequently updated, well written and easy to use... Congratulation

     
  • Eric Lafortune

    Eric Lafortune - 2011-07-07

    I actually recommend using -useuniqueclassmembernames for incremental obfuscation, in order to avoid conflicts later on (if two classes with the same methods get a new common interface), so this is still a tricky problem. I'll have to think about other solutions.

     
  • Eric Lafortune

    Eric Lafortune - 2013-03-20
    • Status: open-works-for-me --> closed-works-for-me
     

Log in to post a comment.