removing old code

This commit is contained in:
Eric House 2022-02-20 11:13:48 -08:00
parent 2175600190
commit e613adcac2
27 changed files with 2 additions and 466 deletions

View file

@ -452,5 +452,3 @@ gradle.projectsEvaluated {
// tasks.withType(JavaCompile) {
// options.compilerArgs += ["-Xdiags:verbose"]
// }
apply plugin: 'com.google.gms.google-services' // rm-for-fdroid

View file

@ -364,11 +364,6 @@ public class MQTTUtils extends Thread implements IMqttActionListener, MqttCallba
params.put( "frstV", Utils.getFirstVersion( mContext ) );
params.put( "relayDID", DevID.getRelayDevID( mContext ) );
String fcmid = FBMService.getFCMDevID( mContext );
if ( null != fcmid ) {
params.put( "fcmid", fcmid );
}
Log.d( TAG, "registerOnce(): sending %s", params );
HttpsURLConnection conn
= NetUtils.makeHttpsMQTTConn( mContext, "register" );

View file

@ -157,10 +157,6 @@ public class PrefsActivity extends XWActivity
tmp.add( R.string.key_enable_p2p );
}
if ( null == FBMService.getFCMDevID( context ) ) {
tmp.add( R.string.key_show_fcm );
}
if ( BuildConfig.DEBUG ) {
tmp.add( R.string.key_logging_on );
tmp.add( R.string.key_enable_debug );

View file

@ -1246,13 +1246,8 @@ public class RelayService extends XWJIService
if ( null != devid && 0 < devid.length() ) {
typ = DevIDType.ID_TYPE_RELAY;
} else {
devid = FBMService.getFCMDevID( this );
if ( null != devid && 0 < devid.length() ) {
typ = DevIDType.ID_TYPE_ANDROID_FCM;
} else {
devid = "";
typ = DevIDType.ID_TYPE_ANON;
}
devid = "";
typ = DevIDType.ID_TYPE_ANON;
}
if ( null != typp ) {
typp[0] = typ;

View file

@ -91,7 +91,6 @@ public class XWApp extends Application
UpdateCheckReceiver.restartTimer( this );
RelayService.startService( this );
FBMService.init( this );
WiDirWrapper.init( this );
mPort = Short.valueOf( getString( R.string.nbs_port ) );

View file

@ -87,11 +87,6 @@ public class XWPrefs {
return result;
}
public static boolean getToastFCM( Context context )
{
return getPrefsBoolean( context, R.string.key_show_fcm, BuildConfig.DEBUG );
}
public static boolean getSMSToSelfEnabled( Context context )
{
return getPrefsBoolean( context, R.string.key_enable_sms_toself, false );

View file

@ -33,7 +33,6 @@ import org.eehouse.android.xw4.DBUtils;
import org.eehouse.android.xw4.DevID;
import org.eehouse.android.xw4.DictUtils;
import org.eehouse.android.xw4.DupeModeTimer;
import org.eehouse.android.xw4.FBMService;
import org.eehouse.android.xw4.GameUtils;
import org.eehouse.android.xw4.GamesListDelegate;
import org.eehouse.android.xw4.Log;
@ -69,15 +68,6 @@ public class DUtilCtxt {
String result = DevID.getRelayDevID( m_context );
if ( null != result ) {
typ = DevIDType.ID_TYPE_RELAY;
} else {
result = FBMService.getFCMDevID( m_context );
if ( null == result ) {
// do nothing
} else if ( result.equals("") ) {
result = null;
} else {
typ = DevIDType.ID_TYPE_ANDROID_FCM;
}
}
typa[0] = (byte)typ.ordinal();
return result;

View file

@ -152,7 +152,6 @@
<string name="key_enable_debug">key_enable_debug</string>
<string name="key_enable_pending_count">key_enable_pending_count</string>
<string name="key_enable_sms_toself">key_enable_sms_toself</string>
<string name="key_show_fcm">key_show_fcm2</string>
<string name="key_nag_intervals">key_nag_intervals</string>
<string name="key_download_path">key_download_path</string>
<string name="key_got_langdict">key_got_langdict</string>

View file

@ -2357,7 +2357,6 @@
devices and I think its rare that people play with more than
two. Let me know if Im wrong and Ill up the priority.</string>
<string name="show_sms_title">Show Data SMS sends, receives</string>
<string name="show_fcm_title">Show FCM receives</string>
<!-- Shown after "resend messages" menuitem chosen -->
<plurals name="resent_msgs_fmt">
<item quantity="one">One move resent</item>

View file

@ -13,10 +13,6 @@
android:defaultValue="@string/relay_poll_name_both"
/>
<CheckBoxPreference android:key="@string/key_show_fcm"
android:title="@string/show_fcm_title"
android:defaultValue="@bool/DEBUG"
/>
<org.eehouse.android.xw4.XWEditTextPreference
android:key="@string/key_relay_host"
android:title="@string/relay_host"

View file

@ -1 +0,0 @@
../xw4GPlay/google-services.json

View file

@ -1 +0,0 @@
../../../../../../xw4GPlay/java/org/eehouse/android/xw4/FBMService.java

View file

@ -9,11 +9,5 @@
android:theme="@style/AppTheme"
>
<service android:name="FBMService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
</manifest>

View file

@ -1,104 +0,0 @@
{
"project_info": {
"project_number": "801272813571",
"firebase_url": "https://fcmtest-9fe99.firebaseio.com",
"project_id": "fcmtest-9fe99",
"storage_bucket": "fcmtest-9fe99.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:801272813571:android:15f4eb80a9b07720",
"android_client_info": {
"package_name": "com.google.firebase.fiamquickstart"
}
},
"oauth_client": [
{
"client_id": "801272813571-g3lfciu89q8ffb7ahasrce5nj3vsghot.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCl3lfUITEX0EscF2aeDZY4G-DNL2xeEZ8"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:801272813571:android:2d4684b9d573e182",
"android_client_info": {
"package_name": "org.eehouse.android.xw4"
}
},
"oauth_client": [
{
"client_id": "801272813571-g3lfciu89q8ffb7ahasrce5nj3vsghot.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCl3lfUITEX0EscF2aeDZY4G-DNL2xeEZ8"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:801272813571:android:8c4ed916336414b2",
"android_client_info": {
"package_name": "org.eehouse.android.xw4dbg"
}
},
"oauth_client": [
{
"client_id": "801272813571-g3lfciu89q8ffb7ahasrce5nj3vsghot.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCl3lfUITEX0EscF2aeDZY4G-DNL2xeEZ8"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}

View file

@ -1,186 +0,0 @@
/* -*- compile-command: "find-and-gradle.sh -PuseCrashlytics insXw4dDeb"; -*- */
/*
* Copyright 2019 - 2021 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 android.content.Intent;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.InstanceIdResult;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import org.json.JSONArray;
import java.util.Map;
import org.eehouse.android.xw4.loc.LocUtils;
public class FBMService extends FirebaseMessagingService {
private static final String TAG = FBMService.class.getSimpleName();
public static void init( Context context )
{
Log.d( TAG, "init()" );
Assert.assertTrueNR( null != BuildConfig.KEY_FCMID );
getTokenAsync( context );
}
@Override
public void onNewToken( String token )
{
Log.d( TAG, "onNewToken(%s)", token);
onGotToken( this, token );
}
@Override
public void onMessageReceived( RemoteMessage message )
{
if ( XWPrefs.getIgnoreFCM( this ) ) {
Log.d( TAG, "onMessageReceived(): ignoring" );
} else {
callFcmConfirmed( this, true );
Map<String, String> data = message.getData();
Log.d( TAG, "onMessageReceived(data=\"%s\")", data );
boolean toastFCM = XWPrefs.getToastFCM( this );
String value = data.get( "msgs64" );
if ( null != value ) {
String connname = data.get( "connname" );
try {
JSONArray msgs64 = new JSONArray( value );
String[] strs64 = new String[msgs64.length()];
if ( toastFCM ) {
DbgUtils.showf( this, "%s-%s.onMessageReceived(): got %d msgs",
BuildConfig.FLAVOR, TAG, strs64.length );
}
for ( int ii = 0; ii < strs64.length; ++ii ) {
strs64[ii] = msgs64.optString(ii);
}
if ( null == connname ) {
RelayService.processDevMsgs( this, strs64 );
} else {
RelayService.processGameMsgs( this, connname, strs64 );
}
} catch (org.json.JSONException jse ) {
Log.ex( TAG, jse );
Assert.assertFalse( BuildConfig.DEBUG );
}
}
value = data.get( "checkUpdates" );
if ( null != value && Boolean.parseBoolean( value ) ) {
UpdateCheckReceiver.checkVersions( this, true );
}
value = data.get( "getMoves" );
if ( null != value && Boolean.parseBoolean( value ) ) {
RelayService.timerFired( this );
if ( toastFCM ) {
DbgUtils.showf( this, "%s.onMessageReceived(): got 'getMoves'",
TAG );
}
}
value = data.get( "getMQTT" );
if ( null != value && Boolean.parseBoolean( value ) ) {
MQTTUtils.onFCMReceived( this );
if ( toastFCM ) {
DbgUtils.showf( this, "%s.onMessageReceived(): got 'getMQTT'",
TAG );
}
}
value = data.get( "msg" );
if ( null != value ) {
String title = data.get( "title" );
if ( null == title ) {
title = LocUtils.getString( this, R.string.remote_msg_title );
}
String teaser = data.get( "teaser" );
if ( null == teaser ) {
teaser = value;
}
Intent alertIntent = GamesListDelegate
.makeAlertIntent( this, value );
int code = value.hashCode() ^ title.hashCode();
Utils.postNotification( this, alertIntent, title,
teaser, code );
}
}
}
public static String getFCMDevID( Context context )
{
Assert.assertTrueNR( null != BuildConfig.KEY_FCMID );
String result = DBUtils.getStringFor( context, BuildConfig.KEY_FCMID );
if ( null == result ) {
getTokenAsync( context );
}
return result;
}
private static void getTokenAsync( final Context context )
{
FirebaseInstanceId.getInstance().getInstanceId()
.addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
@Override
public void onComplete(Task<InstanceIdResult> task) {
if (!task.isSuccessful()) {
Log.w(TAG, "getInstanceId failed: %s", task.getException());
if ( !XWPrefs.getIgnoreFCM( context ) ) {
callFcmConfirmed( context, false );
}
} else {
// Get new Instance ID token
String token = task.getResult().getToken();
// Log and toast
Log.d(TAG, "got token!: %s", token );
onGotToken( context, token );
}
}
});
}
private static void onGotToken( Context context, String token )
{
// Don't call this with empty tokens!!!
Assert.assertTrue( token.length() > 0 || !BuildConfig.DEBUG );
DBUtils.setStringFor( context, BuildConfig.KEY_FCMID, token );
DevID.setFCMDevID( context, token );
callFcmConfirmed( context, true );
}
private static void callFcmConfirmed( Context context, boolean working )
{
RelayService.fcmConfirmed( context, working );
MQTTUtils.fcmConfirmed( context, working );
}
}

View file

@ -1,73 +0,0 @@
{
"project_info": {
"project_number": "801272813571",
"firebase_url": "https://fcmtest-9fe99.firebaseio.com",
"project_id": "fcmtest-9fe99",
"storage_bucket": "fcmtest-9fe99.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:801272813571:android:15f4eb80a9b07720",
"android_client_info": {
"package_name": "com.google.firebase.fiamquickstart"
}
},
"oauth_client": [
{
"client_id": "801272813571-g3lfciu89q8ffb7ahasrce5nj3vsghot.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCl3lfUITEX0EscF2aeDZY4G-DNL2xeEZ8"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:801272813571:android:8c4ed916336414b2",
"android_client_info": {
"package_name": "org.eehouse.android.xw4dbg"
}
},
"oauth_client": [
{
"client_id": "801272813571-g3lfciu89q8ffb7ahasrce5nj3vsghot.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCl3lfUITEX0EscF2aeDZY4G-DNL2xeEZ8"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}

View file

@ -1 +0,0 @@
../../../../../../xw4fdroid/java/org/eehouse/android/xw4/FBMService.java

View file

@ -22,11 +22,5 @@
<service android:name="WiDirService" />
<service android:name="FBMService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
</manifest>

View file

@ -1 +0,0 @@
../../../../../../xw4GPlay/java/org/eehouse/android/xw4/FBMService.java

View file

@ -1,40 +0,0 @@
/* -*- compile-command: "find-and-gradle.sh -PuseCrashlytics insXw4dDeb"; -*- */
/*
* Copyright 2019 - 2021 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 android.content.Intent;
public class FBMService {
private static final String TAG = FBMService.class.getSimpleName();
public static void init( Context context )
{
Log.d( TAG, "init()" );
Assert.assertTrueNR( null == BuildConfig.KEY_FCMID );
RelayService.fcmConfirmed( context, false );
}
public static String getFCMDevID( Context context )
{
return null;
}
}

View file

@ -866,7 +866,6 @@
<string name="invite_nbs_desc">Eine Datennachricht wird dann an das Gerät mit dieser Telefonnummer gesendet. Wenn CrossWords dort installiert ist und über die notwendigen Berechtigungen verfügt, erhält es die Einladung und das Spiel kann beginnen.</string>
<string name="empty_bt_inviter">Es wurden noch keine gekoppelten Geräte erkannt.</string>
<string name="checkbox_archive">Ins Archiv verschieben+</string>
<string name="show_fcm_title">FCM-Empfang anzeigen</string>
<string name="not_again_nbsGamesOnUpgrade">Die Google Play Store Version von CrossWords darf die Play-by-Data-SMS-Funktion nicht mehr unterstützen.
\n
\n Sie haben %1$d offene Spiele, die diese Funktion nutzen. Sie werden nicht in der Lage sein, Züge per Daten-SMS zu senden oder zu empfangen, solange Sie die Google Play-Version von CrossWords verwenden, oder bis ich einen Workaround herausgefunden habe, der den Store Richtlinien entspricht.

View file

@ -151,7 +151,6 @@
<item quantity="one">Una mossa inviata di nuovo</item>
<item quantity="other">%1$s mosse inviate di nuovo</item>
</plurals>
<string name="show_fcm_title">Mostra FCM ricevuti</string>
<string name="show_sms_title">Mostra SMS inviati e ricevuti</string>
<string name="not_again_rematch_two_only">la Rivincita è limitata alle partite con due giocatori, almeno per adesso, perché è difficile applicarla per più dispositivi ed è raro che giochino più di due persone. Fammi sapere se sono in errore e aggiornerò le funzioni.</string>
<string name="str_no_hint_found">Impossibile trovare mosse</string>

View file

@ -822,7 +822,6 @@ WiFi ダイレクト経由で接続可能なデバイスはありません。</s
<string name="invite_nbs_desc">その後、データメッセージがその電話番号のデバイスに配信されます。クロスワードがインストールされていて、必要なアクセス許可がある場合は、招待状を受け取ってプレイを開始できます。</string>
<string name="empty_bt_inviter">ペアリングされたデバイスはまだ検出されていません。</string>
<string name="checkbox_archive">アーカイブに移動</string>
<string name="show_fcm_title">FCM 受信の表示</string>
<string name="not_again_nbsGamesOnUpgrade">Google Play ストアバージョンのクロスワードは、データ SMS によるプレイ機能をサポートできなくなりました。
\n
\nこの機能を使用する %1$d の開催中のゲームがあります。Google Play バージョンのクロスワードを使用している限り、またはストア ポリシーを満たす回避策を見つけ出すまで、データ SMS 経由で移動を送受信することはできません。

View file

@ -863,7 +863,6 @@
<string name="ok_with_robots">OK (maskinspiller)</string>
<string name="invite_sms_fmt">Trykk på lenken for å godta min invitasjon og ta del i et CrossWords-spill: %1$s</string>
<string name="invite_nbs_desc">En datamelding vil så leveres til enheten med det telefonnummeret. Hvis CrossWords er installert der og har nødvendige tilganger vil det motta invitasjonen og spillet kan begynne.</string>
<string name="show_fcm_title">Vis FCM-mottak</string>
<string name="nbsproxy_channel_expl">Varsler om NBSProxy</string>
<string name="not_again_longtap_lookup">Du kan slå opp ord FØR de innsendes som trekk -- ved langtrykk, samme som innsendelse.
\n

View file

@ -879,7 +879,6 @@
<string name="invite_nbs_desc">Następnie do urządzenia zostanie dostarczona wiadomość z tym numerem telefonu. Jeśli CrossWords jest tam zainstalowany i posiada niezbędne uprawnienia, otrzyma zaproszenie i gra może się rozpocząć.</string>
<string name="empty_bt_inviter">Nie wykryto jeszcze sparowanych urządzeń.</string>
<string name="checkbox_archive">Przenieś do archiwum</string>
<string name="show_fcm_title">"Pokaż odbieranie FCM"</string>
<string name="missing_sms_perms">Ta gra jest skonfigurowana do komunikowania się za pośrednictwem Data SMS, ale CrossWords nie ma uprawnień do tego. Nadal możesz otworzyć grę, ale może nie być w stanie wysyłać ani odbierać ruchów.
\n
\nMożesz ponownie otworzyć go, aby zostać poproszony o pozwolenie ponownie. Możesz też usunąć ustawienia komunikacji Data SMS.</string>

View file

@ -998,7 +998,6 @@
<item quantity="one">Uma jogada reenviada</item>
<item quantity="other">%1$s jogadas reenviadas</item>
</plurals>
<string name="show_fcm_title">Mostrar recebidos FCM</string>
<string name="show_sms_title">Mostrar dados que SMS envia, recebe</string>
<string name="got_langdict_title">Captar lista de palavras padrão para o idioma</string>
<string name="expl_mqtt_url">URL para nova API de relay baseada em MQTT</string>

View file

@ -1769,7 +1769,6 @@
<item quantity="one">Uma jogada reenviada</item>
<item quantity="other">%1$s jogadas reenviadas</item>
</plurals>
<string name="show_fcm_title">Mostrar recebidos FCM</string>
<string name="show_sms_title">Mostrar dados que SMS envia, recebe</string>
<string name="not_again_rematch_two_only">Desforras são limitadas a jogos de dois jogadores, pelo menos por enquanto, porque é mais difícil com mais aparelhos e acho raro que pessoas joguem com mais de dois. Se eu estiver errado avise-me e aumentarei a prioridade.</string>
<string name="str_no_hint_found">Não pôde achar nenhuma jogada</string>