Remove ministro code

Since Ministro no longer work on recent Android versions (Android 8+),
and it hasn't been maintained and the repos are not updated, the
existing code is practically a dead code.

[ChangeLog][Android] Remove ministro code since it's been unmaintained
and not working with recent Android versions.

Task-number: QTBUG-85201
Pick-to: 6.2
Change-Id: I18d7b1e209cba3cfd04674060e9bf39aa5a5510f
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
Assam Boudjelthia 2020-06-16 12:03:41 +03:00
parent 6948c5b3ae
commit af6bc5a21b
34 changed files with 11 additions and 397 deletions

View File

@ -36,8 +36,6 @@
<!-- Used to specify custom system library path to run with local system libs -->
<!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
<!-- Messages maps -->
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
<meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
<!-- Messages maps -->

View File

@ -1151,7 +1151,6 @@ public class ExtractStyle {
json.put("width", bmp.getWidth());
json.put("height", bmp.getHeight());
m_drawableCache.put(filename, new DrawableCache(json, drawable));
// MinistroActivity.nativeChmode(filename, 0644);
} catch (JSONException e) {
e.printStackTrace();
}
@ -1972,11 +1971,9 @@ public class ExtractStyle {
public ExtractStyle(Context context, String extractPath, boolean minimal)
{
// Log.i(MinistroService.TAG, "Extract " + extractPath);
m_minimal = minimal;
m_extractPath = extractPath + "/";
new File(m_extractPath).mkdirs();
// MinistroActivity.nativeChmode(m_extractPath, 0755);
m_context = context;
m_theme = context.getTheme();
TypedArray array = m_theme.obtainStyledAttributes(new int[]{
@ -2027,7 +2024,6 @@ public class ExtractStyle {
}
jsonWriter.endObject();
jsonWriter.close();
// MinistroActivity.nativeChmode(m_extractPath+"style.json", 0644);
}
catch (Exception e) {
e.printStackTrace();

View File

@ -119,7 +119,6 @@ public class QtActivityDelegate
private static final String ENVIRONMENT_VARIABLES_KEY = "environment.variables";
private static final String APPLICATION_PARAMETERS_KEY = "application.parameters";
private static final String STATIC_INIT_CLASSES_KEY = "static.init.classes";
private static final String NECESSITAS_API_LEVEL_KEY = "necessitas.api.level";
private static final String EXTRACT_STYLE_KEY = "extract.android.style";
private static final String EXTRACT_STYLE_MINIMAL_KEY = "extract.android.style.option";
@ -674,14 +673,9 @@ public class QtActivityDelegate
return false;
}
int necessitasApiLevel = 1;
if (loaderParams.containsKey(NECESSITAS_API_LEVEL_KEY))
necessitasApiLevel = loaderParams.getInt(NECESSITAS_API_LEVEL_KEY);
m_environmentVariables = loaderParams.getString(ENVIRONMENT_VARIABLES_KEY);
String additionalEnvironmentVariables = "QT_ANDROID_FONTS_MONOSPACE=Droid Sans Mono;Droid Sans;Droid Sans Fallback"
+ "\tQT_ANDROID_FONTS_SERIF=Droid Serif"
+ "\tNECESSITAS_API_LEVEL=" + necessitasApiLevel
+ "\tHOME=" + m_activity.getFilesDir().getAbsolutePath()
+ "\tTMPDIR=" + m_activity.getFilesDir().getAbsolutePath();

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Ministro-Dienst wurde nicht gefunden.\nAnwendung kann nicht gestartet werden</string>
<string name="ministro_needed_msg">Diese Anwendung benötigt den Ministro-Dienst. Möchten Sie ihn installieren?</string>
<string name="fatal_error_msg">In Ihrer Anwendung ist ein schwerwiegender Fehler aufgetreten, sie kann nicht fortgesetzt werden</string>
<string name="unsupported_android_version">Diese Android-Version wird nicht unterstützt.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Δεν ήταν δυνατή η εύρεση της υπηρεσίας Ministro. Δεν είναι δυνατή η εκκίνηση της εφαρμογής.</string>
<string name="ministro_needed_msg">Η εφαρμογή απαιτεί την υπηρεσία Ministro. Να εγκατασταθεί η υπηρεσία?</string>
<string name="fatal_error_msg">Παρουσιάστηκε ένα κρίσιμο σφάλμα και η εφαρμογή δεν μπορεί να συνεχίσει.</string>
<string name="unsupported_android_version">Αυτή η έκδοση του Android δεν υποστηρίζεται.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Servicio Ministro inesistente. Imposible ejecutar la aplicación.</string>
<string name="ministro_needed_msg">Esta aplicación requiere el servicio Ministro. Instalarlo?</string>
<string name="fatal_error_msg">La aplicación ha causado un error grave y no es posible continuar.</string>
<string name="unsupported_android_version">Esta versión de Android no es compatible.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Ei suuda leida Ministro teenust.\nProgrammi ei saa käivitada.</string>
<string name="ministro_needed_msg">See programm vajab Ministro teenust.\nKas soovite paigaldada?</string>
<string name="fatal_error_msg">Programmiga juhtus fataalne viga.\nKahjuks ei saa jätkata.</string>
<string name="unsupported_android_version">Seda Androidi versiooni ei toetata.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">سرویس Ministro را پیدا نمی‌کند. برنامه نمی‌تواند آغاز شود.</string>
<string name="ministro_needed_msg">این نرم‌افزار به سرویس Ministro احتیاج دارد. آیا دوست دارید آن را نصب کنید؟</string>
<string name="fatal_error_msg">خطایی اساسی در برنامه‌تان رخ داد و اجرای برنامه نمی‌تواند ادامه یابد.</string>
<string name="unsupported_android_version">این نسخه از Android پشتیبانی نمی شود</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Le service Ministro est introuvable.\nL\'application ne peut pas démarrer.</string>
<string name="ministro_needed_msg">Cette application requiert le service Ministro. Voulez-vous l\'installer?</string>
<string name="fatal_error_msg">Votre application a rencontré une erreur fatale et ne peut pas continuer.</string>
<string name="unsupported_android_version">Cette version d\'Android n\'est pas supportée.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Layanan Ministro tidak bisa ditemukan.\nAplikasi tidak bisa dimulai.</string>
<string name="ministro_needed_msg">Aplikasi ini membutuhkan layanan Ministro. Apakah Anda ingin menginstalnya?</string>
<string name="fatal_error_msg">Aplikasi Anda mengalami kesalahan fatal dan tidak dapat melanjutkan.</string>
<string name="unsupported_android_version">Versi Android ini tidak didukung.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Servizio Ministro inesistente. Impossibile eseguire \nl\'applicazione.</string>
<string name="ministro_needed_msg">Questa applicazione richiede il servizio Ministro.Installarlo?</string>
<string name="fatal_error_msg">L\'applicazione ha provocato un errore grave e non puo\' continuare.</string>
<string name="unsupported_android_version">Questa versione di Android non è supportata.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Ministroサービスが見つかりません。\nアプリケーションが起動できません。</string>
<string name="ministro_needed_msg">このアプリケーションにはMinistroサービスが必要です。 インストールしてもよろしいですか?</string>
<string name="fatal_error_msg">アプリケーションで致命的なエラーが発生したため続行できません。</string>
<string name="unsupported_android_version">このバージョンのAndroidはサポートされていません。</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Tidak jumpa servis Ministro.\nAplikasi tidak boleh dimulakan.</string>
<string name="ministro_needed_msg">Aplikasi ini memerlukan servis Ministro. Adakah anda ingin pasang servis itu?</string>
<string name="fatal_error_msg">Aplikasi anda menemui ralat muat dan tidak boleh diteruskan.</string>
<string name="unsupported_android_version">Versi Android ini tidak disokong.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Kan ikke finne tjenesten Ministro. Applikasjonen kan ikke starte.</string>
<string name="ministro_needed_msg">Denne applikasjonen krever tjenesten Ministro. Vil du installere denne?</string>
<string name="fatal_error_msg">Applikasjonen fikk en kritisk feil og kan ikke fortsette</string>
<string name="unsupported_android_version">Denne versjonen av Android støttes ikke.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">De Ministro service is niet gevonden.\nDe applicatie kan niet starten.</string>
<string name="ministro_needed_msg">Deze applicatie maakt gebruik van de Ministro service. Wilt u deze installeren?</string>
<string name="fatal_error_msg">Er is een fatale fout in de applicatie opgetreden. De applicatie kan niet verder gaan.</string>
<string name="unsupported_android_version">Deze versie van Android wordt niet ondersteund.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Usługa Ministro nie została znaleziona.\nAplikacja nie może zostać uruchomiona.</string>
<string name="ministro_needed_msg">Aplikacja wymaga usługi Ministro. Czy chcesz ją zainstalować?</string>
<string name="fatal_error_msg">Wystąpił błąd krytyczny. Aplikacja zostanie zamknięta.</string>
<string name="unsupported_android_version">Ta wersja Androida nie jest obsługiwana.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Não foi possível encontrar o serviço Ministro.\nA aplicação não pode iniciar.</string>
<string name="ministro_needed_msg">Essa aplicação requer o serviço Ministro. Gostaria de instalá-lo?</string>
<string name="fatal_error_msg">Sua aplicação encontrou um erro fatal e não pode continuar.</string>
<string name="unsupported_android_version">Esta versão do Android não é suportada.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Serviciul Ministro nu poate fi găsit.\nAplicaţia nu poate porni.</string>
<string name="ministro_needed_msg">Această aplicaţie necesită serviciul Ministro.\nDoriţi să-l instalaţi?</string>
<string name="fatal_error_msg">Aplicaţia dumneavoastră a întâmpinat o eroare fatală şi nu poate continua.</string>
<string name="unsupported_android_version">Această versiune de Android nu este suportată.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Сервис Ministro не найден.\nПриложение нельзя запустить.</string>
<string name="ministro_needed_msg">Этому приложению необходим сервис Ministro. Вы хотите его установить?</string>
<string name="fatal_error_msg">Ваше приложение столкнулось с фатальной ошибкой и не может более работать.</string>
<string name="unsupported_android_version">Эта версия Android не поддерживается.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">Ministro servise nije pronađen. Aplikacija ne može biti pokrenuta.</string>
<string name="ministro_needed_msg">Ova aplikacija zahteva Ministro servis. Želite li da ga instalirate?</string>
<string name="fatal_error_msg">Vaša aplikacija je naišla na fatalnu grešku i ne može nastaviti sa radom.</string>
<string name="unsupported_android_version">Ova verzija Android-a nije podržana.</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">无法找到Ministro服务。\n应用程序无法启动。</string>
<string name="ministro_needed_msg">此应用程序需要Ministro服务。您想安装它吗</string>
<string name="fatal_error_msg">您的应用程序遇到一个致命错误导致它无法继续。</string>
<string name="unsupported_android_version">这个版本的安卓系统不被支持。</string>
</resources>

View File

@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="ministro_not_found_msg">無法找到Ministro服務。\n應用程序無法啟動。</string>
<string name="ministro_needed_msg">此應用程序需要Ministro服務。您想安裝它嗎</string>
<string name="fatal_error_msg">您的應用程序遇到一個致命錯誤導致它無法繼續。</string>
<string name="unsupported_android_version">這個版本的安卓系統不被支持。</string>
</resources>

View File

@ -1,8 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<!-- %%INSERT_STRINGS -->
<string name="ministro_not_found_msg">Can\'t find Ministro service.\nThe application can\'t start.</string>
<string name="ministro_needed_msg">This application requires Ministro service. Would you like to install it?</string>
<string name="fatal_error_msg">Your application encountered a fatal error and cannot continue.</string>
<string name="unsupported_android_version">This version of Android is not supported.</string>
</resources>

View File

@ -1,60 +0,0 @@
/*
Copyright (c) 2011-2013, BogDan Vatra <bogdan@kde.org>
Contact: http://www.qt.io/licensing/
Commercial License Usage
Licensees holding valid commercial Qt licenses may use this file in
accordance with the commercial license agreement provided with the
Software or, alternatively, in accordance with the terms contained in
a written agreement between you and The Qt Company. For licensing terms
and conditions see http://www.qt.io/terms-conditions. For further
information use the contact form at http://www.qt.io/contact-us.
BSD License Usage
Alternatively, this file may be used under the BSD license as follows:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.kde.necessitas.ministro;
import org.kde.necessitas.ministro.IMinistroCallback;
interface IMinistro
{
/**
* Check/download required libs to run the application
*
* param callback - interface used by Minsitro service to notify the client when the loader is ready
* param parameters
* parameters fields:
* * Key Name Key type Explanations
* "sources" StringArray Sources list from where Ministro will download the libs. Make sure you are using ONLY secure locations.
* "repository" String Overwrites the default Ministro repository. Possible values: default, stable, testing and unstable
* "required.modules" StringArray Required modules by your application
* "application.title" String Application name, used to show more informations to user
* "qt.provider" String Qt libs provider, currently only "necessitas" is supported.
* "minimum.ministro.api" Integer Minimum Ministro API level, used to check if Ministro service compatible with your application. Current API Level is 3 !
* "minimum.qt.version" Integer Minimim Qt version (e.g. 0x040800, which means Qt 4.8.0, check http://qt-project.org/doc/qt-4.8/qtglobal.html#QT_VERSION)!
*/
void requestLoader(in IMinistroCallback callback, in Bundle parameters);
}

View File

@ -1,65 +0,0 @@
/*
Copyright (c) 2011-2013, BogDan Vatra <bogdan@kde.org>
Contact: http://www.qt.io/licensing/
Commercial License Usage
Licensees holding valid commercial Qt licenses may use this file in
accordance with the commercial license agreement provided with the
Software or, alternatively, in accordance with the terms contained in
a written agreement between you and The Qt Company. For licensing terms
and conditions see http://www.qt.io/terms-conditions. For further
information use the contact form at http://www.qt.io/contact-us.
BSD License Usage
Alternatively, this file may be used under the BSD license as follows:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.kde.necessitas.ministro;
oneway interface IMinistroCallback {
/**
* This method is called by the Ministro service back into the application which
* implements this interface.
*
* param in - loaderParams
* loaderParams fields:
* * Key Name Key type Explanations
* * "error.code" Integer See below
* * "error.message" String Missing if no error, otherwise will contain the error message translated into phone language where available.
* * "dex.path" String The list of jar/apk files containing classes and resources, needed to be passed to application DexClassLoader
* * "lib.path" String The list of directories containing native libraries; may be missing, needed to be passed to application DexClassLoader
* * "loader.class.name" String Loader class name.
*
* "error.code" field possible errors:
* - 0 no error.
* - 1 incompatible Ministro version. Ministro needs to be upgraded.
* - 2 not all modules could be satisfy.
* - 3 invalid parameters
* - 4 invalid qt version
* - 5 download canceled
*
* The parameter contains additional fields which are used by the loader to start your application, so it must be passed to the loader.
*/
void loaderReady(in Bundle loaderParams);
}

View File

@ -168,8 +168,6 @@ public class QtActivity extends Activity
QtApplication.invokeDelegateMethod(QtApplication.onActivityResult, requestCode, resultCode, data);
return;
}
if (requestCode == QtLoader.MINISTRO_INSTALL_REQUEST_CODE)
m_loader.startApp(false);
super.onActivityResult(requestCode, resultCode, data);
}
public void super_onActivityResult(int requestCode, int resultCode, Intent data)

