I figured this out, in case someone else needs this one day. In the remote
service, I did:
Context c = createPackageContext("com.my.package",
Context.CONTEXT_IGNORE_SECURITY | Context.CONTEXT_INCLUDE_CODE);
bundle.setClassLoader(c.getClassLoader());
However, what are the security implications of this (particularly the
CONTEXT_IGNORE_SECURITY flag)?
Thanks!
Franzi
On Wednesday, March 21, 2012 9:36:19 AM UTC-7, Franzi Roesner wrote:
>
> Hi,
>
> I'm trying to send a custom Parcelable to another application (in another
> process).
>
> I have a client and a remote service, as well as an abstract class (say,
> AbstractCustomParcelable) that I added to the Android framework itself (for
> research purposes). The remote service should receive an object from the
> client that is an instantiation of this abstract class, and then call a
> method on it.
>
> The problem is that if I extend AbstractCustomParcelable in the client
> (say, MyCustomParcelable) and then pass it to the service (by putting it in
> a Bundle with some other stuff and sending it via a Message), I get a
> ClassNotFoundError in the service:
>
> android.os.BadParcelableException: ClassNotFoundException when
> unmarshalling: com.my.package.Client$MyCustomParcelable
>
> I've done some searches and it appears I need to do something with the
> classloader, but I'm not sure where to set which classloader, and nothing
> I've tried has worked so far (e.g., doing
> setClassLoader(MyCustomParcelable.class.getClassLoader()) on the Bundle).
> Is there a way to make this work?
>
>
> Thanks in advance!
>
> Franzi
>
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en