Skip to content

Commit

Permalink
improve SoundService mute
Browse files Browse the repository at this point in the history
improve PythonCallbackProvider
ref-in Scriptable
remove Interface.h
add MixerBoolean
ref-in AmplifierService
update android Firebase 33.7.0
wip plugin LayoutEditorPlugin
  • Loading branch information
irov committed Jan 3, 2025
1 parent b3b6d78 commit cc8f8f5
Show file tree
Hide file tree
Showing 197 changed files with 1,793 additions and 1,165 deletions.
1 change: 1 addition & 0 deletions cmake/Win32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ ADD_PLUGIN(MENGINE_PLUGIN_UIFRAMEWORK ON OFF "MENGINE_PLUGIN_UIFRAMEWORK")
ADD_PLUGIN(MENGINE_PLUGIN_DEVELOPMENTCONVERTER ON ON "MENGINE_PLUGIN_DEVELOPMENTCONVERTER")
ADD_PLUGIN(MENGINE_PLUGIN_NODEDEBUGRENDER ON OFF "MENGINE_PLUGIN_NODEDEBUGRENDER")
ADD_PLUGIN(MENGINE_PLUGIN_DEBUGPANEL ON OFF "MENGINE_PLUGIN_DEBUGPANEL")
ADD_PLUGIN(MENGINE_PLUGIN_LAYOUTEDITOR ON OFF "MENGINE_PLUGIN_LAYOUTEDITOR")
ADD_PLUGIN(MENGINE_PLUGIN_TEXTVALIDATE ON OFF "MENGINE_PLUGIN_TEXTVALIDATE")
ADD_PLUGIN(MENGINE_PLUGIN_RESOURCEVALIDATE ON OFF "MENGINE_PLUGIN_RESOURCEVALIDATE")
ADD_PLUGIN(MENGINE_PLUGIN_RESOURCEPREFETCHER ON OFF "MENGINE_PLUGIN_RESOURCEPREFETCHER")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1034,11 +1034,31 @@ public void onCreate() {
String engine_gitsha1 = this.getEngineGITSHA1();
this.setState("engine.gitsha1", engine_gitsha1);

String engine_version = this.getEngineVersion();
this.setState("engine.version", engine_version);
this.setState("application.init", "services_version");

String engine_builddate = this.getBuildDate();
this.setState("engine.build_date", engine_builddate);
Map<String, String> pluginVersions = new HashMap<>();

for (MengineListenerApplication l : applicationListeners) {
String version = l.onAppVersion(this);

if (version == null) {
continue;
}

String serviceName = l.getServiceName();

pluginVersions.put(serviceName, version);
}

for (Map.Entry<String, String> entry: pluginVersions.entrySet()) {
String name = entry.getKey();
String version = entry.getValue();

MengineLog.logMessage(TAG, "plugin: %s version: %s"
, name
, version
);
}

this.setState("application.init", "services_prepare");

Expand All @@ -1048,7 +1068,7 @@ public void onCreate() {
, l.getServiceName()
);

l.onAppPrepare(this);
l.onAppPrepare(this, pluginVersions);
} catch (final MengineServiceInvalidInitializeException e) {
MengineAnalytics.buildEvent("mng_app_create_failed")
.addParameterException("exception", e)
Expand Down Expand Up @@ -1121,7 +1141,7 @@ public void onCreate() {

String name = p.getServiceName();

MengineNative.AndroidNativePython_addPlugin(name, p);
MengineNative.AndroidNativePython_addPlugin("Mengine" + name, p);
}

this.setState("application.init", "run_main");
Expand Down Expand Up @@ -1159,7 +1179,7 @@ public void onTerminate() {

String name = p.getServiceName();

MengineNative.AndroidNativePython_removePlugin(name);
MengineNative.AndroidNativePython_removePlugin("Mengine" + name);
}

for (MengineService service : m_services) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@

import androidx.annotation.NonNull;

import java.util.Map;

public interface MengineListenerApplication extends MengineServiceInterface {
default void onAppInit(@NonNull MengineApplication application, boolean isMainProcess) throws MengineServiceInvalidInitializeException {
//Empty
}

default String onAppVersion(@NonNull MengineApplication application) {
//Empty

return null;
}

default void onAppPrepare(@NonNull MengineApplication application) throws MengineServiceInvalidInitializeException {
default void onAppPrepare(@NonNull MengineApplication application, @NonNull Map<String, String> pluginVersions) throws MengineServiceInvalidInitializeException {
//Empty
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import androidx.annotation.NonNull;

public class MengineMonitorConnectivityStatus extends MengineService implements MengineListenerApplication {
public static final String SERVICE_NAME = "MengineMConnStatus";
public static final String SERVICE_NAME = "MConnStatus";

private ConnectivityManager.NetworkCallback m_networkCallback;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.Timer;

public class MengineMonitorPerformance extends MengineService implements MengineListenerApplication, MengineListenerEngine, MengineListenerAnalytics {
public static final String SERVICE_NAME = "MengineMPerformance";
public static final String SERVICE_NAME = "MPerformance";

private static final String TRACE_STARTUP = "mng_startup";
private static final String TRACE_FPS = "mng_fps";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,51 +98,51 @@ public void setState(String name, Object value) {
}

public String logVerbose(String format, Object ... args) {
String m = MengineLog.logVerbose(m_serviceName, format, args);
String m = MengineLog.logVerbose("Mengine" + m_serviceName, format, args);

return m;
}

public String logDebug(String format, Object ... args) {
String m = MengineLog.logDebug(m_serviceName, format, args);
String m = MengineLog.logDebug("Mengine" + m_serviceName, format, args);

return m;
}

public String logInfo(String format, Object ... args) {
String m = MengineLog.logInfo(m_serviceName, format, args);
String m = MengineLog.logInfo("Mengine" + m_serviceName, format, args);

return m;
}

public String logMessage(String format, Object ... args) {
String m = MengineLog.logMessage(m_serviceName, format, args);
String m = MengineLog.logMessage("Mengine" + m_serviceName, format, args);

return m;
}

public String logMessageRelease(String format, Object ... args) {
String m = MengineLog.logMessageRelease(m_serviceName, format, args);
String m = MengineLog.logMessageRelease("Mengine" + m_serviceName, format, args);

return m;
}

public String logWarning(String format, Object ... args) {
String m = MengineLog.logWarning(m_serviceName, format, args);
String m = MengineLog.logWarning("Mengine" + m_serviceName, format, args);

return m;
}

public String logError(String format, Object ... args) {
String m = MengineLog.logError(m_serviceName, format, args);
String m = MengineLog.logError("Mengine" + m_serviceName, format, args);

return m;
}

public void assertionError(String format, Object ... args) {
String msg = String.format(Locale.US, format, args);

throw new AssertionError("[" + m_serviceName + "] " + msg);
throw new AssertionError("[" + "Mengine" + m_serviceName + "] " + msg);
}

public MengineAnalyticsEventBuilder buildEvent(@Size(min = 1L,max = 40L) String name) {
Expand All @@ -156,7 +156,7 @@ public void pythonCall(String method, Object ... args) {
return;
}

m_activity.pythonCall(m_serviceName, method, args);
m_activity.pythonCall("Mengine" + m_serviceName, method, args);
}

public void activateSemaphore(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@
import org.Mengine.Base.MengineApplication;
import org.Mengine.Base.MengineService;
import org.Mengine.Base.MengineListenerApplication;
import org.Mengine.Base.MengineServiceInvalidInitializeException;

import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.VersionInfo;

public class MengineAdMobPlugin extends MengineService implements MengineListenerApplication {
public static final String SERVICE_NAME = "MengineAdMob";
public static final String SERVICE_NAME = "AdMob";

@Override
public void onAppCreate(@NonNull MengineApplication application) throws MengineServiceInvalidInitializeException {
// Empty
public String onAppVersion(@NonNull MengineApplication application) {
VersionInfo admobSdkVersion = MobileAds.getVersion();

String admobSdkVersionString = String.valueOf(admobSdkVersion);

return admobSdkVersionString;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.Mengine.Base.MengineTransparencyConsentParam;

public class MengineAdjustPlugin extends MenginePlugin implements MenginePluginApplicationListener, MenginePluginActivityListener, MenginePluginAdRevenueListener, MenginePluginTransparencyConsentListener, MenginePluginRemoteMessageListener, MenginePluginPushTokenListener {
public static final String SERVICE_NAME = "MengineAdjust";
public static final String SERVICE_NAME = "Adjust";
public static final boolean SERVICE_EMBEDDING = true;

public static final String METADATA_APP_TOKEN = "mengine.adjust.app_token";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.concurrent.Future;

public class MengineAdvertisingPlugin extends MengineService implements MengineListenerApplication {
public static final String SERVICE_NAME = "MengineAdvertising";
public static final String SERVICE_NAME = "Advertising";

private static final String LIMIT_ADVERTISING_ID = "00000000-0000-0000-0000-000000000000";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.Mengine.Base.MenginePluginInvalidInitializeException;

public class MengineAmazonPlugin extends MenginePlugin implements MenginePluginApplicationListener {
public static final String SERVICE_NAME = "MengineAmazon";
public static final String SERVICE_NAME = "Amazon";

public static final String METADATA_APP_ID = "mengine.amazon.app_id";
public static final String METADATA_ENABLE_TESTING = "mengine.amazon.enable_testing";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import java.util.Map;

public class MengineAppLovinPlugin extends MengineService implements MengineListenerApplication, MengineListenerActivity, MengineListenerEngine {
public static final String SERVICE_NAME = "MengineAppLovin";
public static final String SERVICE_NAME = "AppLovin";
public static final boolean SERVICE_EMBEDDING = true;

public static final String METADATA_SDK_KEY = "mengine.applovin.sdk_key";
Expand All @@ -48,9 +48,9 @@ public class MengineAppLovinPlugin extends MengineService implements MengineList

private AppLovinSdk m_appLovinSdk;

private Map<String, MengineAppLovinBanner> m_banners;
private Map<String, MengineAppLovinInterstitial> m_interstitials;
private Map<String, MengineAppLovinRewarded> m_rewardeds;
private Map<String, MengineAppLovinBanner> m_banners = new HashMap<>();
private Map<String, MengineAppLovinInterstitial> m_interstitials = new HashMap<>();
private Map<String, MengineAppLovinRewarded> m_rewardeds = new HashMap<>();

private MengineAppLovinMediationInterface m_mediationAmazon;

Expand All @@ -59,11 +59,14 @@ public class MengineAppLovinPlugin extends MengineService implements MengineList
private boolean m_bannerAdaptive;

@Override
public void onAppCreate(@NonNull MengineApplication application) throws MengineServiceInvalidInitializeException {
m_banners = new HashMap<>();
m_interstitials = new HashMap<>();
m_rewardeds = new HashMap<>();
public String onAppVersion(@NonNull MengineApplication application) {
String sdkVersion = AppLovinSdk.VERSION;

return sdkVersion;
}

@Override
public void onAppCreate(@NonNull MengineApplication application) throws MengineServiceInvalidInitializeException {
boolean MengineAppLovinPlugin_BannerAdaptive = this.getMetaDataBoolean(METADATA_BANNER_ADAPTIVE);

this.logMessage("%s: %b"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import io.appmetrica.analytics.AppMetricaConfig;

public class MengineAppMetricaPlugin extends MenginePlugin implements MenginePluginLoggerListener, MenginePluginAnalyticsListener, MenginePluginAdRevenueListener, MenginePluginApplicationListener, MenginePluginEngineListener, MenginePluginSessionIdListener {
public static final String SERVICE_NAME = "MengineAppMetrica";
public static final String SERVICE_NAME = "AppMetrica";
public static final boolean SERVICE_EMBEDDING = true;

public static final String METADATA_API_KEY = "mengine.appmetrica.api_key";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Map;

public class MengineAppsFlyerPlugin extends MenginePlugin implements MenginePluginAnalyticsListener, MenginePluginAdRevenueListener, MenginePluginApplicationListener, MenginePluginSessionIdListener {
public static final String SERVICE_NAME = "MengineAppsFlyer";
public static final String SERVICE_NAME = "AppsFlyer";
public static final boolean SERVICE_EMBEDDING = true;

public static final String METADATA_API_KEY = "mengine.appsflyer.api_key";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.Map;

public class MengineDataDogPlugin extends MenginePlugin implements MenginePluginLoggerListener, MenginePluginApplicationListener, MenginePluginActivityListener, MenginePluginSessionIdListener {
public static final String SERVICE_NAME = "MengineDataDog";
public static final String SERVICE_NAME = "DataDog";
public static final boolean SERVICE_EMBEDDING = true;

public static final String METADATA_SITE = "mengine.datadog.site";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import android.os.Bundle;

public class MengineDevDebuggerPlugin extends MenginePlugin {
public static final String SERVICE_NAME = "MengineDevDebugger";
public static final String SERVICE_NAME = "DevDebugger";

@FunctionalInterface
public interface DevButtonCallbackInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.Map;

public class MengineDevToDevPlugin extends MenginePlugin implements MenginePluginAnalyticsListener, MenginePluginAdRevenueListener, MenginePluginApplicationListener, MenginePluginSessionIdListener {
public static final String SERVICE_NAME = "MengineDevToDev";
public static final String SERVICE_NAME = "DevToDev";
public static final boolean SERVICE_EMBEDDING = true;

public static final String METADATA_APP_ID = "mengine.devtodev.app_id";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import java.util.Map;

public class MengineFacebookPlugin extends MengineService implements MengineListenerAnalytics, MengineListenerApplication, MengineListenerRemoteMessage, MengineListenerPushToken, MengineListenerSessionId {
public static final String SERVICE_NAME = "MengineFacebook";
public static final String SERVICE_NAME = "Facebook";
public static final boolean SERVICE_EMBEDDING = true;

private static final int ERROR_CODE_UNKNOWN = 0;
Expand All @@ -58,6 +58,13 @@ public class MengineFacebookPlugin extends MengineService implements MengineList
private ProfileTracker m_profileTracker;
private AppEventsLogger m_logger;

@Override
public String onAppVersion(@NonNull MengineApplication application) {
String fbSdkVersion = FacebookSdk.getSdkVersion();

return fbSdkVersion;
}

@Override
public void onAppCreate(@NonNull MengineApplication application) throws MengineServiceInvalidInitializeException {
try {
Expand Down
2 changes: 1 addition & 1 deletion gradle/plugins/Firebase/firebase.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies {
implementation platform('com.google.firebase:firebase-bom:33.6.0')
implementation platform('com.google.firebase:firebase-bom:33.7.0')
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.google.firebase.FirebaseApp;

public class MengineFirebasePlugin extends MengineService implements MengineListenerApplication {
public static final String SERVICE_NAME = "MengineFB";
public static final String SERVICE_NAME = "FB";

@Override
public void onAppInit(@NonNull MengineApplication application, boolean isMainProcess) throws MengineServiceInvalidInitializeException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
import java.util.Map;

public class MengineFirebaseAnalyticsPlugin extends MengineService implements MengineListenerAnalytics, MengineListenerAdRevenue, MengineListenerTransparencyConsent, MengineListenerApplication, MengineListenerSessionId {
public static final String SERVICE_NAME = "MengineFBAnalytics";
public static final String SERVICE_NAME = "FBAnalytics";
public static final boolean SERVICE_EMBEDDING = true;

FirebaseAnalytics m_firebaseAnalytics;

@Override
public void onAppPrepare(@NonNull MengineApplication application) throws MengineServiceInvalidInitializeException {
public void onAppPrepare(@NonNull MengineApplication application, @NonNull Map<String, String> pluginVersions) throws MengineServiceInvalidInitializeException {
FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(application);

String sessionId = application.getSessionId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
import org.Mengine.Base.MengineListenerApplication;
import org.Mengine.Base.MengineServiceInvalidInitializeException;

import java.util.Map;

public class MengineFirebaseAppCheckPlugin extends MengineService implements MengineListenerApplication {
public static final String SERVICE_NAME = "MengineFBAppCheck";
public static final String SERVICE_NAME = "FBAppCheck";
public static final boolean SERVICE_EMBEDDING = true;

FirebaseAppCheck m_firebaseAppCheck;

@Override
public void onAppPrepare(@NonNull MengineApplication application) throws MengineServiceInvalidInitializeException {
public void onAppPrepare(@NonNull MengineApplication application, @NonNull Map<String, String> pluginVersions) throws MengineServiceInvalidInitializeException {
FirebaseAppCheck firebaseAppCheck = FirebaseAppCheck.getInstance();

PlayIntegrityAppCheckProviderFactory factory = PlayIntegrityAppCheckProviderFactory.getInstance();
Expand Down
4 changes: 2 additions & 2 deletions gradle/plugins/FirebaseCrashlytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ android {
}

dependencies {
implementation 'com.google.firebase:firebase-crashlytics:19.2.1'
implementation 'com.google.firebase:firebase-crashlytics-ndk:19.2.1'
implementation 'com.google.firebase:firebase-crashlytics:19.3.0'
implementation 'com.google.firebase:firebase-crashlytics-ndk:19.3.0'
}
Loading

0 comments on commit cc8f8f5

Please sign in to comment.