diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java index 19de36e68..e4a814709 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java @@ -2032,8 +2032,8 @@ public class BoardDelegate extends DelegateBase // different name, offer to install. String msg = null; if ( oldName.equals( newName ) ) { - String oldSum = DictLangCache.getDictMD5Sum( m_activity, - oldName ); + String oldSum = DictLangCache + .getDictMD5Sums( m_activity, oldName )[0]; if ( !oldSum.equals( newSum ) ) { // Same dict, different versions msg = getString( R.string.inform_dict_diffversion_fmt, diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictBrowseDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictBrowseDelegate.java index 3974c8eee..107491e84 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictBrowseDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictBrowseDelegate.java @@ -283,8 +283,8 @@ public class DictBrowseDelegate extends DelegateBase if ( BuildConfig.NON_RELEASE ) { TextView tv = (TextView)findViewById( R.id.md5sum_summary ); tv.setVisibility( View.VISIBLE ); - String sum = DictLangCache.getDictMD5Sum( m_activity, m_name ); - tv.setText( "md5: " + sum ); + String[] sums = DictLangCache.getDictMD5Sums( m_activity, m_name ); + tv.setText( "md5: " + sums[0] ); } setShowConfig(); diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictLangCache.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictLangCache.java index 70440edfa..b86ca7cc2 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictLangCache.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictLangCache.java @@ -300,22 +300,13 @@ public class DictLangCache { return s_langCodeStrs.get( code ); } - public static String getDictMD5Sum( Context context, String dict ) + public static String[] getDictMD5Sums( Context context, String dict ) { - String result = null; + String[] result = {null, null}; DictInfo info = getInfo( context, dict ); if ( null != info ) { - result = info.md5Sum; - } - return result; - } - - public static String getDictFullSum( Context context, String dict ) - { - String result = null; - DictInfo info = getInfo( context, dict ); - if ( null != info ) { - result = info.fullSum; + result[0] = info.md5Sum; + result[1] = info.fullSum; } return result; } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictsDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictsDelegate.java index 3726a6e4b..66b7dca70 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictsDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictsDelegate.java @@ -1434,7 +1434,7 @@ public class DictsDelegate extends ListDelegateBase // DictLangCache hits the DB hundreds of times below. Fix! Log.w( TAG, "Fix me I'm stupid" ); try { - // Log.d( TAG, "data: %s", jsonData ); + // Log.d( TAG, "digestData(%s)", jsonData ); JSONObject obj = new JSONObject( jsonData ); langs = obj.optJSONArray( "langs" ); @@ -1483,15 +1483,12 @@ public class DictsDelegate extends ListDelegateBase if ( DictLangCache.haveDict( m_activity, localLangName, name )){ boolean matches = true; - String curSum = DictLangCache - .getDictMD5Sum( m_activity, name ); - if ( null != curSum ) { - JSONArray sums = - dict.getJSONArray("md5sums"); - if ( null != sums ) { - matches = false; - for ( int kk = 0; - !matches && kk < sums.length(); + JSONArray sums = dict.getJSONArray("md5sums"); + if ( null != sums ) { + matches = false; + String[] curSums = DictLangCache.getDictMD5Sums( m_activity, name ); + for ( String curSum : curSums ) { + for ( int kk = 0; !matches && kk < sums.length(); ++kk ) { String sum = sums.getString( kk ); matches = sum.equals( curSum ); diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java index eccc4d7b2..5e35eef99 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java @@ -218,16 +218,15 @@ public class UpdateCheckReceiver extends BroadcastReceiver { int lang = DictLangCache.getDictLangCode( context, dal ); String langCode = DictLangCache.getLangCodeStr( context, lang ); String langStr = DictLangCache.getLangName( context, lang ); - String sum = DictLangCache.getDictMD5Sum( context, dal.name ); - String fullSum = DictLangCache.getDictFullSum( context, dal.name ); - Assert.assertTrueNR( null != fullSum ); + String[] sums = DictLangCache.getDictMD5Sums( context, dal.name ); + Assert.assertTrueNR( null != sums[1] ); long len = DictLangCache.getFileLen( context, dal ); try { params.put( k_NAME, dal.name ); params.put( k_LANG, langStr ); params.put( k_LANGCODE, langCode ); - params.put( k_MD5SUM, sum ); - params.put( k_FULLSUM, fullSum ); + params.put( k_MD5SUM, sums[0] ); + params.put( k_FULLSUM, sums[1] ); params.put( k_INDEX, index ); params.put( k_LEN, len ); } catch( org.json.JSONException jse ) {