• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is AspectJ suitable for software time limit?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ramnivas,
My company wants to release a beta version software and wants it expires after some time. To reinforce the protection, I'd like to adopt AspectJ to check time policy at every main function pointcut. But after examing the AspectJ-compiled classes, I find there's just one copy of the time limit code instead of scattered into the software. So it's still easy
to decompile and modify the time limit code. Is there any way to interweave the time limit code with the function code? Or should I resort to other technique?
Thanks!
Max Cao
 
Author
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Max,
You problem can be broken into two parts:
  • Checking for expiry on entering each important method
  • Protecting against reverse engineering your classes


  • For the first part, AspectJ is an excellent solution (as you probably already experienced). You can write a simple and short aspect to advise all the important methods to perform expiration check.
    For the second part, the real issue is of obfuscation. You cannot really force AspectJ to weave code as you describe. Even if you get it to weave in a particular way in one version, it might not work in another version. AspectJ compiler guarantees preservation of semantics on the resulting system, but not the weaving details that lead to it. You could perhaps use an obfuscation tool passing it the jar file created by the AspectJ compiler.
    -Ramnivas
     
    author
    Posts: 11962
    5
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Just as a side note, obfuscation doesn't prevent decompilation. It just messes up the variable names etc. "cosmetics"... Unfortunately I don't have a solution for the problem either.
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic