Re: How to obfuscate RequestFactory type name, not only the operations ( GWT 2.4 )

105 views
Skip to first unread message

James Horsley

unread,
Sep 6, 2012, 8:28:21 AM9/6/12
to google-we...@googlegroups.com
I'm also very interested in this; I'd looked briefly going back but didn't find anything either.

On 5 September 2012 11:01, zz <zhi....@gmail.com> wrote:
Hi,

I've searched all over the web, but didn't quite get my question answered.

How to obfuscate the type name of my request factory interface that extends RequestFactory? I can only see operations on service are obfuscated.

For gwt-rpc, it's enabled by adding below to module file.  

Is there anything similar required to enable obfuscation for RequestFactory?

Regards,
zz

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/ggMXO4wGPiEJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Thomas Broyer

unread,
Sep 6, 2012, 9:58:34 AM9/6/12
to google-we...@googlegroups.com
I haven't tried it but I suppose you could implement the mapping on the server-side in a ServiceLayerDecorator's resolveRequestFactory method.
The problem would be doing it on the client-side (both in the GWT generator and the VM implementation). A hackish way for GWT code could be to do a search/replace on the generated JS code.
The proper way would be to add an annotation on the RequestFactory sub-interfaces that the generator and InProcessRequestFactory would use instead of the interface's binary name. Note that the ServiceLayerDecorator would still be needed on the server-side, but maybe we could provide a simple one.

Would you mind filing an issue in the tracker (if no one already did it) ?

(it's a rather simple patch –change the implementation of getFactoryTypeToken()– so if you really need/want it, feel free to jump ahead and contribute it!)

On Thursday, September 6, 2012 2:29:33 PM UTC+2, James Horsley wrote:
I'm also very interested in this; I'd looked briefly going back but didn't find anything either.

On 5 September 2012 11:01, zz <zhi....@gmail.com> wrote:
Hi,

I've searched all over the web, but didn't quite get my question answered.

How to obfuscate the type name of my request factory interface that extends RequestFactory? I can only see operations on service are obfuscated.

For gwt-rpc, it's enabled by adding below to module file.  

Is there anything similar required to enable obfuscation for RequestFactory?

Regards,
zz

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/ggMXO4wGPiEJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsub...@googlegroups.com.

Chris Lercher

unread,
Sep 6, 2012, 10:58:31 AM9/6/12
to google-we...@googlegroups.com
On Thursday, September 6, 2012 3:58:34 PM UTC+2, Thomas Broyer wrote:
Would you mind filing an issue in the tracker (if no one already did it) ?

It was closed as a duplicate of http://code.google.com/p/google-web-toolkit/issues/detail?id=5394, which is fixed and released in 2.4... but it doesn't really fix 5729.

Thomas Broyer

unread,
Sep 6, 2012, 12:32:09 PM9/6/12
to google-we...@googlegroups.com
Well, it obfuscates all type and method names, but the RequestFactory name (as it's needed to load the DeobfuscatorBuilder class)

James Horsley

unread,
Sep 7, 2012, 4:55:25 PM9/7/12
to google-we...@googlegroups.com
I'll see if I can get some time to getting a patch together for this. 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/2yp-mCXMgfMJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages