Compare commits

...

2 Commits

Author SHA1 Message Date
Weblate 434f338402 Update multiple translations
Co-authored-by: Sebas <sebasmetal86@tutanota.com>
1 year ago
androidacy-user 3769acaebb (fix) revert instinit
Signed-off-by: androidacy-user <opensource@androidacy.com>
1 year ago

@ -18,21 +18,33 @@ import java.util.ArrayList;
import timber.log.Timber;
public class InstallerInitializer extends Shell.Initializer {
public static final int ERROR_NO_PATH = 1;
public static final int ERROR_NO_SU = 2;
public static final int ERROR_OTHER = 3;
private static final File MAGISK_SBIN = new File("/sbin/magisk");
private static final File MAGISK_SYSTEM = new File("/system/bin/magisk");
private static final File MAGISK_SYSTEM_EX = new File("/system/xbin/magisk");
private static final boolean HAS_MAGISK = MAGISK_SBIN.exists() || MAGISK_SYSTEM.exists() || MAGISK_SYSTEM_EX.exists();
private static final File MAGISK_SBIN =
new File("/sbin/magisk");
private static final File MAGISK_SYSTEM =
new File("/system/bin/magisk");
private static final File MAGISK_SYSTEM_EX =
new File("/system/xbin/magisk");
private static final boolean HAS_MAGISK = MAGISK_SBIN.exists() ||
MAGISK_SYSTEM.exists() || MAGISK_SYSTEM_EX.exists();
private static String MAGISK_PATH;
private static int MAGISK_VERSION_CODE;
private static boolean HAS_RAMDISK;
public static final int ERROR_NO_PATH = 1;
public static final int ERROR_NO_SU = 2;
public static final int ERROR_OTHER = 3;
public interface Callback {
void onPathReceived(String path);
void onFailure(int error);
}
@Nullable
public static NotificationType getErrorNotification() {
Boolean hasRoot = Shell.isAppGrantedRoot();
if (MAGISK_PATH != null && hasRoot != Boolean.FALSE) {
if (MAGISK_PATH != null &&
hasRoot != Boolean.FALSE) {
return null;
}
if (!HAS_MAGISK) {
@ -48,11 +60,13 @@ public class InstallerInitializer extends Shell.Initializer {
}
public static String peekMirrorPath() {
return InstallerInitializer.MAGISK_PATH == null ? null : InstallerInitializer.MAGISK_PATH + "/.magisk/mirror";
return InstallerInitializer.MAGISK_PATH == null ? null :
InstallerInitializer.MAGISK_PATH + "/.magisk/mirror";
}
public static String peekModulesPath() {
return InstallerInitializer.MAGISK_PATH == null ? null : InstallerInitializer.MAGISK_PATH + "/.magisk/modules";
return InstallerInitializer.MAGISK_PATH == null ? null :
InstallerInitializer.MAGISK_PATH + "/.magisk/modules";
}
public static int peekMagiskVersion() {
@ -67,7 +81,7 @@ public class InstallerInitializer extends Shell.Initializer {
tryGetMagiskPathAsync(callback, false);
}
public static void tryGetMagiskPathAsync(Callback callback, boolean forceCheck) {
public static void tryGetMagiskPathAsync(Callback callback,boolean forceCheck) {
final String MAGISK_PATH = InstallerInitializer.MAGISK_PATH;
Thread thread = new Thread("Magisk GetPath Thread") {
@Override
@ -109,30 +123,26 @@ public class InstallerInitializer extends Shell.Initializer {
private static String tryGetMagiskPath(boolean forceCheck) {
String MAGISK_PATH = InstallerInitializer.MAGISK_PATH;
int MAGISK_VERSION_CODE;
boolean HAS_RAMDISK;
boolean HAS_RAMDISK = InstallerInitializer.HAS_RAMDISK;
if (MAGISK_PATH != null && !forceCheck) return MAGISK_PATH;
ArrayList<String> output = new ArrayList<>();
if (!Shell.cmd("magisk -V", "magisk --path").to(output).exec().isSuccess()) {
// log the output of each command
if (output.size() > 0) {
for (String line : output) {
Timber.w("Could not run magisk: %s", line);
}
} else {
Timber.w("Could not run magisk");
if(!Shell.cmd("if grep ' / ' /proc/mounts | grep -q '/dev/root' &> /dev/null; " +
"then echo true; else echo false; fi", "magisk -V", "magisk --path")
.to(output).exec().isSuccess()) {
if (output.size() != 0) {
HAS_RAMDISK = "false".equals(output.get(0)) ||
"true".equalsIgnoreCase(System.getProperty("ro.build.ab_update"));
}
InstallerInitializer.HAS_RAMDISK = HAS_RAMDISK;
return null;
}
if (output.size() != 2) {
return null;
}
HAS_RAMDISK = "true".equalsIgnoreCase(System.getProperty("ro.build.ab_update"));
InstallerInitializer.HAS_RAMDISK = HAS_RAMDISK;
MAGISK_PATH = output.get(1);
MAGISK_PATH = output.size() < 3 ? "" : output.get(2);
Timber.i("Magisk runtime path: %s", MAGISK_PATH);
MAGISK_VERSION_CODE = Integer.parseInt(output.get(0));
MAGISK_VERSION_CODE = Integer.parseInt(output.get(1));
Timber.i("Magisk version code: %s", MAGISK_VERSION_CODE);
if (MAGISK_VERSION_CODE >= Constants.MAGISK_VER_CODE_FLAT_MODULES && MAGISK_VERSION_CODE < Constants.MAGISK_VER_CODE_PATH_SUPPORT && (MAGISK_PATH.isEmpty() || !Files.existsSU(new File(MAGISK_PATH)))) {
if (MAGISK_VERSION_CODE >= Constants.MAGISK_VER_CODE_FLAT_MODULES &&
MAGISK_VERSION_CODE < Constants.MAGISK_VER_CODE_PATH_SUPPORT &&
(MAGISK_PATH.isEmpty() || !new File(MAGISK_PATH).exists())) {
MAGISK_PATH = "/sbin";
}
if (MAGISK_PATH.length() != 0 && Files.existsSU(new File(MAGISK_PATH))) {
@ -147,46 +157,8 @@ public class InstallerInitializer extends Shell.Initializer {
@Override
public boolean onInit(@NonNull Context context, @NonNull Shell shell) {
// open a new shell
shell.newJob().add("id").exec().getOut();
// if Shell.isAppGrantedRoot() returns null, loop until it doesn't
if (Shell.isAppGrantedRoot() == null) {
Timber.w("Waiting for root access...");
while (Shell.isAppGrantedRoot() == null) {
try {
//noinspection BusyWait
Thread.sleep(100);
} catch (InterruptedException e) {
Timber.e(e);
}
}
}
boolean hasRoot = Boolean.TRUE.equals(Shell.isAppGrantedRoot());
if (!hasRoot) {
Timber.w("No root access, or libsu is misreporting");
return false;
}
// switch to global namespace
// first, try to copy /data/adb/magisk/busybox to /data/local/tmp
// if that fails, return false
if (shell.newJob().add("cp -f /data/adb/magisk/busybox /data/local/tmp").exec().isSuccess()) {
// switch to local namespace
// first check if nsenter is available
if (!shell.newJob().add("which nsenter").exec().isSuccess()) {
Timber.w("nsenter cmd unavailable");
return shell.newJob().add("export ASH_STANDALONE=1; /data/local/tmp/busybox ash").exec().isSuccess();
} else {
return shell.newJob().add("export ASH_STANDALONE=1; nsenter -t 1 -m -u /data/local/tmp/busybox ash").exec().isSuccess();
}
} else {
Timber.w("Could not copy bb");
return false;
}
}
public interface Callback {
void onPathReceived(String path);
void onFailure(int error);
if (!shell.isRoot())
return true;
return shell.newJob().add("export ASH_STANDALONE=1").exec().isSuccess();
}
}

@ -163,7 +163,7 @@
<string name="crash_reporting_restart_message">La aplicación necesita ser reiniciada para que los cambios sean aplicados</string>
<string name="restart">Reiniciar</string>
<string name="androidacy_test_mode_disable_warning">La aplicación se reiniciará para deshabilitar el canal de prueba</string>
<string name="email">Tu correo</string>
<string name="email">Tu correo electrónico</string>
<string name="permission_notification_title">Permitir notificaciones\?</string>
<string name="permission_notification_grant">Conceder permiso</string>
<string name="repos">Repositorios</string>
@ -264,10 +264,10 @@
<string name="theme_black">AMOLED Negro</string>
<string name="setup_title">Configuración inicial</string>
<string name="language_cta_desc">Ayúdanos traduciéndolo! Pulsa aquí para averiguar más.</string>
<string name="install_terminal_reboot_now_message">Estas a punto de reiniciar tu dispositivo. Si guardaste tu trabajo, pulsa OK para continuar.
\nDe lo contrario, pulsa cancelar.</string>
<string name="install_terminal_reboot_now_message">Estas a punto de reiniciar tu dispositivo. Si guardaste tu trabajo, pulsa OK para continuar. De lo contrario, pulsa cancelar.</string>
<string name="setup_theme_system">Seguir al sistema</string>
<string name="repo_update_failed_message">Los siguientes repositorios han fallado al actualizarse.
<string name="repo_update_failed_message">Los siguientes repositorios han fallado al actualizarse:
\n
\n%s</string>
<string name="androidacy_webview_update_required">Tu webview está desactualizado! Por favor actualízalo.</string>
<string name="submit">Enviar</string>
@ -303,4 +303,33 @@
<string name="reset_app_message">Esto eliminará por completo todos los datos de la aplicación y la cerrará. Los módulos no se desinstalarán.</string>
<string name="donate_fox">Donar a Fox2Code</string>
<string name="error_encrypted_shared_preferences">Ocurrió un error al leer las preferencias compartidas. Por favor reinicie la aplicación.</string>
<string name="sentry_dialogue_no_description">No se pudo enviar comentarios por que no se proporcionó una descripción</string>
<string name="sentry_dialogue_failed_toast">No se pudo enviar el comentario debido a un error</string>
<string name="sentry_dialogue_success">Comentario enviado exitosamente. Lo revisaremos en breve</string>
<string name="custom_repo_always_on">Los repositorios personalizados siempre están activos hasta que los elimine.</string>
<string name="transparent_theme_dialogue_title">Esta configurando un tema transparente</string>
<string name="androidacy_thanks_desc">Un gran agradecimiento a Androidacy por su integración y contribuciones a la aplicación.</string>
<string name="share_logs">Compartir registros de FoxMMM</string>
<string name="not_official_build">Esta aplicación es una compilación no oficial de FoxMMM.</string>
<string name="error_saving_logs">No se pudieron guardar los registros</string>
<string name="save_logs">Guardar registros en el almacenamiento y compartir</string>
<string name="setup_background_update_check_summary">Permítanos buscar actualizaciones de módulos y aplicaciones en segundo plano. Esta característica puede usar más batería y datos.</string>
<string name="install_terminal_config_missing">Falta el paquete %s para configuración del módulo, por lo que no podemos iniciarlo.</string>
<string name="setup_crash_reporting_summary">Reporte de fallos y monitoreo del rendimiento. Todos los reportes son estrictamente anónimos y confidenciales.</string>
<string name="low_performance_device_dialogue_title">Activar desenfoque en dispositivo de gama baja</string>
<string name="setup_theme_transparent_light">Tema transparente claro - desactivará monet y desenfoque!</string>
<string name="error_no_action">ERROR: Acción inválida especificada. Negarse a continuar.</string>
<string name="error_no_asset">ERROR: No se pudo analizar la información de actualización</string>
<string name="reset_api_key">Restablecer claves API</string>
<string name="upgrade_androidacy_promo">Mejora a premium</string>
<string name="feedback_message">Danos más detalles sobre lo que estabas haciendo cuando esto sucedió. ¡Cuanto más, mejor!</string>
<string name="please_feedback">Por favor ayúdanos diciéndonos qué estabas tratando de hacer cuando esto sucedió.</string>
<string name="sentry_dialogue_disabled">El reporte de fallos está desactivado. Actívelo para enviar comentarios.</string>
<string name="reset_warning">Si sigues viendo esta pantalla, reiniciar la aplicación puede ayudar. Esto borrará los datos de la aplicación pero no afectará a los módulos instalados.</string>
<string name="notification_update_ignore_desc">Lista de módulos para excluir de las comprobaciones de actualización</string>
<string name="notification_channel_category_background_update">Estado de actualización en segundo plano</string>
<string name="notification_channel_background_update_description">FoxMMM comprobando actualizaciones en segundo plano.</string>
<string name="notification_update_app_pref">Comprobar actualizaciones de la aplicación</string>
<string name="setup_app_analytics">Permitir análisis de aplicación</string>
<string name="notification_update_app_desc">Active la comprobación automática de las actualizaciones de aplicaciones. Las actualizaciones no se descargarán automáticamente.</string>
</resources>
Loading…
Cancel
Save