Skip to content

Commit

Permalink
update android AppLovin
Browse files Browse the repository at this point in the history
fix ProjectBuilder
  • Loading branch information
irov committed Oct 24, 2023
1 parent 2c70d7d commit 7af9207
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 157 deletions.
2 changes: 1 addition & 1 deletion gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ buildscript {
}

if (Utils.existAppPlugin(project, "MENGINE_APP_PLUGIN_APPLOVIN") == true) {
classpath 'com.applovin.quality:AppLovinQualityServiceGradlePlugin:4.13.3'
classpath 'com.applovin.quality:AppLovinQualityServiceGradlePlugin:5.0.2'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.Mengine.Base;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
Expand Down Expand Up @@ -856,7 +857,17 @@ public boolean linkingOpenURL(String url) {
intent.setData(uri);

Intent chooser = Intent.createChooser(intent, "");
this.startActivity(chooser);

try {
this.startActivity(chooser);
} catch (ActivityNotFoundException e) {
MengineLog.logWarning(TAG, "linkingOpenURL url: %s catch ActivityNotFoundException: %s"
, url
, e.getLocalizedMessage()
);

return false;
}

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,27 @@ public void setState(String name, Object value) {
}

public String logInfo(String format, Object ... args) {
return MengineLog.logInfo(m_pluginName, format, args);
String m = MengineLog.logInfo(m_pluginName, format, args);

return m;
}

public String logMessage(String format, Object ... args) {
return MengineLog.logMessage(m_pluginName, format, args);
String m = MengineLog.logMessage(m_pluginName, format, args);

return m;
}

public String logWarning(String format, Object ... args) {
return MengineLog.logWarning(m_pluginName, format, args);
String m = MengineLog.logWarning(m_pluginName, format, args);

return m;
}

public String logError(String format, Object ... args) {
return MengineLog.logError(m_pluginName, format, args);
String m = MengineLog.logError(m_pluginName, format, args);

return m;
}

public void assertionError(String format, Object ... args) {
Expand Down
36 changes: 15 additions & 21 deletions gradle/plugins/AppLovin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_NEND = Utils.existAppPlugin(project, "
def MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_OGURY = Utils.existAppPlugin(project, "MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_OGURY")
def MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_PANGLE = Utils.existAppPlugin(project, "MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_PANGLE")
def MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_SMAATO = Utils.existAppPlugin(project, "MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_SMAATO")
def MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_TAPJOY = Utils.existAppPlugin(project, "MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_TAPJOY")
def MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_UNITYADS = Utils.existAppPlugin(project, "MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_UNITYADS")
def MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_VERVE = Utils.existAppPlugin(project, "MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_VERVE")
def MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_YANDEX = Utils.existAppPlugin(project, "MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_YANDEX")
Expand All @@ -52,7 +51,6 @@ Utils.logAvailable("MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_NEND", MENGINE_APP_PLU
Utils.logAvailable("MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_OGURY", MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_OGURY)
Utils.logAvailable("MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_PANGLE", MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_PANGLE)
Utils.logAvailable("MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_SMAATO", MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_SMAATO)
Utils.logAvailable("MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_TAPJOY", MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_TAPJOY)
Utils.logAvailable("MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_UNITYADS", MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_UNITYADS)
Utils.logAvailable("MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_VERVE", MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_VERVE)
Utils.logAvailable("MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_YANDEX", MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_YANDEX)
Expand Down Expand Up @@ -99,7 +97,7 @@ dependencies {
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_AMAZON == true) {
implementation 'com.applovin.mediation:amazon-tam-adapter:9.8.5.0'
implementation 'com.applovin.mediation:amazon-tam-adapter:9.8.6.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_BIDMACHINE == true) {
Expand All @@ -119,24 +117,24 @@ dependencies {
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_GOOGLEADMANAGER == true) {
implementation 'com.applovin.mediation:google-ad-manager-adapter:22.4.0.0'
implementation 'com.applovin.mediation:google-ad-manager-adapter:22.4.0.1'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_ADMOB == true) {
implementation 'com.applovin.mediation:google-adapter:22.4.0.0'
implementation 'com.applovin.mediation:google-adapter:22.4.0.1'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_HYPRMX == true) {
implementation 'com.applovin.mediation:hyprmx-adapter:6.2.0.2'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_INMOBI == true) {
implementation 'com.applovin.mediation:inmobi-adapter:10.5.8.0'
implementation 'com.applovin.mediation:inmobi-adapter:10.5.9.0'
implementation 'com.squareup.picasso:picasso:2.71828'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_IRONSOURCE == true) {
implementation 'com.applovin.mediation:ironsource-adapter:7.5.1.0.0'
implementation 'com.applovin.mediation:ironsource-adapter:7.5.2.0.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_LIFTOFF == true) {
Expand All @@ -156,47 +154,43 @@ dependencies {
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_MINTEGRAL == true) {
implementation 'com.applovin.mediation:mintegral-adapter:16.5.11.0'
implementation 'com.applovin.mediation:mintegral-adapter:16.5.31.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_MOBILEFUSE == true) {
implementation 'com.applovin.mediation:mobilefuse-adapter:1.6.2.0'
implementation 'com.applovin.mediation:mobilefuse-adapter:1.6.4.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_MYTARGET == true) {
implementation 'com.applovin.mediation:mytarget-adapter:5.18.0.0'
implementation 'com.applovin.mediation:mytarget-adapter:5.19.0.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_NEND == true) {
implementation 'com.applovin.mediation:nend-adapter:9.0.1.0'
implementation 'com.applovin.mediation:nend-adapter:10.0.0.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_OGURY == true) {
implementation 'com.applovin.mediation:ogury-presage-adapter:5.6.0.0'
implementation 'com.applovin.mediation:ogury-presage-adapter:5.6.1.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_PANGLE == true) {
implementation 'com.applovin.mediation:bytedance-adapter:5.4.1.1.0'
implementation 'com.applovin.mediation:bytedance-adapter:5.5.0.6.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_SMAATO == true) {
implementation 'com.applovin.mediation:smaato-adapter:22.3.2.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_TAPJOY == true) {
implementation 'com.applovin.mediation:tapjoy-adapter:13.1.2.0'
implementation 'com.applovin.mediation:smaato-adapter:22.4.0.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_UNITYADS == true) {
implementation 'com.applovin.mediation:unityads-adapter:4.8.0.0'
implementation 'com.applovin.mediation:unityads-adapter:4.9.1.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_VERVE == true) {
implementation 'com.applovin.mediation:verve-adapter:2.19.0.0'
implementation 'com.applovin.mediation:verve-adapter:2.20.0.0'
}

if (MENGINE_APP_PLUGIN_APPLOVIN_MEDIATION_YANDEX == true) {
implementation 'com.applovin.mediation:yandex-adapter:5.10.0.0'
implementation 'com.applovin.mediation:yandex-adapter:6.1.0.0'
}
}

Expand Down
11 changes: 7 additions & 4 deletions src/Environment/Android/AndroidEventation.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace Mengine
m_handler = nullptr;

m_commands.clear();
m_commandsAux.clear();
}

void setEventHandler( const EventHandlerPtr & _handler )
Expand All @@ -50,27 +51,29 @@ namespace Mengine
protected:
void invoke() override
{
VectorEventHandlerCommand commands;

m_mutex->lock();
std::swap( m_commands, commands );
std::swap( m_commands, m_commandsAux );
m_commands.clear();
m_mutex->unlock();

if( m_handler == nullptr )
{
return;
}

for( const LambdaEventHandler & command : commands )
for( const LambdaEventHandler & command : m_commandsAux )
{
command( m_handler );
}

m_commandsAux.clear();
}

protected:
ThreadMutexInterfacePtr m_mutex;
EventHandlerPtr m_handler;

VectorEventHandlerCommand m_commands;
VectorEventHandlerCommand m_commandsAux;
};
}
2 changes: 1 addition & 1 deletion src/Plugins/AstralaxPlugin/AstralaxService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace Mengine

m_atlases.clear();

for( uint32_t index = 0; index != 256; ++index )
for( int32_t index = 0; index != m_stageCount; ++index )
{
const RenderMaterialStage * stage = m_stages[index];

Expand Down
Loading

0 comments on commit 7af9207

Please sign in to comment.