Skip to content

Commit 9683878

Browse files
committed
ANDROID: update handling for external modules
1 parent 9233059 commit 9683878

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

src/platform/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ android {
1111
targetSdkVersion 34
1212
versionCode 59
1313
versionName '12.26'
14-
resConfigs 'en'
14+
resourceConfigurations += ['en']
1515
}
1616

1717
signingConfigs {
@@ -54,6 +54,6 @@ android {
5454

5555
dependencies {
5656
implementation 'androidx.core:core:1.12.0'
57-
//implementation files('libs/ioio-release.aar')
57+
//implementation files('libs/ioio-debug.aar')
5858
testImplementation 'junit:junit:4.13.2'
5959
}

src/platform/android/app/proguard-rules.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# For more details, see https://developer.android.com/build/shrink-code
33
#
44

5-
-keep public class * { public *; }
5+
-keep public class net.sourceforge.smallbasic.** { public *; }
6+
-keep public class ioio.lib.** { *; }
67
-keepclasseswithmembernames class * { native <methods>; }
78
-printmapping build/outputs/mapping/release/mapping.txt
89
-keepattributes LineNumberTable,SourceFile

src/platform/android/app/src/main/java/net/sourceforge/smallbasic/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,12 @@ public int getWindowHeight() {
369369
}
370370

371371
public boolean loadModules() {
372-
Log.i(TAG, "loadModules: " + getActivity() );
372+
Log.i(TAG, "loadModules: " + getActivity());
373373
boolean result;
374374
try {
375375
System.loadLibrary("ioio");
376376
Class<?> clazz = Class.forName("net.sourceforge.smallbasic.ioio.IOIOLoader");
377-
clazz.getDeclaredConstructor(Long.class).newInstance(getActivity());
377+
clazz.getDeclaredConstructor(Long.class, Context.class).newInstance(getActivity(), this);
378378
Log.d(TAG, "loadModules - success");
379379
result = true;
380380
} catch (Exception | UnsatisfiedLinkError e) {

src/platform/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
mavenCentral()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:8.3.0'
8+
classpath 'com.android.tools.build:gradle:8.3.1'
99
}
1010
}
1111

src/platform/android/jni/runtime.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,14 @@ void Runtime::saveConfig() {
627627
char *env = environ[i];
628628
if (strstr(env, SERVER_SOCKET_KEY) != nullptr ||
629629
strstr(env, SERVER_TOKEN_KEY) != nullptr ||
630-
strstr(env, LOAD_MODULES_KEY) != nullptr ||
631630
strstr(env, FONT_ID_KEY) != nullptr) {
632631
fprintf(fp, "%s\n", env);
632+
} else if (strstr(env, LOAD_MODULES_KEY) != nullptr) {
633+
if (strstr(env, LOAD_MODULES_KEY "=2") != nullptr) {
634+
fprintf(fp, "%s=1\n", LOAD_MODULES_KEY);
635+
} else {
636+
fprintf(fp, "%s\n", env);
637+
}
633638
}
634639
}
635640
fclose(fp);

0 commit comments

Comments
 (0)