diff --git a/app/src/main/java/io/xpipe/app/storage/DataStorage.java b/app/src/main/java/io/xpipe/app/storage/DataStorage.java index 02ef602eb..143cb4097 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStorage.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStorage.java @@ -1074,18 +1074,12 @@ public abstract class DataStorage { return forStoreIdentity.get(); } - var uuid = UuidHelper.generateFromObject(parent.getUuid(), name); - var found = getStoreEntryIfPresent(uuid); - if (found.isPresent()) { - return found.get(); - } - var forStore = getStoreEntryIfPresent(store, false); if (forStore.isPresent()) { return forStore.get(); } - return DataStoreEntry.createNew(uuid, parent.getCategoryUuid(), name, store); + return DataStoreEntry.createNew(UUID.randomUUID(), parent.getCategoryUuid(), name, store); } public DataStoreEntry getStoreEntry(UUID id) { diff --git a/app/src/main/java/io/xpipe/app/util/BaseElevationHandler.java b/app/src/main/java/io/xpipe/app/util/BaseElevationHandler.java index d096534be..076aef7d4 100644 --- a/app/src/main/java/io/xpipe/app/util/BaseElevationHandler.java +++ b/app/src/main/java/io/xpipe/app/util/BaseElevationHandler.java @@ -1,5 +1,6 @@ package io.xpipe.app.util; +import io.xpipe.app.storage.DataStorage; import io.xpipe.core.process.CountDown; import io.xpipe.core.process.ElevationHandler; import io.xpipe.core.process.ShellControl; @@ -39,6 +40,10 @@ public class BaseElevationHandler implements ElevationHandler { @Override public SecretReference getSecretRef() { - return password != null && password.expectsQuery() ? new SecretReference(dataStore) : null; + var id = DataStorage.get().getStoreEntryIfPresent(dataStore, true) + .or(() -> { + return DataStorage.get().getStoreEntryInProgressIfPresent(dataStore); + }).map(e -> e.getUuid()).orElse(UUID.randomUUID()); + return password != null && password.expectsQuery() ? new SecretReference(id, 0) : null; } } diff --git a/app/src/main/java/io/xpipe/app/util/SecretManager.java b/app/src/main/java/io/xpipe/app/util/SecretManager.java index f0254e1c2..da0598fc2 100644 --- a/app/src/main/java/io/xpipe/app/util/SecretManager.java +++ b/app/src/main/java/io/xpipe/app/util/SecretManager.java @@ -86,8 +86,7 @@ public class SecretManager { } } - public static synchronized void clearAll(Object store) { - var id = UuidHelper.generateFromObject(store); + public static synchronized void clearAll(UUID id) { secrets.entrySet() .removeIf(secretReferenceSecretValueEntry -> secretReferenceSecretValueEntry.getKey().getSecretId().equals(id)); diff --git a/app/src/main/java/io/xpipe/app/util/Validator.java b/app/src/main/java/io/xpipe/app/util/Validator.java index 17b853155..e81cf618c 100644 --- a/app/src/main/java/io/xpipe/app/util/Validator.java +++ b/app/src/main/java/io/xpipe/app/util/Validator.java @@ -22,7 +22,7 @@ public interface Validator { .dependsOn("val", s) .withMethod(c -> { if (c.get("val") == null) { - c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : "null")); + c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : AppI18n.get("value"))); } }) .immediate(); @@ -35,7 +35,7 @@ public interface Validator { .dependsOn("if", checkIf) .withMethod(c -> { if (Boolean.TRUE.equals(c.get("if")) && c.get("val") == null) { - c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : "null")); + c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : AppI18n.get("value"))); } }) .immediate(); @@ -46,7 +46,7 @@ public interface Validator { .dependsOn("val", s) .withMethod(c -> { if (((ObservableList) c.get("val")).size() == 0) { - c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : "null")); + c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : AppI18n.get("value"))); } }) .immediate(); diff --git a/core/src/main/java/io/xpipe/core/util/SecretReference.java b/core/src/main/java/io/xpipe/core/util/SecretReference.java index f6ae9f56a..136207622 100644 --- a/core/src/main/java/io/xpipe/core/util/SecretReference.java +++ b/core/src/main/java/io/xpipe/core/util/SecretReference.java @@ -12,16 +12,6 @@ public class SecretReference { UUID secretId; int subId; - public SecretReference(Object store) { - this.secretId = UuidHelper.generateFromObject(store); - this.subId = 0; - } - - public SecretReference(Object store, int sub) { - this.secretId = UuidHelper.generateFromObject(store); - this.subId = sub; - } - public static SecretReference ofUuid(UUID secretId) { return new SecretReference(secretId, 0); } diff --git a/core/src/main/java/io/xpipe/core/util/UuidHelper.java b/core/src/main/java/io/xpipe/core/util/UuidHelper.java index b9e2f1b9b..a1008a752 100644 --- a/core/src/main/java/io/xpipe/core/util/UuidHelper.java +++ b/core/src/main/java/io/xpipe/core/util/UuidHelper.java @@ -7,10 +7,6 @@ import java.util.UUID; public class UuidHelper { - public static UUID generateFromObject(Object... o) { - return UUID.nameUUIDFromBytes(Arrays.toString(o).getBytes(StandardCharsets.UTF_8)); - } - public static Optional parse(String s) { try { return Optional.of(UUID.fromString(s)); diff --git a/lang/strings/translations_da.properties b/lang/strings/translations_da.properties index 26f5f20fb..f1dfbacef 100644 --- a/lang/strings/translations_da.properties +++ b/lang/strings/translations_da.properties @@ -1268,3 +1268,4 @@ updateNagButton=Se udgivelser refreshServices=Opdater tjenester serviceProtocolType=Type serviceprotokol serviceProtocolTypeDescription=Den protokol, der skal bruges til at åbne tjenesten +value=Værdi diff --git a/lang/strings/translations_de.properties b/lang/strings/translations_de.properties index 3a02a7c13..b2d0e0736 100644 --- a/lang/strings/translations_de.properties +++ b/lang/strings/translations_de.properties @@ -1249,3 +1249,4 @@ updateNagButton=Siehe Veröffentlichungen refreshServices=Dienste aktualisieren serviceProtocolType=Dienstprotokolltyp serviceProtocolTypeDescription=Das Protokoll, das zum Öffnen des Dienstes verwendet wird +value=Wert diff --git a/lang/strings/translations_en.properties b/lang/strings/translations_en.properties index 9be196e5c..a07f813e4 100644 --- a/lang/strings/translations_en.properties +++ b/lang/strings/translations_en.properties @@ -1270,3 +1270,4 @@ updateNagButton=See releases refreshServices=Refresh services serviceProtocolType=Service protocol type serviceProtocolTypeDescription=The protocol to use to open the service +value=Value diff --git a/lang/strings/translations_es.properties b/lang/strings/translations_es.properties index 0081cb9d6..375a3f486 100644 --- a/lang/strings/translations_es.properties +++ b/lang/strings/translations_es.properties @@ -1220,3 +1220,4 @@ updateNagButton=Ver liberaciones refreshServices=Actualizar servicios serviceProtocolType=Tipo de protocolo de servicio serviceProtocolTypeDescription=El protocolo a utilizar para abrir el servicio +value=Valor diff --git a/lang/strings/translations_fr.properties b/lang/strings/translations_fr.properties index 894821998..537c4ba08 100644 --- a/lang/strings/translations_fr.properties +++ b/lang/strings/translations_fr.properties @@ -1255,3 +1255,4 @@ updateNagButton=Voir les communiqués refreshServices=Services de rafraîchissement serviceProtocolType=Type de protocole de service serviceProtocolTypeDescription=Le protocole à utiliser pour ouvrir le service +value=Valeur diff --git a/lang/strings/translations_id.properties b/lang/strings/translations_id.properties index 83acfb119..32212358f 100644 --- a/lang/strings/translations_id.properties +++ b/lang/strings/translations_id.properties @@ -1220,3 +1220,4 @@ updateNagButton=Lihat rilis refreshServices=Menyegarkan layanan serviceProtocolType=Jenis protokol layanan serviceProtocolTypeDescription=Protokol yang digunakan untuk membuka layanan +value=Nilai diff --git a/lang/strings/translations_it.properties b/lang/strings/translations_it.properties index 9fc7ca7c0..772c14eb4 100644 --- a/lang/strings/translations_it.properties +++ b/lang/strings/translations_it.properties @@ -1220,3 +1220,4 @@ updateNagButton=Vedere i comunicati refreshServices=Aggiorna i servizi serviceProtocolType=Tipo di protocollo di servizio serviceProtocolTypeDescription=Il protocollo da utilizzare per aprire il servizio +value=Valore diff --git a/lang/strings/translations_ja.properties b/lang/strings/translations_ja.properties index 737ba120a..1c509cf41 100644 --- a/lang/strings/translations_ja.properties +++ b/lang/strings/translations_ja.properties @@ -1220,3 +1220,4 @@ updateNagButton=リリースを見る refreshServices=リフレッシュ・サービス serviceProtocolType=サービスプロトコルタイプ serviceProtocolTypeDescription=サービスを開くために使用するプロトコル +value=価値 diff --git a/lang/strings/translations_nl.properties b/lang/strings/translations_nl.properties index be70e0b18..2ddbb9a80 100644 --- a/lang/strings/translations_nl.properties +++ b/lang/strings/translations_nl.properties @@ -1220,3 +1220,4 @@ updateNagButton=Bekijk uitgaven refreshServices=Diensten verversen serviceProtocolType=Type serviceprotocol serviceProtocolTypeDescription=Het te gebruiken protocol om de service te openen +value=Waarde diff --git a/lang/strings/translations_pl.properties b/lang/strings/translations_pl.properties index 2ef5938c2..3ce2909c8 100644 --- a/lang/strings/translations_pl.properties +++ b/lang/strings/translations_pl.properties @@ -1220,3 +1220,4 @@ updateNagButton=Zobacz wydania refreshServices=Usługi odświeżania serviceProtocolType=Typ protokołu usługi serviceProtocolTypeDescription=Protokół używany do otwarcia usługi +value=Wartość diff --git a/lang/strings/translations_pt.properties b/lang/strings/translations_pt.properties index a7c86df86..e627088ca 100644 --- a/lang/strings/translations_pt.properties +++ b/lang/strings/translations_pt.properties @@ -1220,3 +1220,4 @@ updateNagButton=Ver lançamentos refreshServices=Atualizar serviços serviceProtocolType=Tipo de protocolo de serviço serviceProtocolTypeDescription=O protocolo a utilizar para abrir o serviço +value=Valoriza diff --git a/lang/strings/translations_ru.properties b/lang/strings/translations_ru.properties index bc9a7fcd8..d84d496c3 100644 --- a/lang/strings/translations_ru.properties +++ b/lang/strings/translations_ru.properties @@ -1220,3 +1220,4 @@ updateNagButton=Смотри релизы refreshServices=Обновление сервисов serviceProtocolType=Тип протокола обслуживания serviceProtocolTypeDescription=Протокол, который нужно использовать для открытия сервиса +value=Значение diff --git a/lang/strings/translations_sv.properties b/lang/strings/translations_sv.properties index 2f71d74e1..60951a7f7 100644 --- a/lang/strings/translations_sv.properties +++ b/lang/strings/translations_sv.properties @@ -1220,3 +1220,4 @@ updateNagButton=Se releaser refreshServices=Uppdatera tjänster serviceProtocolType=Typ av serviceprotokoll serviceProtocolTypeDescription=Protokollet som ska användas för att öppna tjänsten +value=Värde diff --git a/lang/strings/translations_tr.properties b/lang/strings/translations_tr.properties index b44b1daac..3519245a0 100644 --- a/lang/strings/translations_tr.properties +++ b/lang/strings/translations_tr.properties @@ -1220,3 +1220,4 @@ updateNagButton=Yayınlara bakın refreshServices=Yenileme hizmetleri serviceProtocolType=Hizmet protokolü türü serviceProtocolTypeDescription=Hizmeti açmak için kullanılacak protokol +value=Değer diff --git a/lang/strings/translations_zh.properties b/lang/strings/translations_zh.properties index 461f616d9..c415a95c3 100644 --- a/lang/strings/translations_zh.properties +++ b/lang/strings/translations_zh.properties @@ -1220,3 +1220,4 @@ updateNagButton=参见发布 refreshServices=刷新服务 serviceProtocolType=服务协议类型 serviceProtocolTypeDescription=用于打开服务的协议 +value=价值 diff --git a/version b/version index a8e29d588..a3111bbd4 100644 --- a/version +++ b/version @@ -1 +1 @@ -14.0-56 +14.0-57