(Android) Add GPL license waiver dialog box - text will need further

refinement
This commit is contained in:
twinaphex 2013-11-01 01:47:20 +01:00
parent 93c1bae991
commit 7021ada78f
2 changed files with 31 additions and 0 deletions

View File

@ -50,6 +50,8 @@
<string name="no_core">No core</string>
<string name="welcome_to_retroarch">Welcome to RetroArch</string>
<string name="welcome_to_retroarch_desc">This is your first time starting up RetroArch. RetroArch will now be preconfigured for the best possible gameplay experience.</string>
<string name="gpl_waiver">GPL waiver</string>
<string name="gpl_waiver_desc">Copyright (C) 2010-2013 RetroArch Team.\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program; if not, see www.gnu.org/licenses.\n\nAdditional permission under GNU GPL version 3 section 7\n\nIf you modify this Program, or any covered work, by linking or combining it with [name of library] (or a modified version of that library), containing parts covered by the terms of [name of library\'s license], the licensors of this Program grant you additional permission to convey the resulting work. {Corresponding Source for a non-source form of such a combination shall include the source code for the parts of [name of library] used as well as that of the covered work.}</string>
<string name="detect_device_msg_ouya">The ideal configuration options for your device will now be preconfigured.\n\nNOTE: For optimal performance, turn off Google Account sync, GPS and Wi-Fi in your Android settings menu.</string>
<string name="detect_device_msg_general">The ideal configuration options for your device will now be preconfigured.\n\nNOTE: For optimal performance, turn off Google Account sync, Google Play Store auto-updates, GPS and Wi-Fi in your Android settings menu.</string>
<string name="nvidia_shield_detected">NVidia Shield detected</string>

View File

@ -28,6 +28,33 @@ public final class MainMenuActivity extends PreferenceActivity {
private static final String TAG = "MainMenu";
private static String libretro_path;
private static String libretro_name;
private void showGPLWaiver() {
AlertDialog.Builder alert = new AlertDialog.Builder(this)
.setTitle(R.string.gpl_waiver)
.setMessage(R.string.gpl_waiver_desc)
.setPositiveButton("Keep", null)
.setNegativeButton("Remove non-GPL cores",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
final File[] libs = new File(getApplicationInfo().dataDir, "/cores").listFiles();
for (final File lib : libs) {
ModuleWrapper module = new ModuleWrapper(getApplicationContext(), lib);
boolean gplv3 = module.getCoreLicense().equals("GPLv3");
boolean gplv2 = module.getCoreLicense().equals("GPLv2");
if (!gplv3 && !gplv2) {
String libName = lib.getName();
Log.i("GPL WAIVER", "Deleting non-GPL core" + libName + "...");
lib.delete();
}
}
}
});
alert.show();
}
@Override
@SuppressWarnings("deprecation")
@ -61,6 +88,8 @@ public final class MainMenuActivity extends PreferenceActivity {
.setPositiveButton("OK", null);
alert.show();
}
showGPLWaiver();
}
Intent startedByIntent = getIntent();