File tree Expand file tree Collapse file tree
app/src/main/java/io/github/muntashirakon/AppManager/filters/options Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424
2525import io .github .muntashirakon .AppManager .db .entity .Backup ;
2626import io .github .muntashirakon .AppManager .filters .IFilterableAppInfo ;
27+ import io .github .muntashirakon .AppManager .utils .JSONUtils ;
2728import io .github .muntashirakon .util .LocalizedString ;
2829
2930public abstract class FilterOption implements LocalizedString , Parcelable {
@@ -211,12 +212,11 @@ public JSONObject toJson() throws JSONException {
211212 @ NonNull
212213 public static FilterOption fromJson (@ NonNull JSONObject object ) throws JSONException {
213214 FilterOption option = FilterOptions .create (object .getString ("type" ));
214- option .key = object .getString ("key" );
215215 option .id = object .getInt ("id" );
216- option . keyType = object .getInt ("key_type" );
217- if ( object .has ( "value" )) {
218- option . value = object . getString ( "value" );
219- }
216+ // int keyType = object.getInt("key_type");
217+ String key = object .getString ( "key" );
218+ String value = JSONUtils . optString ( object , "value" );
219+ option . setKeyValue ( key , value );
220220 return option ;
221221 }
222222
You can’t perform that action at this time.
0 commit comments