Re: Dexing jython for use in mobile
Stefan Richthofer <[email protected]> Fri, 30 Aug 2019 18:48:29 +0200
| Newsgroups | gmane.comp.lang.jython.user |
|---|---|
| Message-ID | <CACQYzFK5v+sS_Ja0ZKzg3heR4ANRKAVcUaXDDwB-F+PmUWb_OA@mail.gmail.com> |
--===============1132585294841167883== Content-Type: multipart/alternative; boundary="000000000000750ada059158661e" --000000000000750ada059158661e Content-Type: text/plain; charset="UTF-8" Even if you were able to dex Jython.jar, Jython would still generate Java bytecode at runtime. AFAIK there is no way to dex this at runtime on Android. Even if it was possible or if Jython could generate dexed bytecode directly, AFAIK Android prohibits apps to load such new code at runtime. I used to think that it should be possible at least to create all bytecode required for a certain Python porgram or library ahead of time and dex it, but was told that Jython in its current form inherently needs to generate, load and run bytecode at runtime. I.e. some bits for gluing code cannot be created ahead of time. Best feasible workaround would be to use CPython bytecode on Android. Jython can actually read and interpret CPython bytecode (.pyc files). However, it cannot create it: That part was never ported from CPython and it is significant work (about 10k lines of C-code need to be ported to Java for this). We used to have this particular task open as a GSoC project proposal: https://github.com/jythontools/gsoc2015#python-bytecode-compiler However, nobody ever applied for this project. -Stefan Am Fr., 30. Aug. 2019 um 16:06 Uhr schrieb Jeff Mitchell < [email protected]>: > This begs the question.. if you know the command line, do it yourself? > Also, jython 2.5 is pretty old; why not 2.7.x? > > (I don't know what dex is, haven't done Android dev) > > On Thu, Aug 29, 2019 at 9:49 PM HemanthJabalpuri < > [email protected]> wrote: > >> Can someone please dex the jython-standalone-2.5.3.jar using dx tool.from >> android sdk. >> dx --dex --min-sdk-version=1 --output="jython-standalone-2.5.3-dexed.jar" >> jython-standalone-2.5.3.jar >> >> Thanks >> _______________________________________________ >> Jython-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/jython-users >> > _______________________________________________ > Jython-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jython-users > --000000000000750ada059158661e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Even if you were able to dex Jython.jar, Jython would= still generate Java bytecode at runtime. AFAIK there is no way to dex this= at runtime on Android. Even if it was possible or if Jython could generate= dexed bytecode directly, AFAIK Android prohibits apps to load such new cod= e at runtime. I used to think that it should be possible at least to create= all bytecode required for a certain Python porgram or library ahead of tim= e and dex it, but was told that Jython in its current form inherently needs= to generate, load and run bytecode at runtime. I.e. some bits for gluing c= ode cannot be created ahead of time. Best feasible workaround would be to u= se CPython bytecode on Android. Jython can actually read and interpret CPyt= hon bytecode (.pyc files). However, it cannot create it: That part was neve= r ported from CPython and it is significant work (about 10k lines of C-code= need to be ported to Java for this). We used to have this particular task = open as a GSoC project proposal: <a href=3D"https://github.com/jythontools/= gsoc2015#python-bytecode-compiler">https://github.com/jythontools/gsoc2015#= python-bytecode-compiler</a> However, nobody ever applied for this project.= </div><div><br></div><div>-Stefan<br></div></div><br><div class=3D"gmail_qu= ote"><div dir=3D"ltr" class=3D"gmail_attr">Am Fr., 30. Aug. 2019 um 16:06= =C2=A0Uhr schrieb Jeff Mitchell <<a href=3D"mailto:[email protected]= m">[email protected]</a>>:<br></div><blockquote class=3D"gmail_quot= e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)= ;padding-left:1ex"><div dir=3D"ltr">This begs the question.. if you know th= e command line, do it yourself?<div>Also, jython 2.5 is pretty old; why not= 2.7.x?</div><div><br></div><div>(I don't know what dex is, haven't= done Android dev)</div></div><br><div class=3D"gmail_quote"><div dir=3D"lt= r" class=3D"gmail_attr">On Thu, Aug 29, 2019 at 9:49 PM HemanthJabalpuri &l= t;<a href=3D"mailto:[email protected]" target=3D"_blank">hemanthja= [email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quote"= style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p= adding-left:1ex"><div><p dir=3D"ltr">Can someone please dex the jython-stan= dalone-2.5.3.jar using dx tool.from android sdk.<br> dx --dex --min-sdk-ver= sion=3D1 --output=3D"jython-standalone-2.5.3-dexed.jar" jython-st= andalone-2.5.3.jar</p>=20 <p dir=3D"ltr">Thanks</p></div>____________________________________________= ___<br> Jython-users mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">Jyt= [email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/jython-users" rel= =3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listi= nfo/jython-users</a><br> </blockquote></div> _______________________________________________<br> Jython-users mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">Jyt= [email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/jython-users" rel= =3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listi= nfo/jython-users</a><br> </blockquote></div> --000000000000750ada059158661e-- --===============1132585294841167883== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============1132585294841167883== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Jython-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jython-users --===============1132585294841167883==--