Remove mqtt from f-droid build

The Maven repo that includes the (FOSS) client library for MQTT isn't
approved by the f-droid build system, so for now rip MQTT out of that
variant. Long-term I'll have to fix this, either by persuading the
f-droid folk to permit the library or by building the C client from
source in my jni library -- or when the relay goes away the f-droid
build will cease to offer internet play.
This commit is contained in:
Eric House 2020-07-25 11:59:00 -07:00
parent 18be14c760
commit 7583c26e41
7 changed files with 93 additions and 7 deletions

View file

@ -36,10 +36,8 @@ if ( FABRIC_API_KEY && hasProperty('useCrashlytics') ) { // rm-for-fdroid
} // rm-for-fdroid
repositories {
google()
maven { url 'https://maven.fabric.io/public' } // rm-for-fdroid
maven {
url "https://repo.eclipse.org/content/repositories/paho-releases/"
}
maven { url 'https://maven.fabric.io/public' } // rm-for-fdroid
maven { url "https://repo.eclipse.org/content/repositories/paho-releases/" } // rm-for-fdroid
}
android {
@ -122,6 +120,7 @@ android {
resValue "string", "nfc_aid", "$NFC_AID_XW4"
externalNativeBuild.ndkBuild.cFlags += ['-DVARIANT_xw4fdroid']
externalNativeBuild.ndkBuild.arguments += ['XW_BT_UUID=' + XW_UUID]
buildConfigField "boolean", "OFFER_MQTT", "false"
}
xw4d {
@ -337,7 +336,7 @@ dependencies {
implementation 'com.github.eehouse:nbsproxy:v0.2.2'
implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.+"
implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.+" // rm-for-fdroid
}
task mkImages(type: Exec) {

View file

@ -243,7 +243,9 @@ public class PrefsDelegate extends DelegateBase
case R.string.key_mqtt_host:
case R.string.key_mqtt_port:
case R.string.key_mqtt_qos:
MQTTUtils.onConfigChanged( m_activity );
if ( BuildConfig.OFFER_MQTT ) {
MQTTUtils.onConfigChanged( m_activity );
}
break;
default:
Assert.failDbg();

View file

@ -102,7 +102,9 @@ public class XWApp extends Application
DupeModeTimer.init( this );
MQTTUtils.init( this );
if ( BuildConfig.OFFER_MQTT ) {
MQTTUtils.init( this );
}
}
@OnLifecycleEvent(ON_ANY)

View file

@ -0,0 +1 @@
../../../../../../xw4SMS/java/org/eehouse/android/xw4/MQTTUtils.java

View file

@ -0,0 +1 @@
../../../../../../xw4SMS/java/org/eehouse/android/xw4/MQTTUtils.java

View file

@ -0,0 +1,81 @@
/* -*- compile-command: "find-and-gradle.sh -PuseCrashlytics insXw4dDeb"; -*- */
/*
* Copyright 2020 by Eric House (xwords@eehouse.org). All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.eehouse.android.xw4;
import android.content.Context;
import org.eehouse.android.xw4.jni.CommsAddrRec;
public class MQTTUtils {
private static final String TAG = MQTTUtils.class.getSimpleName();
public static void init( Context context )
{
logUnimpl( "init" );
}
public static void onResume( Context context )
{
logUnimpl( "onResume" );
}
public static int send( Context context, String addressee, int gameID, byte[] buf )
{
logUnimpl( "send" );
return -1;
}
public static void handleMessage( Context context, CommsAddrRec from,
int gameID, byte[] data )
{
logUnimpl( "handleMessage" );
}
public static void handleGameGone( Context context, CommsAddrRec from, int gameID )
{
logUnimpl( "handleGameGone" );
}
public static void gameDied( String devID, int gameID )
{
logUnimpl( "gameDied" );
}
public static void timerFired( Context context )
{
logUnimpl( "timerFired" );
}
static void onConfigChanged( Context context )
{
logUnimpl( "onConfigChanged" );
}
public static void inviteRemote( Context context, String invitee, NetLaunchInfo nli )
{
logUnimpl( "inviteRemote" );
}
private static void logUnimpl( String name )
{
Log.d( TAG, "%s(): UNIMPLEMENTED", name );
}
}