Browse Source

Enable ProGuard

master 0.0.4
Trevor Slocum 3 years ago
parent
commit
d3b918a955
  1. 10
      app/build.gradle
  2. 4
      app/src/main/java/space/rocketnine/gophast/AboutActivity.java
  3. 3
      app/src/main/java/space/rocketnine/gophast/Download.java
  4. 2
      app/src/main/java/space/rocketnine/gophast/DownloadRunnable.java
  5. 2
      app/src/main/java/space/rocketnine/gophast/GoPhast.java
  6. 2
      app/src/main/java/space/rocketnine/gophast/MainActivity.java
  7. 6
      app/src/main/java/space/rocketnine/gophast/SettingsActivity.java
  8. 2
      app/src/main/res/values/strings.xml
  9. 8
      app/src/main/res/xml/pref_download.xml
  10. 2
      gradle.properties

10
app/build.gradle

@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "space.rocketnine.gophast"
@ -13,9 +14,16 @@ android {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
debug {
minifyEnabled false
shrinkResources false
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

4
app/src/main/java/space/rocketnine/gophast/AboutActivity.java

@ -4,8 +4,8 @@ import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
@ -32,7 +32,7 @@ public class AboutActivity extends AppCompatActivity {
String goPhastVersion = manager.Manager.getGoPhastVersion();
if (goPhastVersion.trim().isEmpty()) {
goPhastVersion = "?";
goPhastVersion = "?";
}
TextView txtAboutSubTitle = findViewById(R.id.txtAboutSubTitle);

3
app/src/main/java/space/rocketnine/gophast/Download.java

@ -1,11 +1,8 @@
package space.rocketnine.gophast;
import android.net.Uri;
import android.os.Environment;
import android.webkit.MimeTypeMap;
import java.io.File;
public class Download {
int Index;
long ID;

2
app/src/main/java/space/rocketnine/gophast/DownloadRunnable.java

@ -1,7 +1,5 @@
package space.rocketnine.gophast;
import android.app.Activity;
import android.app.DownloadManager;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;

2
app/src/main/java/space/rocketnine/gophast/GoPhast.java

@ -93,8 +93,6 @@ public class GoPhast extends Application {
downloads.add(download);
updateDownloadIndexes();
download.Index = downloads.size() - 1;
download.Path = Uri.fromFile(new File(getDownloadDir(), download.Name));
Log.d("gophast", "Add index " + download.Index);

2
app/src/main/java/space/rocketnine/gophast/MainActivity.java

@ -11,7 +11,6 @@ import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@ -20,7 +19,6 @@ import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
private GoPhast gophast;
private boolean startedSettings;
@Override
protected void onCreate(Bundle savedInstanceState) {

6
app/src/main/java/space/rocketnine/gophast/SettingsActivity.java

@ -2,7 +2,6 @@ package space.rocketnine.gophast;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
@ -13,15 +12,12 @@ import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceCategory;
import android.preference.PreferenceFragment;
import android.provider.DocumentsContract;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v4.provider.DocumentFile;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import android.text.format.Formatter;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@ -318,7 +314,7 @@ public class SettingsActivity extends PreferenceActivity {
if (requestCode == RequestDownloadDir && resultCode == Activity.RESULT_OK) {
// Use the provided utility method to parse the result
List<Uri> files = Utils.getSelectedFilesFromResult(intent);
for (Uri uri: files) {
for (Uri uri : files) {
File file = Utils.getFileForUri(uri);
getApp().getPrefs().edit().putString("pref_downloaddir", file.getAbsolutePath()).apply();

2
app/src/main/res/values/strings.xml

@ -5,7 +5,7 @@
<string name="invalidURL">Invalid URL</string>
<string name="url">URL</string>
<string name="settings">Settings</string>
<string name="directory">Directory</string>
<string name="saveFilesTo">Save files to</string>
<string name="minsplitsize">Minimum split size</string>
<string name="maxconnections">Maximum connections</string>
<string name="maxconnections_summary">%s per server</string>

8
app/src/main/res/xml/pref_download.xml

@ -1,10 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<Preference
android:key="pref_downloaddir"
android:title="@string/directory" />
<EditTextPreference
android:defaultValue="3"
android:key="pref_maxconnections"
@ -15,4 +11,8 @@
android:key="pref_minsplitsize"
android:title="@string/minsplitsize" />
<Preference
android:key="pref_downloaddir"
android:title="@string/saveFilesTo" />
</PreferenceScreen>

2
gradle.properties

@ -11,5 +11,3 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

Loading…
Cancel
Save