<p></p>
<p>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]:</p>
<blockquote>
<p>Don't forget that while allowing the user to select the namespace is<br>
low-priority, packaged .apks still need to have unique namespaces,<br>
otherwise Android will consider them all as the same program.</p>
</blockquote>
<blockquote>
<p>There's an additional problem. It turns out that in addition to all<br>
the Java code, lots of the C code in the SDL port requires the<br>
namespace to be compiled in too. I have no idea how JNI works, but it<br>
appears that Java code like...</p>
<p>package com.hamsterrepublic.ohrrpgce.game;<br>
class AudioThread<br>
{<br>
private native int nativeAudioInitJavaCallbacks();</p>
<p>requires an implemention provided by a C function named<br>
Java_com_hamsterrepublic_ohrrpgce_game_AudioThread_nativeAudioInitJavaCallbacks!</p>
<p>However perhaps by using Simon's library suggestion we can use a<br>
separate namespace for all of the code compiled into the .so files,<br>
leaving just the xml metadata and compiled Java files to worry about.</p>
<p>In order to edit the namespace in compiled Java code we would have to<br>
modify .dex files (targetting .class files instead would mean still<br>
having to convert them to .dex and requiring the NDK). Looking around<br>
a bit I see there are a couple projects like smali/baksmali<br>
(<a href="https://code.google.com/p/smali" rel="nofollow">https://code.google.com/p/smali</a>) for disassembling/reassembling a dex<br>
file.  It sounds a whole lot simpler to just set up a web server which<br>
compiles the required java source files with desired on request :)</p>
<p>Unless creating a single trivial java module which includes everything<br>
else is enough; in that case smali/baksmali could be practical, or<br>
even a small edit to the right offset in the file...</p>
</blockquote>
<p>Simon's "library suggestion" from an earlier email:</p>
<blockquote>
<p>The simplest way would presumably be to make the ohrrpgce a library project and wrap it with the new namespace, I think:</p>
<p>package com.newnamespace.myrpg;</p>
<p>public class MainActivity extends com.ohrrpgce.games.OHRActivity</p>
<p>etc.</p>
</blockquote>
<p>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.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/ohrrpgce/ohrrpgce/issues/1228#issuecomment-962297919">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AMWGWZUEA5CNKVVP7CBPLGDUKR4YRANCNFSM5HO6NGGA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AMWGWZQLF27E3Y5Z36B3KM3UKR4YRA5CNFSM5HO6NGGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHFNYAPY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/ohrrpgce/ohrrpgce/issues/1228#issuecomment-962297919",
"url": "https://github.com/ohrrpgce/ohrrpgce/issues/1228#issuecomment-962297919",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>