Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] hide or encrypt aspectj annotations (in LTW)

It is possible to add and remove annotations during the weaving
process.  But you cannot programmatically compute the values that go
into any annotations you add (at the moment, if the weaver were
modified this would be feasible).  If the weaver were modified with a
plugin you could call to do this, then yes, when the class is loaded
(before it is defined to the VM), you could decrypt annotation values,
insert your new ones and have those be in the class that is defined to
the VM.  It isn't total obfuscation though, as I could just chain
another agent after AspectJ that dumped the unecrypted class files to
disk, but it would prevent the casual user from javap'ing them.

If you are just needing to mess with annotations, you could write a
lightweight agent based on Asm to do the job, it wouldn't be very
tricky.

cheers,
Andy

On 20 September 2011 13:54, hmimou lbyad <hmimou11@xxxxxxxxx> wrote:
> Hi,
>
> I want to know if there is a way to encrypt aspectj annotations(in
> load time weaving).
>
> for example get the value of the annotation and encrypt it then  decrypt the
>
> encrypted value at runtime.
>
> the purpose is to hide the annotation when my annotated class is
> decompiled  in order to
>
> don't know what kind of classes are used in this annotation.
>
> I'm thinking about encryption of the annotation value using encryption
> algorithm e.g :RSA but i don't know if there is a way to decrypt this
> value at runtime.
>
> I think that we can use java obfuscator (like proguard) in case we
> need to keep  the
>
> annotations but we can't both keep and hide annotaions value.
>
> I know that this  question is not aspectj specific but  needs runtime
> access to annotations.
>
> any idea ?
>
> how aspectj use annotations at runtime ?
>
> thanks in advance ;
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top