Settings screen, display fixes

This commit is contained in:
Neil Alexander 2021-06-24 18:12:16 +01:00
parent 8f3ee30e74
commit fa9532fb97
7 changed files with 354 additions and 7 deletions

View file

@ -1,6 +1,7 @@
package eu.neilalexander.yggdrasil
import android.content.Context
import android.provider.Settings
import mobile.Mobile
import org.json.JSONObject
import java.io.File
@ -21,6 +22,12 @@ object ConfigurationProxy {
return this
}
fun resetJSON() {
val conf = Mobile.generateConfigJSON()
file.writeBytes(conf)
fix()
}
fun updateJSON(fn: (JSONObject) -> Unit) {
json = JSONObject(file.readText(Charsets.UTF_8))
fn(json)