(Android) Remove GPL waiver

This commit is contained in:
twinaphex 2014-12-18 03:15:35 +01:00
parent 82f6c57966
commit 4f2909e3b5
2 changed files with 1 additions and 68 deletions

View File

@ -30,7 +30,6 @@ import com.retroarch.browser.NativeInterface;
import com.retroarch.browser.dirfragment.DetectCoreDirectoryFragment;
import com.retroarch.browser.dirfragment.DirectoryFragment;
import com.retroarch.browser.dirfragment.DirectoryFragment.OnDirectoryFragmentClosedListener;
import com.retroarch.browser.mainmenu.gplwaiver.GPLWaiverDialogFragment;
import com.retroarch.browser.preferences.fragments.util.PreferenceListFragment;
import com.retroarch.browser.preferences.util.UserPreferences;
import com.retroarch.browser.retroactivity.RetroActivityFuture;
@ -85,9 +84,7 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
.setMessage(R.string.welcome_to_retroarch_desc)
.setPositiveButton(R.string.ok, null);
alert.show();
// First-run, so we show the GPL waiver agreement dialog.
GPLWaiverDialogFragment.newInstance().show(getFragmentManager(), "gplWaiver");
UserPreferences.updateConfigFile(ctx);
}
}

View File

@ -1,64 +0,0 @@
package com.retroarch.browser.mainmenu.gplwaiver;
import java.io.File;
import com.retroarch.R;
import com.retroarch.browser.ModuleWrapper;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.util.Log;
/**
* {@link DialogFragment} responsible for displaying
* the GPL waiver dialog on the first-run of this app.
*/
public final class GPLWaiverDialogFragment extends DialogFragment
{
/**
* Method for statically instatiating a new
* instance of a GPLWaiverDialogFragment.
*
* @return a new instance of a GPLWaiverDialogFragment.
*/
public static GPLWaiverDialogFragment newInstance()
{
return new GPLWaiverDialogFragment();
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
AlertDialog.Builder gplDialog = new AlertDialog.Builder(getActivity());
gplDialog.setTitle(R.string.gpl_waiver);
gplDialog.setMessage(R.string.gpl_waiver_desc);
gplDialog.setPositiveButton(R.string.keep_cores, null);
gplDialog.setNegativeButton(R.string.remove_cores, new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
final File[] libs = new File(getActivity().getApplicationInfo().dataDir, "/cores").listFiles();
for (final File lib : libs)
{
ModuleWrapper module = new ModuleWrapper(getActivity(), 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();
}
}
}
});
return gplDialog.create();
}
}