View File

@ -58,32 +58,6 @@ public class QtActivityLoader extends QtLoader {
super(activity, QtActivity.class);
m_activity = activity;
}
@Override
protected void downloadUpgradeMinistro(String msg) {
AlertDialog.Builder downloadDialog = new AlertDialog.Builder(m_activity);
downloadDialog.setMessage(msg);
downloadDialog.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
try {
Uri uri = Uri.parse("market://details?id=org.kde.necessitas.ministro");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
m_activity.startActivityForResult(intent, MINISTRO_INSTALL_REQUEST_CODE);
} catch (Exception e) {
e.printStackTrace();
ministroNotFound();
}
}
});
downloadDialog.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
m_activity.finish();
}
});
downloadDialog.show();
}
@Override
protected String loaderClassName() {

View File

@ -37,22 +37,15 @@
package org.qtproject.qt.android.bindings;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.ComponentInfo;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import org.kde.necessitas.ministro.IMinistro;
import org.kde.necessitas.ministro.IMinistroCallback;
import java.io.File;
import java.io.FileOutputStream;
import java.lang.reflect.Method;
@ -65,11 +58,6 @@ import dalvik.system.DexClassLoader;
public abstract class QtLoader {
public final static int MINISTRO_INSTALL_REQUEST_CODE = 0xf3ee; // request code used to know when Ministro instalation is finished
public static final int MINISTRO_API_LEVEL = 5; // Ministro api level (check IMinistro.aidl file)
public static final int NECESSITAS_API_LEVEL = 2; // Necessitas api level used by platform plugin
public static final int QT_VERSION = 0x050700; // This app requires at least Qt version 5.7.0
public static final String ERROR_CODE_KEY = "error.code";
public static final String ERROR_MESSAGE_KEY = "error.message";
public static final String DEX_PATH_KEY = "dex.path";
@ -81,7 +69,6 @@ public abstract class QtLoader {
public static final String BUNDLED_LIBRARIES_KEY = "bundled.libraries";
public static final String MAIN_LIBRARY_KEY = "main.library";
public static final String STATIC_INIT_CLASSES_KEY = "static.init.classes";
public static final String NECESSITAS_API_LEVEL_KEY = "necessitas.api.level";
public static final String EXTRACT_STYLE_KEY = "extract.android.style";
private static final String EXTRACT_STYLE_MINIMAL_KEY = "extract.android.style.option";
@ -89,20 +76,6 @@ public abstract class QtLoader {
public static final String SYSTEM_LIB_PATH = "/system/lib/";
public String[] SYSTEM_APP_PATHS = {"/system/priv-app/", "/system/app/"};
/// Ministro server parameter keys
public static final String REQUIRED_MODULES_KEY = "required.modules";
public static final String APPLICATION_TITLE_KEY = "application.title";
public static final String MINIMUM_MINISTRO_API_KEY = "minimum.ministro.api";
public static final String MINIMUM_QT_VERSION_KEY = "minimum.qt.version";
public static final String SOURCES_KEY = "sources"; // needs MINISTRO_API_LEVEL >=3 !!!
// Use this key to specify any 3rd party sources urls
// Ministro will download these repositories into their
// own folders, check http://community.kde.org/Necessitas/Ministro
// for more details.
public static final String REPOSITORY_KEY = "repository"; // use this key to overwrite the default ministro repsitory
public static final String ANDROID_THEMES_KEY = "android.themes"; // themes that your application uses
public String APPLICATION_PARAMETERS = null; // use this variable to pass any parameters to your application,
// the parameters must not contain any white spaces
// and must be separated with "\t"
@ -129,20 +102,6 @@ public abstract class QtLoader {
public String QT_ANDROID_DEFAULT_THEME = null; // sets the default theme.
public static final int INCOMPATIBLE_MINISTRO_VERSION = 1; // Incompatible Ministro version. Ministro needs to be upgraded.
public String[] m_sources = {"https://download.qt-project.org/ministro/android/qt5/qt-5.7"}; // Make sure you are using ONLY secure locations
public String m_repository = "default"; // Overwrites the default Ministro repository
// Possible values:
// * default - Ministro default repository set with "Ministro configuration tool".
// By default the stable version is used. Only this or stable repositories should
// be used in production.
// * stable - stable repository, only this and default repositories should be used
// in production.
// * testing - testing repository, DO NOT use this repository in production,
// this repository is used to push a new release, and should be used to test your application.
// * unstable - unstable repository, DO NOT use this repository in production,
// this repository is used to push Qt snapshots.
public ArrayList<String> m_qtLibs = null; // required qt libs
public int m_displayDensity = -1;
private ContextWrapper m_context;
@ -167,10 +126,6 @@ public abstract class QtLoader {
protected void runOnUiThread(Runnable run) {
run.run();
}
protected void downloadUpgradeMinistro(String msg)
{
Log.e(QtApplication.QtTAG, msg);
}
protected abstract String loaderClassName();
protected abstract Class<?> contextClassName();
@ -218,11 +173,6 @@ public abstract class QtLoader {
try {
final int errorCode = loaderParams.getInt(ERROR_CODE_KEY);
if (errorCode != 0) {
if (errorCode == INCOMPATIBLE_MINISTRO_VERSION) {
downloadUpgradeMinistro(loaderParams.getString(ERROR_MESSAGE_KEY));
return;
}
// fatal error, show the error and quit
AlertDialog errorDialog = new AlertDialog.Builder(m_context).create();
errorDialog.setMessage(loaderParams.getString(ERROR_MESSAGE_KEY));
@ -250,7 +200,6 @@ public abstract class QtLoader {
}
loaderParams.putStringArrayList(BUNDLED_LIBRARIES_KEY, libs);
loaderParams.putInt(NECESSITAS_API_LEVEL_KEY, NECESSITAS_API_LEVEL);
// load and start QtLoader class
DexClassLoader classLoader = new DexClassLoader(loaderParams.getString(DEX_PATH_KEY), // .jar/.apk files
@ -291,82 +240,9 @@ public abstract class QtLoader {
}
}
private ServiceConnection m_ministroConnection=new ServiceConnection() {
private IMinistro m_service = null;
@Override
public void onServiceConnected(ComponentName name, IBinder service)
{
m_service = IMinistro.Stub.asInterface(service);
try {
if (m_service != null) {
Bundle parameters = new Bundle();
parameters.putStringArray(REQUIRED_MODULES_KEY, (String[]) m_qtLibs.toArray());
parameters.putString(APPLICATION_TITLE_KEY, getTitle());
parameters.putInt(MINIMUM_MINISTRO_API_KEY, MINISTRO_API_LEVEL);
parameters.putInt(MINIMUM_QT_VERSION_KEY, QT_VERSION);
parameters.putString(ENVIRONMENT_VARIABLES_KEY, ENVIRONMENT_VARIABLES);
if (APPLICATION_PARAMETERS != null)
parameters.putString(APPLICATION_PARAMETERS_KEY, APPLICATION_PARAMETERS);
parameters.putStringArray(SOURCES_KEY, m_sources);
parameters.putString(REPOSITORY_KEY, m_repository);
if (QT_ANDROID_THEMES != null)
parameters.putStringArray(ANDROID_THEMES_KEY, QT_ANDROID_THEMES);
m_service.requestLoader(m_ministroCallback, parameters);
}
} catch (RemoteException e) {
e.printStackTrace();
}
}
private IMinistroCallback m_ministroCallback = new IMinistroCallback.Stub() {
// this function is called back by Ministro.
@Override
public void loaderReady(final Bundle loaderParams) throws RemoteException {
runOnUiThread(new Runnable() {
@Override
public void run() {
m_context.unbindService(m_ministroConnection);
loadApplication(loaderParams);
}
});
}
};
@Override
public void onServiceDisconnected(ComponentName name) {
m_service = null;
}
};
protected void ministroNotFound()
{
AlertDialog errorDialog = new AlertDialog.Builder(m_context).create();
if (m_contextInfo.metaData.containsKey("android.app.ministro_not_found_msg"))
errorDialog.setMessage(m_contextInfo.metaData.getString("android.app.ministro_not_found_msg"));
else
errorDialog.setMessage("Can't find Ministro service.\nThe application can't start.");
errorDialog.setButton(m_context.getResources().getString(android.R.string.ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
errorDialog.show();
}
public void startApp(final boolean firstStart)
{
try {
if (m_contextInfo.metaData.containsKey("android.app.qt_sources_resource_id")) {
int resourceId = m_contextInfo.metaData.getInt("android.app.qt_sources_resource_id");
m_sources = m_context.getResources().getStringArray(resourceId);
}
if (m_contextInfo.metaData.containsKey("android.app.repository"))
m_repository = m_contextInfo.metaData.getString("android.app.repository");
if (m_contextInfo.metaData.containsKey("android.app.qt_libs_resource_id")) {
int resourceId = m_contextInfo.metaData.getInt("android.app.qt_libs_resource_id");
m_qtLibs = prefferedAbiLibs(m_context.getResources().getStringArray(resourceId));
@ -472,8 +348,7 @@ public abstract class QtLoader {
if (extractOption.equals("full"))
ENVIRONMENT_VARIABLES += "\tQT_USE_ANDROID_NATIVE_STYLE=1";
ENVIRONMENT_VARIABLES += "\tMINISTRO_ANDROID_STYLE_PATH=" + stylePath
+ "\tQT_ANDROID_THEMES_ROOT_PATH=" + themePath;
ENVIRONMENT_VARIABLES += "\tANDROID_STYLE_PATH=" + stylePath;
loaderParams.putString(ENVIRONMENT_VARIABLES_KEY, ENVIRONMENT_VARIABLES);
@ -505,23 +380,6 @@ public abstract class QtLoader {
loadApplication(loaderParams);
return;
}
try {
if (!m_context.bindService(new Intent(org.kde.necessitas.ministro.IMinistro.class.getCanonicalName()),
m_ministroConnection,
Context.BIND_AUTO_CREATE)) {
throw new SecurityException("");
}
} catch (Exception e) {
if (firstStart) {
String msg = "This application requires Ministro service. Would you like to install it?";
if (m_contextInfo.metaData.containsKey("android.app.ministro_needed_msg"))
msg = m_contextInfo.metaData.getString("android.app.ministro_needed_msg");
downloadUpgradeMinistro(msg);
} else {
ministroNotFound();
}
}
} catch (Exception e) {
Log.e(QtApplication.QtTAG, "Can't create main activity", e);
}

View File

@ -21,8 +21,6 @@
<!-- Application arguments -->
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
<meta-data android:name="android.app.repository" android:value="default"/>
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
<!-- Deploy Qt libs as part of package -->
@ -30,15 +28,12 @@
<!-- Run with local libs -->
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
<meta-data android:name="android.app.load_local_libs_resource_id" android:resource="@array/load_local_libs"/>
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
<!-- Used to specify custom system library path to run with local system libs -->
<!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
<!-- Messages maps -->
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
<meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
<!-- Messages maps -->

View File

@ -1,9 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<array name="qt_sources">
<item>https://download.qt.io/ministro/android/qt5/qt-5.14</item>
</array>
<!-- The following is handled automatically by the deployment tool. It should
not be edited manually. -->

View File

@ -482,9 +482,6 @@ static int uniqueActivityRequestCode()
static int requestCode = 0x1000; // Reserve all request codes under 0x1000 for Qt.
QMutexLocker locker(&mutex);
if (requestCode == 0xf3ee) // Special case for MINISTRO_INSTALL_REQUEST_CODE
requestCode++;
if (requestCode == INT_MAX)
qWarning("Unique activity request code has wrapped. Unexpected behavior may occur.");

View File

@ -187,21 +187,17 @@ static void setPaletteColor(const QVariantMap &object,
QJsonObject AndroidStyle::loadStyleData()
{
QString stylePath(QLatin1String(qgetenv("MINISTRO_ANDROID_STYLE_PATH")));
QString stylePath(QLatin1String(qgetenv("ANDROID_STYLE_PATH")));
const QLatin1Char slashChar('/');
if (!stylePath.isEmpty() && !stylePath.endsWith(slashChar))
stylePath += slashChar;
Q_ASSERT(!stylePath.isEmpty());
QString androidTheme = QLatin1String(qgetenv("QT_ANDROID_THEME"));
if (!androidTheme.isEmpty() && !androidTheme.endsWith(slashChar))
androidTheme += slashChar;
if (stylePath.isEmpty()) {
stylePath = QLatin1String("/data/data/org.kde.necessitas.ministro/files/dl/style/")
+ QLatin1String(qgetenv("QT_ANDROID_THEME_DISPLAY_DPI")) + slashChar;
}
Q_ASSERT(!stylePath.isEmpty());
if (!androidTheme.isEmpty() && QFileInfo::exists(stylePath + androidTheme + QLatin1String("style.json")))
stylePath += androidTheme;

View File

@ -408,20 +408,6 @@ QList<QSslCertificate> systemCaCertificates()
directories = QSslSocketPrivate::unixRootCertDirectories();
nameFilters << QLatin1String("*.pem") << QLatin1String("*.crt");
platformEncodingFormat = QSsl::Pem;
# else
// Q_OS_ANDROID
QByteArray ministroPath = qgetenv("MINISTRO_SSL_CERTS_PATH"); // Set by Ministro
directories << ministroPath;
nameFilters << QLatin1String("*.der");
platformEncodingFormat = QSsl::Der;
# ifndef Q_OS_ANDROID_EMBEDDED
if (ministroPath.isEmpty()) {
QList<QByteArray> certificateData = fetchSslCertificateData();
for (int i = 0; i < certificateData.size(); ++i) {
systemCerts.append(QSslCertificate::fromData(certificateData.at(i), QSsl::Der));
}
} else
# endif //Q_OS_ANDROID_EMBEDDED
# endif //Q_OS_ANDROID
{
currentDir.setNameFilters(nameFilters);

View File

@ -137,8 +137,7 @@ struct Options
enum DeploymentMechanism
{
Bundled,
Ministro
Bundled
};
enum TriState {
@ -452,9 +451,7 @@ Options parseOptions()
options.helpRequested = true;
} else {
QString deploymentMechanism = arguments.at(++i);
if (deploymentMechanism.compare(QLatin1String("ministro"), Qt::CaseInsensitive) == 0) {
options.deploymentMechanism = Options::Ministro;
} else if (deploymentMechanism.compare(QLatin1String("bundled"), Qt::CaseInsensitive) == 0) {
if (deploymentMechanism.compare(QLatin1String("bundled"), Qt::CaseInsensitive) == 0) {
options.deploymentMechanism = Options::Bundled;
} else {
fprintf(stderr, "Unrecognized deployment mechanism: %s\n", qPrintable(deploymentMechanism));
@ -595,7 +592,6 @@ void printHelp()
"\n"
" --deployment <mechanism>: Supported deployment mechanisms:\n"
" bundled (default): Include Qt files in stand-alone package.\n"
" ministro: Use the Ministro service to manage Qt files.\n"
"\n"
" --aab: Build an Android App Bundle.\n"
"\n"
@ -1474,8 +1470,8 @@ bool updateAndroidManifest(Options &options)
replacements[QStringLiteral("package=\"org.qtproject.example\"")] = QLatin1String("package=\"%1\"").arg(options.packageName);
replacements[QStringLiteral("-- %%BUNDLE_LOCAL_QT_LIBS%% --")]
= (options.deploymentMechanism == Options::Bundled) ? QLatin1String("1") : QLatin1String("0");
replacements[QStringLiteral("-- %%USE_LOCAL_QT_LIBS%% --")]
= (options.deploymentMechanism != Options::Ministro) ? QLatin1String("1") : QLatin1String("0");
// use libs from the apk
replacements[QStringLiteral("-- %%USE_LOCAL_QT_LIBS%% --")] = QLatin1String("1");
QString permissions;
for (const QString &permission : qAsConst(options.permissions))
@ -2223,9 +2219,6 @@ bool copyQtFiles(Options *options)
case Options::Bundled:
fprintf(stdout, "Copying %zd dependencies from Qt into package.\n", size_t(options->qtDependencies.size()));
break;
case Options::Ministro:
fprintf(stdout, "Setting %zd dependencies from Qt in package.\n", size_t(options->qtDependencies.size()));
break;
};
}
@ -3035,7 +3028,7 @@ int main(int argc, char *argv[])
fprintf(stdout, "[TIMING] %d ms: Copied extra resources\n", options.timer.elapsed());
if (!options.auxMode) {
if (options.deploymentMechanism != Options::Ministro && !copyStdCpp(&options))
if (!copyStdCpp(&options))
return CannotCopyGnuStl;
if (Q_UNLIKELY(options.timing))
@ -3048,10 +3041,8 @@ int main(int argc, char *argv[])
if (Q_UNLIKELY(options.timing))
fprintf(stdout, "[TIMING] %d ms: Checked for application binary\n", options.timer.elapsed());
if (options.deploymentMechanism != Options::Ministro) {
if (Q_UNLIKELY(options.timing))
fprintf(stdout, "[TIMING] %d ms: Bundled Qt libs\n", options.timer.elapsed());
}
if (Q_UNLIKELY(options.timing))
fprintf(stdout, "[TIMING] %d ms: Bundled Qt libs\n", options.timer.elapsed());
}
if (!createRcc(options))