Skip to content

Commit

Permalink
Improve DB and UI
Browse files Browse the repository at this point in the history
  • Loading branch information
kasnder committed Jan 5, 2020
1 parent 929d37e commit 2464df4
Show file tree
Hide file tree
Showing 32 changed files with 501 additions and 1,057 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ The app can be [downloaded here](https://github.com/OxfordHCC/tracker-control-an
TrackerControl provides
- *real-time monitoring* of app tracking,
- *granular blocking* of app tracking,
- access to apps' *privacy policy websites without trackers* (which they often contain),
- *one-click data requests* as granted under EU Data Protection Legislation, and
- [ad-blocking](ADBLOCKING.md) using widely available host files.

Expand Down
6 changes: 2 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId = "net.kollnig.missioncontrol"
minSdkVersion 22
targetSdkVersion 29
versionCode 11
versionName "v1.0-alpha10"
versionCode 12
versionName "v1.0-alpha11"
archivesBaseName = "TrackerControl-$versionName" // name of apk

externalNativeBuild {
Expand Down Expand Up @@ -80,9 +80,7 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

implementation 'com.google.guava:guava:28.0-android'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'net.dankito.readability4j:readability4j:1.0.3'
implementation 'com.opencsv:opencsv:4.6'

// Crash reporting
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
android:allowBackup="false"
android:appCategory="productivity"
android:description="@string/app_description"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppThemeTeal"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/eu/faircode/netguard/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,9 @@ protected void onActivityResult(int requestCode, int resultCode, final Intent da
if (resultCode == RESULT_OK) {
ServiceSinkhole.start("prepared", this);

Toast on = Toast.makeText(ActivityMain.this, R.string.msg_on, Toast.LENGTH_LONG);
/*Toast on = Toast.makeText(ActivityMain.this, R.string.msg_on, Toast.LENGTH_LONG);
on.setGravity(Gravity.CENTER, 0, 0);
on.show();
on.show();*/

checkDoze();
} else if (resultCode == RESULT_CANCELED)
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/eu/faircode/netguard/ActivitySettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ protected void onPostExecute(Throwable ex) {
pref_reload_onconnectivity.setEnabled(false);
}

boolean can = Util.canFilter(this);
/*boolean can = Util.canFilter(this);
TwoStatePreference pref_log_app = (TwoStatePreference) screen.findPreference("log_app");
TwoStatePreference pref_filter = (TwoStatePreference) screen.findPreference("filter");
pref_log_app.setEnabled(can);
pref_filter.setEnabled(can);
if (!can) {
pref_log_app.setSummary(R.string.msg_unavailable);
pref_filter.setSummary(R.string.msg_unavailable);
}
}*/

// VPN parameters
screen.findPreference("vpn4").setTitle(getString(R.string.setting_vpn4, prefs.getString("vpn4", "10.1.10.1")));
Expand Down Expand Up @@ -420,6 +420,8 @@ public boolean onPreferenceClick(Preference preference) {
cat_network.removePreference(screen.findPreference("lockdown_wifi"));
cat_network.removePreference(screen.findPreference("lockdown_other"));
cat_network.removePreference(screen.findPreference("reload_onconnectivity"));

cat_advanced.removePreference(screen.findPreference("log_app"));
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/eu/faircode/netguard/AdapterRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,8 @@ public void onClick(View view) {
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick (View view) {
context.startActivity(settings);
if (holder.cbApply.isChecked())
context.startActivity(settings);
}
});

Expand Down
29 changes: 9 additions & 20 deletions app/src/main/java/net/kollnig/missioncontrol/DetailsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class DetailsActivity extends AppCompatActivity {
public static final int MY_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 1;
public static PlayStore.AppInfo app = null;
private final String TAG = DetailsActivity.class.getSimpleName();
Set<OnAppInfoLoadedListener> listeners = new HashSet<>();
static Set<OnAppInfoLoadedListener> listeners = new HashSet<>();
File exportDir = new File(
Environment.getExternalStorageDirectory(), "trackercontrol");
private Integer appUid;
Expand Down Expand Up @@ -134,19 +134,13 @@ protected void onCreate (Bundle savedInstanceState) {

// Load PlayStore Data if consent
if (contactGoogle) {
new Thread(new Runnable() {
@Override
public void run () {
app = PlayStore.getInfo(appPackageName);
DetailsActivity.this.runOnUiThread(new Runnable() {
@Override
public void run () {
for (OnAppInfoLoadedListener listener : listeners) {
listener.appInfoLoaded();
}
}
});
}
new Thread(() -> {
app = PlayStore.getInfo(appPackageName);
runOnUiThread(() -> {
for (OnAppInfoLoadedListener listener : listeners) {
listener.appInfoLoaded();
}
});
}).start();
}
}
Expand Down Expand Up @@ -302,12 +296,7 @@ protected void onPostExecute (final Boolean success) {
// Export successul, ask user to further share file!
View v = findViewById(R.id.view_pager);
Snackbar s = Snackbar.make(v, R.string.exported, Snackbar.LENGTH_LONG);
s.setAction(R.string.share_csv, new View.OnClickListener() {
@Override
public void onClick (View v1) {
shareExport();
}
});
s.setAction(R.string.share_csv, v1 -> shareExport());
s.setActionTextColor(getResources().getColor(R.color.colorPrimary));
s.show();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
import android.content.Context;

import net.kollnig.missioncontrol.details.ActionsFragment;
import net.kollnig.missioncontrol.details.InfoFragment;
import net.kollnig.missioncontrol.details.PolicyFragment;
import net.kollnig.missioncontrol.details.TransmissionsFragment;
import net.kollnig.missioncontrol.details.TrackersFragment;

import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
Expand All @@ -38,43 +36,38 @@
public class DetailsPagesAdapter extends FragmentPagerAdapter {
@StringRes
private static final int[] TAB_TITLES = new int[]{
R.string.tab_trackers,
//R.string.tab_transmissions,
R.string.tab_actions,
R.string.tab_transmissions,
R.string.tab_policy,
R.string.tab_info,
};
public static int tabTransmissionsPosition = 1;
public static int tabTrackersPosition = 0;

private final String TAG = DetailsPagesAdapter.class.getSimpleName();
private final Context mContext;

private Fragment fInfo;
private Fragment fTransmission;
private Fragment fTrackers;
private Fragment fActions;
private Fragment fPolicy;
//private Fragment fTransmissions;

public DetailsPagesAdapter (final Context context, FragmentManager fm, String appId, String appName) {
super(fm);

mContext = context;

fInfo = InfoFragment.newInstance(appId);
fTransmission = TransmissionsFragment.newInstance(appId);
fPolicy = PolicyFragment.newInstance(appId);
fTrackers = TrackersFragment.newInstance(appId);
//fTransmissions = TransmissionsFragment.newInstance(appId);
fActions = ActionsFragment.newInstance(appId, appName);
}

@Override
public Fragment getItem (int position) {
switch (position) {
case 0:
return fActions;
return fTrackers;
/*case 1:
return fTransmissions;*/
case 1:
return fTransmission;
case 2:
return fPolicy;
case 3:
return fInfo;
return fActions;
}
return null;
}
Expand Down
Loading

0 comments on commit 2464df4

Please sign in to comment.