3958 Commits

Author SHA1 Message Date
Danial Behzadi
495686504a change android.mk v0.102-alpha1-belos 2016-11-15 09:42:28 +00:00
Amir Hossein Goodarzi (Numb)
21fd5539a5 remove share and fix email in about 2016-11-01 15:27:40 +03:30
numb95
a2456d7fc5 fix repo URL in about 2016-10-27 12:50:30 +03:30
numb95
5fd791dc67 Merge branch 'master' of gitlab.com:belos/Belmarket 2016-10-27 12:37:55 +03:30
numb95
97205f172c change fdroid.org to belmaket.ir 2016-10-27 12:37:23 +03:30
numb95
9284fba673 change f-droid.org to belmarket.ir 2016-10-27 12:36:41 +03:30
Amir Hossein Goodarzi (Numb)
7411f2b387 Update .gitlab-ci.yml 2016-10-25 15:14:12 +00:00
Amir Hossein Goodarzi (Numb)
a27e0591fb Update .gitlab-ci.yml 2016-10-25 14:30:33 +00:00
Amir Hossein Goodarzi (Numb)
ee4c927700 Update .gitlab-ci.yml 2016-10-25 13:53:56 +00:00
numb95
201664d871 add english and persian as languages 2016-10-25 16:55:24 +03:30
numb95
e5ae455cdf fix colors 2016-10-25 16:06:56 +03:30
numb95
8b2c0fb737 fix style and edit fdroid.fdroid.org to org.belmarket.shop 2016-10-25 15:34:14 +03:30
Danial Behzadi
2bd7b0d73e before rebase 2016-10-25 11:57:20 +03:30
Amir Hossein Goodarzi (Numb)
70b12acbc0 color and name editing 2016-10-25 11:56:36 +03:30
Amir Hossein Goodarzi (Numb)
2aa004eba9 fix names and color 2016-10-25 11:55:15 +03:30
Amir Hossein Goodarzi (Numb)
c1009e0d66 color and name editing 2016-10-25 11:55:15 +03:30
Amir Hossein Goodarzi (Numb)
e15edc8226 fix names and color 2016-10-25 11:55:15 +03:30
F-Droid Translatebot
55ca6129e8 Pull translation updates from Weblate
Translators:

Allan Nordhøy     Norwegian Bokmål
Enol P            Asturian
Ivan Krušlin      Croatian
Raphaël Barman    French
riotism           Chinese (Hong Kong)
2016-10-25 11:54:41 +03:30
Peter Serwylo
0a2cd98bdd Added explicit test for null permissions.
This wouldn'tve actually found the problem in the previous commit,
due to the null happening before checking permissions while logging perms.
However, still seems like a nice test to have so that the method itself
handles nulls correctly.
2016-10-25 11:54:41 +03:30
Peter Serwylo
6d89fca664 Guard against null, and improve logging in ApkVerifier. 2016-10-25 11:54:41 +03:30
Peter Serwylo
3b9db81b89 Added test for querying apps based on category
The previous category tests only checked that certain categories
would indeed find their way into the database if certain app metadata
is saved. It didn't check the other direction, using these categories
in queries.
2016-10-25 11:54:41 +03:30
Peter Serwylo
f0dc0e0fd4 Migrating category tests to their own class in preperation for giving them their own DB table 2016-10-25 11:54:41 +03:30
Peter Serwylo
9cc81efdc8 Guard against getRunningAppProcesses() returning null 2016-10-25 11:54:41 +03:30
Peter Serwylo
39b1b00ce0 Extract code to check for ACRA process into method
Makes it easier to document the code and simplifies FDroidApp#onCreate().
2016-10-25 11:54:41 +03:30
F-Droid Translatebot
ee662085a7 Pull translation updates from Weblate
Translators:

Alessandro “Acn0w” Cecchin    Italian
ezjerry liao                  Traditional Chinese
zmni                          Indonesian
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
ba9896f2f4 support extended 'uses-permissions' tags in APKs
<uses-permissions/> tags can have min and max SDK to take effect.  This is
not supported currently, and it necessary especially with the privileged
installer so it can properly represent the permissions that an APK is
requesting.

For example:
<uses-permission
  android:name="android.permission.MANAGE_ACCOUNTS"
  android:maxSdkVersion="22" />
<uses-permission-sdk-23
  android:name="android.permission.CAMERA" />
<uses-permission-sdk-23
  android:name="android.permission.CALL_PHONE"
  android:maxSdkVersion="23" />
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
2ff49c887e move shareable test classes into new separate section: testShared
This allows some of the mock classes to be shared across Robolectric and
emulator tests.
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
6aeddcdb59 rename Apk.permissions to requestedPermissions like PackageInfo
android.content.pm.PackageInfo is the Android class for representing data
about an APK/package.  Since Apk.permission is the same thing, we should
use the same name.
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
5a1a33a9a6 fix lint UnsafeProtectedBroadcastReceiver
Android won't protect us from other apps sending other Intents to these
receivers, so at least check that the action string matches what its
looking for.  This is based on a lint recommendation.
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
be3b7e528e fix "Repeated word "en" in message: possible typo" 2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
8a789f93d3 bump to errors: AppCompatMethod, NestedScrolling, StringFormatCount
These are things that we definitely want to be checking, and making them
lint errors rather than warnings means the CI build will fail.
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
0a56609ce6 fix lint StringFormatCount
app/src/main/res/values-nb/strings.xml:344:
  Conflicting number of arguments here
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
fd32b9c6de use apply() with all SharedPreferences
if the code does not check the result of commit() it should use apply()
since that runs in the background.
2016-10-25 11:54:41 +03:30
Peter Serwylo
f800d973b1 Only drop fdroid_installedApp if it exists 2016-10-25 11:54:41 +03:30
Peter Serwylo
6ef0106665 Fix migration for DB version 50.
The migration resulted in a query being run which was broken. The query
was broken because it was dynamically generated by Java code. This Java
code resulted in a valid migration when until very recently when the
query was refactored to deal with a new DB structure. Now the query is
no longer suitable to be run against a DB_VERSION 49 database.

