Permalink
Browse files

* Updated all the libraries and bumped TargetSDK to 26.

* Added Proxy support (#99). Searches / downloads not supported at the moment.
* Added APK-DL as a new search-engine (fixes #104)
* Added LeakCanary to debug builds (fixes #100).
* Removed The Guardian Project update source as it doesn't provide direct download links and their repository doesn't look up to date.
* Fixed F-Droid's download URL regexp which was broken due to a change in their website.

Signed-off-by: Ivan Kwiatkowski <justicerage@manalyzer.org>
  • Loading branch information...
JusticeRage committed Aug 27, 2017
1 parent f8d7396 commit edc8007201001acb12cc4eef73399f60420a8a37
View
@@ -23,8 +23,8 @@ android {
* download the build tools using the SDK Manager.
*/
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 26
buildToolsVersion "26.0.1"
/**
* The defaultConfig {} block encapsulates default settings and entries for all
@@ -47,7 +47,7 @@ android {
minSdkVersion 15
// Specifies the API level used to test the app.
targetSdkVersion 25
targetSdkVersion 26
// Defines the version number of your app.
versionCode 19
@@ -119,7 +119,7 @@ android {
}
}
def Properties props = new Properties()
Properties props = new Properties()
def propFile = new File('signing.properties')
if (propFile.canRead())
{
@@ -143,25 +143,34 @@ android {
}
}
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
/**
* The dependencies {} block in the module-level build configuration file
* only specifies dependencies required to build the module itself.
*/
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:preference-v7:25.1.0'
compile 'com.android.support:preference-v14:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:preference-v7:26.0.1'
compile 'com.android.support:preference-v14:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
compile 'de.greenrobot:eventbus:2.4.1'
compile 'com.github.traex.rippleeffect:library:1.3'
compile 'ch.acra:acra:4.9.1'
compile 'com.faendir:acra:4.10.0'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
// TODO: Add SugarORM as a dependency when it works.
// SugarORM dependencies:
compile 'com.google.guava:guava:19.0'
compile 'com.commonsware.cwac:wakeful:1.0.5'
compile 'com.google.guava:guava:20.0'
compile 'com.commonsware.cwac:wakeful:1.1.0'
}
@@ -34,17 +34,6 @@
},
"autoselect_if": ["applicable"]
},
{
"name": "Guardian Project",
"url": "https://guardianproject.info/fdroid/repo/index.xml",
"packages": {
"^info.guardianproject|^org.torproject.android$|^org.witness.(sscphase1|informacam.app)$": {
"version": "<application id=\"%1$s\">.*?<version>([^<]+?)</version>",
"download_regexp": "https://guardianproject.info/releases/"
}
},
"autoselect_if": ["O=Guardian Project", "O=guardianproject.info"]
},
{
"name": "I2P",
"url": "https://f-droid.i2p.io/repo/index.xml",
@@ -130,7 +119,7 @@
"packages": {
".*": {
"version": "<b>Version ([^<]+?)</b>",
"download_regexp": "<a href=\"([^\"]+?)\">download apk</a>"
"download_regexp": "<a href=\"([^\"]+?)\">Download APK</a>"
}
},
"autoselect_if": ["O=fdroid.org", "CN=Ciaran Gultnieks"]
@@ -18,6 +18,7 @@
package fr.kwiatkowski.apktrack;
import android.content.Context;
import com.squareup.leakcanary.LeakCanary;
import fr.kwiatkowski.apktrack.service.utils.KeyStoreFactory;
import org.acra.ACRA;
import org.acra.ReportingInteractionMode;
@@ -44,8 +45,16 @@
public class MainApplication extends com.orm.SugarApp
{
@Override
public void onCreate() {
public void onCreate()
{
super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return;
}
LeakCanary.install(this);
}
@Override
@@ -39,7 +39,9 @@ public void sendWakefulWork(Context ctxt) {
WakefulIntentService.sendWakefulWork(ctxt, ScheduledCheckService.class);
}
public long getMaxAge() {
return(AlarmManager.INTERVAL_DAY * 2);
@Override
// No alarms for 7 days: don't try to reschedule.
public long getMaxAge(Context context) {
return(AlarmManager.INTERVAL_DAY * 7);
}
}
@@ -40,6 +40,7 @@
import fr.kwiatkowski.apktrack.service.message.CreateToastMessage;
import fr.kwiatkowski.apktrack.service.message.ModelModifiedMessage;
import fr.kwiatkowski.apktrack.service.message.StickyUpdatedMessage;
import fr.kwiatkowski.apktrack.service.utils.ProxyHelper;
import fr.kwiatkowski.apktrack.service.utils.SSLHelper;
import fr.kwiatkowski.apktrack.ui.AppDisplayFragment;
import fr.kwiatkowski.apktrack.ui.SettingsFragment;
@@ -130,7 +131,8 @@ private GetResult get_page(UpdateSource source, InstalledApp app)
try
{
URL target = new URL(url);
HttpURLConnection huc = (HttpURLConnection) target.openConnection();
// Set the proxy.
HttpURLConnection huc = (HttpURLConnection) target.openConnection(ProxyHelper.get_proxy(this));
// Authenticate ApkTrack's servers against the bundled certificate.
if ("https".equals(target.getProtocol()) &&
@@ -582,6 +584,8 @@ private void _download_apk(InstalledApp app, String request_source)
app.get_display_name(),
app.get_latest_version()));
Log.v(MainActivity.TAG, "Downloading APK at url: " + uri.toString());
DownloadManager dm = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
DownloadManager.Request request = new DownloadManager.Request(uri);
@@ -30,13 +30,13 @@ public static Proxy get_proxy(Context ctx)
switch (type)
{
case "DIRECT":
return null; // No proxy.
return Proxy.NO_PROXY; // No proxy.
case "HTTP":
return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(hostname, Integer.parseInt(port)));
case "SOCKS":
return new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(hostname, Integer.parseInt(port)));
default:
return null;
return Proxy.NO_PROXY;
}
}
@@ -42,7 +42,7 @@
public final static String KEY_PREF_DOWNLOAD_APKS = "pref_automatic_downloads";
public final static String KEY_PREF_PROXY_TYPE = "pref_proxy_type";
public final static String KEY_PREF_PROXY_ADDRESS = "pref_proxy_address";
public final static String KEY_PREF_PROXY_TEST = "action_test_proxy";
public final static String KEY_PREF_PROXY_WARNING = "pref_proxy_warning";
public final static String ALPHA_SORT = "alpha";
public final static String STATUS_SORT = "status";
@@ -77,9 +77,8 @@ public void onCreatePreferences(Bundle bundle, String s)
final Preference privacy = findPreference("action_privacy_policy");
final Preference proxy_type = findPreference(KEY_PREF_PROXY_TYPE);
final Preference proxy_address = findPreference(KEY_PREF_PROXY_ADDRESS);
final Preference proxy_test = findPreference(KEY_PREF_PROXY_TEST);
if (reset == null || privacy == null || ignore_system == null || ignore_xposed == null ||
proxy_type == null || proxy_address == null || proxy_test == null)
proxy_type == null || proxy_address == null)
{
Log.v(MainActivity.TAG, "The preferences are malformed!");
return;
@@ -189,16 +188,6 @@ public boolean onPreferenceChange(Preference preference, Object newValue)
return true;
}
});
// Add a click listener to test proxy settings.
proxy_test.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference)
{
Toast.makeText(getContext(), "Not implemented yet!", Toast.LENGTH_SHORT).show();
return true;
}
});
}
// --------------------------------------------------------------------------------------------
@@ -243,8 +232,8 @@ private void render_proxy_type_preference(String new_type)
{
Preference proxy_type = findPreference(KEY_PREF_PROXY_TYPE);
Preference proxy_address = findPreference(KEY_PREF_PROXY_ADDRESS);
Preference proxy_test = findPreference(KEY_PREF_PROXY_TEST);
if (proxy_type == null || proxy_address == null || proxy_test == null)
Preference proxy_warning = findPreference(KEY_PREF_PROXY_WARNING);
if (proxy_type == null || proxy_address == null || proxy_warning == null)
{
Log.v(MainActivity.TAG, "The preferences are malformed!");
return;
@@ -260,17 +249,17 @@ private void render_proxy_type_preference(String new_type)
case "DIRECT":
proxy_type.setSummary(R.string.no_proxy_summary);
proxy_address.setEnabled(false);
proxy_test.setEnabled(false);
proxy_warning.setEnabled(false);
break;
case "HTTP":
proxy_type.setSummary(R.string.http_proxy_summary);
proxy_address.setEnabled(true);
proxy_test.setEnabled(true);
proxy_warning.setEnabled(true);
break;
case "SOCKS":
proxy_type.setSummary(R.string.socks_proxy_summary);
proxy_address.setEnabled(true);
proxy_test.setEnabled(true);
proxy_warning.setEnabled(true);
break;
}
}
@@ -69,7 +69,13 @@
<string name="ignore_system_apps_desc">Klicken, um Aktualisierungsüberprüfung für System Apps zu deaktivieren</string>
<string name="reset_ignored_apps">Ignorierte Apps zurücksetzen</string>
<string name="click_to_unignore">Klicken, um Ignorieren aller Apps rückgängig zu machen.</string>
<string name="proxy_type">Proxy Typ</string>
<string name="proxy_address">Proxy Adresse</string>
<string name="no_proxy">Kein</string>
<!-- Context: appears in a list with "SOCKS" and "HTTP". -->
<string name="no_proxy_summary">%s (ApkTrak greift direkt auf das Internet zu).</string>
<string name="http_proxy_summary">ApkTrak greift durch einen HTTP-Proxy auf das Internet zu.</string>
<string name="socks_proxy_summary">ApkTrak greift durch einen SOCKS-Proxy auf das Internet zu.</string>
<!-- Error messages -->
<string name="search_no_result">Keine Ergebnisse gefunden</string>
<string name="cant_handle_view">Keinen Browser gefunden. Bitte besuche http://apktrack.kwiatkowski.fr/privacy !</string>
@@ -76,8 +76,11 @@
<string name="no_proxy_summary">%s (ApkTrack se connecte à internet directement).</string>
<string name="http_proxy_summary">ApkTrack se connecte à Internet via un proxy HTTP.</string>
<string name="socks_proxy_summary">ApkTrack se connecte à internet via un proxy SOCKS.</string>
<string name="test_proxy">Tester les paramètres de proxy</string>
<string name="test_proxy_desc">Etablir une connexion vers les serveurs d\\\'ApkTrack pour vérifier la connectivité.</string>
<string name="proxy_warning_title">Avertissement</string>
<string name="proxy_warning_text">À l\'heure actuelle, le proxy n\'est utilisé que pour effectuer des vérifications de version.
Les téléchargements d\'APK son effectués par le gestionnaire de téléchargements du système ou le navigateur qui
peuvent ne pas être configurés pour passer via le proxy demandé.</string>
<string name="invalid_proxy_address">L\'adresse spécifiée est invalide !</string>
<!-- Error messages -->
<string name="search_no_result">Aucun résultat trouvé.</string>
<string name="cant_handle_view">Aucun navigateur n\'a été trouvé. Merci de visiter http://apktrack.kwiatkowski.fr/privacy manuellement!</string>
@@ -27,7 +27,7 @@
<string name="search">Cerca app o pacchetti</string>
<!-- Notification strings -->
<string name="app_updated_notification">%1$s aggiornata.</string>
<string name="apps_updated_notification">Nuovi aggiornamenti trovati</string>
<string name="apps_updated_notification">Nuovi aggiornamenti trovati.</string>
<string name="apps_updated_notification_summary">%1$s e %2$d altre applicazioni possono essere aggiornate.</string>
<string name="app_version_available">E\' disponibile la versione %1$s !</string>
<string name="app_can_be_updated">%1$s può essere aggiornata!</string>
@@ -49,7 +49,7 @@
<!-- Settings strings -->
<string name="general">Impostazioni Generali</string>
<string name="preferred_search_engine">Motore di ricerca preferito</string>
<string name="preferred_search_engine_desc">Seleziona quale motore di ricerca deve essere utilizzato per cercare gli APK\nSelezione corrente: %s</string>
<string name="preferred_search_engine_desc">Seleziona quale motore di ricerca deve essere utilizzato per cercare gli APK.\nSelezione corrente: %s</string>
<string name="enable_background_checks">Abilita il controllo in background</string>
<string name="enable_background_checks_desc_enabled">Il controllo per gli aggiornamenti verrà eseguito giornalmente.</string>
<string name="enable_background_checks_desc_disabled">Il controllo per gli aggiornamenti verrà eseguito solo su richiesta.</string>
@@ -69,7 +69,13 @@
<string name="ignore_system_apps_desc">Clicka per disabilitare il controllo degli aggiornamenti per le app di sistema.</string>
<string name="reset_ignored_apps">Resetta le app ignorate</string>
<string name="click_to_unignore">Clicca per smettere di ignorare tutte le app.</string>
<string name="proxy_type">Tipo di proxy</string>
<string name="proxy_address">Indirizzo del proxy</string>
<string name="no_proxy">Nessuno</string>
<!-- Context: appears in a list with "SOCKS" and "HTTP". -->
<string name="no_proxy_summary">%s (ApkTrack accede ad internet direttamente).</string>
<string name="http_proxy_summary">ApkTrack accede ad internet tramite un proxy HTTP.</string>
<string name="socks_proxy_summary">ApkTrack accede ad internet tramite un proxy SOCKS.</string>
<!-- Error messages -->
<string name="search_no_result">Nessun risultato trovato</string>
<string name="cant_handle_view">Nessun browser trovato. Per favore visita http://apktrack.kwiatkowski.fr/privacy manualmente!</string>
@@ -87,7 +93,7 @@ Tutto quello che devi fare è cliccare su OK.</string>
<string name="crash_dialog_ok_toast">Grazie!</string>
<string name="crash_user_email_label">Il tuo indirizzo mail se desideri essere contattato a proposito di questo errore (opzionale):</string>
<string name="pref_acra_alwaysaccept">Invia sempre i rapporti sui crash</string>
<string name="pref_acra_alwaysaccept_enabled">Nessun rapporto sui crash verrà inviato se venisse riscontrato un bug.</string>
<string name="pref_acra_alwaysaccept_enabled">I rapporti sui crash verranno inviati automaticamente.</string>
<string name="pref_acra_alwaysaccept_disabled">Verrai avvisato prima che qualunque dato venga inviato.</string>
<string name="pref_privacy_policy">Policy sulla privacy</string>
<string name="pref_privacy_policy_summary">Leggi la privacy policy di ApkTrack. TL;DR: i tuoi dati non verranno mai condivisi con qualcuno.</string>
@@ -76,8 +76,6 @@
<string name="no_proxy_summary">%s (ApkTrack は直接インターネットにアクセスします)。</string>
<string name="http_proxy_summary">ApkTrack は HTTP プロキシを経由してインターネットにアクセスします。</string>
<string name="socks_proxy_summary">ApkTrack は SOCKS プロキシを経由してインターネットにアクセスします。</string>
<string name="test_proxy">プロキシ設定のテスト</string>
<string name="test_proxy_desc">ApkTrack のサーバーへの接続を確認します。</string>
<!-- Error messages -->
<string name="search_no_result">結果が見つかりません</string>
<string name="cant_handle_view">ブラウザが見つかりませんでした。 手動で http://apktrack.kwiatkowski.fr/privacy にアクセスしてください!</string>
@@ -69,7 +69,13 @@
<string name="ignore_system_apps_desc">Kliknij aby wyłączyć wyszukiwanie aktualizacji dla aplikacji systemowych.</string>
<string name="reset_ignored_apps">Resetuj ignorowane aplikacje.</string>
<string name="click_to_unignore">Kliknij aby zresetować listę ignorowanych aplikacji.</string>
<string name="proxy_type">Rodzaj proxy</string>
<string name="proxy_address">Adres Proxy</string>
<string name="no_proxy">Żaden</string>
<!-- Context: appears in a list with "SOCKS" and "HTTP". -->
<string name="no_proxy_summary">%s (ApkTrack ma bezpośredni dostęp do internetu)</string>
<string name="http_proxy_summary">ApkTrack łączy się z internetem przez HTTP proxy.</string>
<string name="socks_proxy_summary">ApkTrack łączy się z internetem przez SOCKS proxy.</string>
<!-- Error messages -->
<string name="search_no_result">Brak wyników</string>
<string name="cant_handle_view">Nie znaleziono przeglądarki. Proszę ręcznie odwiedzić http://apktrack.kwiatkowski.fr/privacy.</string>
@@ -6,6 +6,7 @@
<item>Play Store</item>
<item>Evozi</item>
<item>APK Mirror</item>
<item>APK-DL</item>
</array>
<array name="search_engine_urls">
@@ -14,6 +15,7 @@
<item>https://play.google.com/store/apps/details?id=%3$s</item>
<item>http://apps.evozi.com/apk-downloader/?id=%3$s</item>
<item>http://www.apkmirror.com/?s=%1$s+%2$s&amp;post_type=apps_post</item>
<item>https://www.apk-dl.com/%3$s</item>
</array>
<array name="proxy_types">
@@ -79,10 +79,12 @@
<string name="no_proxy">None</string>
<!-- Context: appears in a list with "SOCKS" and "HTTP". -->
<string name="no_proxy_summary">%s (ApkTrack accesses the internet directly).</string>
<string name="invalid_proxy_address">The address specified is invalid!</string>
<string name="http_proxy_summary">ApkTrack accesses the internet through an HTTP proxy.</string>
<string name="socks_proxy_summary">ApkTrack accesses the internet through a SOCKS proxy.</string>
<string name="test_proxy">Test proxy settings</string>
<string name="test_proxy_desc">Initiates a connexion to ApkTrack\'s servers to check connectivity.</string>
<string name="proxy_warning_title">Warning</string>
<string name="proxy_warning_text">At the moment, the proxy can only be used for version checks.\nAPK downloads go
through the system\'s download manager or your browser, which may not be configured to use the proxy.</string>
<!-- Error messages -->
<string name="search_no_result">No results found</string>
<string name="cant_handle_view">No browser found. Please visit http://apktrack.kwiatkowski.fr/privacy manually!</string>
Oops, something went wrong.

0 comments on commit edc8007

Please sign in to comment.