[Ohrrpgce] [ohrrpgce/ohrrpgce] Android apk export from distribute game menu (Issue #1228)

Ralph Versteegen notifications at github.com
Fri Nov 5 17:59:52 PDT 2021


I've discussed this before. The trickiest thing that needs (as far as I know) to change is to change the Java classpath in the compiled .dex files. I previous wrote (on the mailinglist in 2013 in "Android port")[http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/2013-June/thread.html]:

> Don't forget that while allowing the user to select the namespace is
low-priority, packaged .apks still need to have unique namespaces,
otherwise Android will consider them all as the same program.


> There's an additional problem. It turns out that in addition to all
> the Java code, lots of the C code in the SDL port requires the
> namespace to be compiled in too. I have no idea how JNI works, but it
> appears that Java code like...
> 
> package com.hamsterrepublic.ohrrpgce.game;
> class AudioThread
> {
>     private native int nativeAudioInitJavaCallbacks();
> 
> requires an implemention provided by a C function named
> Java_com_hamsterrepublic_ohrrpgce_game_AudioThread_nativeAudioInitJavaCallbacks!
> 
> However perhaps by using Simon's library suggestion we can use a
> separate namespace for all of the code compiled into the .so files,
> leaving just the xml metadata and compiled Java files to worry about.
> 
> In order to edit the namespace in compiled Java code we would have to
> modify .dex files (targetting .class files instead would mean still
> having to convert them to .dex and requiring the NDK). Looking around
> a bit I see there are a couple projects like smali/baksmali
> (https://code.google.com/p/smali) for disassembling/reassembling a dex
> file.  It sounds a whole lot simpler to just set up a web server which
> compiles the required java source files with desired on request :)
> 
> Unless creating a single trivial java module which includes everything
> else is enough; in that case smali/baksmali could be practical, or
> even a small edit to the right offset in the file...

Simon's "library suggestion" from an earlier email:

> The simplest way would presumably be to make the ohrrpgce a library project and wrap it with the new namespace, I think:
> 
> package com.newnamespace.myrpg;
> 
> public class MainActivity extends com.ohrrpgce.games.OHRActivity
> 
> etc.

Simon also suggested that Proguard could be used to change the namespace in a compiled .dex. Of course this was 2013, so there might be other solutions now. But I see that Godot at least still requires the Android SDK+NDK to export for Android.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/ohrrpgce/ohrrpgce/issues/1228#issuecomment-962297919
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20211105/50df0996/attachment.html>


More information about the Ohrrpgce mailing list