To resolve this, the migration now hard codes the query to a string
which is executable when the DB_VERSION is 49.
2016-10-25 11:54:41 +03:30
Peter Serwylo
8432ba047c Added a test which runs all DB migrations since DB version 42.
It was a little arbitrary to choose this date. However it was when the database
looked quite close to what it looks like now and it is from well over two years
ago. Going into the future, this test may as well always start out at 42 forever
more to ensure that database migrations from that point continue to work for
all future database migrations.
2016-10-25 11:54:41 +03:30
Daniel Martí
37d02f89e3 Bump to 0.102-alpha1 2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
709bbe3461 fix crash loop when upgrading from v0.101
For upgrades from DB version earlier than 63, the whole table is recreated
by resetTransient() in migrateToPackageTable() so the upgrade method for
the OBB tables only needs to run when the database is at exactly version 63

This was mistakenly added to cd9582c9902dd4ac9218acfd69872f3eebcd3d93 when
it was rebased on !375.
2016-10-25 11:54:41 +03:30
Daniel Martí
f648e9773f Start off 0.102 changelog 2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
1f879df992 improved Apk.toString() for easier debugging 2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
0a00e458d1 remove unused ContentValuesCursor class
This was replaced entirely by making Apk implement Parcelable
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
d98cbf66c3 make sure uninstall process has an Apk instance
If a user clicks install, then uninstall on AppDetails, then there was not
yet a chance to refresh the App instance, and therefore app.installedApk
will still be null.  This is really just a workaround for now, because
AppDetails needs a full refactoring.
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
3fb9e830a5 InstallManagerService.cancel() to handle all cancellation
Now that there are also OBB downloads, there needs to be a central cancel
method provided by InstallManagerService.
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
7e8a633460 auto-download and -install any associated OBB files
This implements the APK Extension Files spec for finding, downloading, and
installing OBB files that are extension packs for APKs.

This needs WRITE_EXTERNAL_STORAGE since "installing" OBB files is just
copying them to a specific path on the external storage.

https://developer.android.com/google/play/expansion-files.html
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
6d5ff6f9e4 refactor into reusable static method for checking file hashes
This takes the APK file hash checker and turns it into a generic static
utility method for checking that a given file matches a given hash.  This
will be needed as F-Droid handles other file types, like OBB and media.
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
42e419a001 allow apps to request OBB download URLs from F-Droid
By sending an Intent to F-Droid, it will reply with the full download URL
to the OBB file, if one exists for the currently installed version of the
requesting app.
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
d89d94f4b4 use ApkTable column names when parsing XML
This makes it easier to track the relationship between the index XML and
the database tables where that data is ultimately stored and used. There
are a few mismatches between the XML tag and database column names, so
those are just marked with a comment.

This makes it much easier to find all the spots in the code that need
changing when adding new columns/data to the APK table, like the OBB stuff.
In Android Studio, just Ctrl-Click on any table constant definition, and
then it lists all the places its used.  Any new data will need to be added
in all of those locations.
2016-10-25 11:54:41 +03:30
Hans-Christoph Steiner
4d2d6da7cf support "APK Extension" files aka .obb for large apps and games
OBB files are used in apps that need more than 100 megs to work well.  This
is apps like MAPS.ME or games that put map info, media, etc. into the OBB
file.  Also, OBB files provide a mechanism to deliver large data blobs that
do not need to be part of the APK.  For example, a game's assets do not
need to change often, so they can be shipped as an OBB, then APK updates do
not need to include all those assets for each update.

https://developer.android.com/google/play/expansion-files.html
2016-10-25 11:54:41 +03:30
Peter Serwylo
9c6d1c3dc7 Appease checkstyle + pmd 2016-10-25 11:54:41 +03:30
Peter Serwylo
37110a9273 Clarify that sometimes we don't know which repos apk we are asking for.
Many times in the past, we would ask for an apk based on its package name
and its version code. However multiple repositories provide apks with the
same package name and version code, and such queries would (seemingly)
nondeterministically choose one of these matching apks. This clarifies the
wording in the code around when we explicitly ask for a given apk, and
when we kind of guess which one we want.

Most the time we have an `App` handy, which has a specific repo associated
with it. This allows us to be more specific about requesting `Apk`s.

The times we are kind of guessing is when we rely on the "suggested version
code" of an apk by clicking the misc "Install" or "Upgrade" button in
app details. In the future, we'll need to clear this up so that a more
specific apk is chosen when touching these buttons.
2016-10-25 11:54:41 +03:30