add missing files

This commit is contained in:
Yueyu 2021-06-11 06:19:44 +08:00
parent dab8462349
commit acbd23a7aa
2 changed files with 9 additions and 14 deletions

View file

@ -682,21 +682,13 @@ public class JavaScriptDirectInterface {
/**
* Record a user property
* @param prefObjStr single key-value JSON string, like "{\"school\": \"Central High\"}"
* @param key like "school"
* @param propertyString like "Central High"
*/
@JavascriptInterface
public void setAnalyticsPref(String prefObjStr) {
if (prefObjStr != null) {
try {
JSONObject jsonObject = new JSONObject(prefObjStr);
JSONArray jsonArray = jsonObject.names();
String key = jsonArray.getString(0);
String value = jsonObject.getString(key);
_activity.setAnalyticsPref(key, value);
} catch (JSONException e) {
Log.e(LOG_TAG, "JSON error: " + e.getMessage(), e);
return;
}
public void setAnalyticsPref(String key, String propertyString) {
if (key != null) {
_activity.setAnalyticsPref(key, propertyString);
}
}
}

View file

@ -313,7 +313,10 @@ NSMutableDictionary *soundtimers;
NSDictionary *page = [json valueForKey:name];
for (NSString *spriteName in [page valueForKey:@"sprites"]) {
NSDictionary *sprite = [page valueForKey:spriteName];
[sprites setValue:sprite forKey:[sprite valueForKey:@"md5"]];
NSString *md5 = [sprite valueForKey:@"md5"];
if (md5 != nil) {
[sprites setValue:sprite forKey:md5];
}
}
}