Commit graph

44 commits

Author SHA1 Message Date
Daniel Martí
ab614ab442 Rework app into a class
This simplifies usage, goes from

	app['Foo']
to
	app.Foo

Also makes static analyzers able to detect invalid attributes as the set
is now limited in the class definition.

As a bonus, setting of the default field values is now done in the
constructor, not separately and manually.
2015-11-28 17:11:05 +01:00
Daniel Martí
d88914b466 Replace MD5withRSA with SHA1withRSA. Fixes #26.
Looks to me like we were using SHA1withRSA all along. Tested that everything
still works with a test repo.

As Hans reports, SHA1withRSA has been the default on Android tools for a long
time and it's supported on all Android versions.
2015-09-24 18:53:04 -07:00
Daniel Martí
576da1d048 all: deduplicate -v/-q setup 2015-09-11 23:42:50 -07:00
nero-tux
d23ecf1b35 replace deprecated optparse with argparse
following guidelines from:
https://docs.python.org/2/library/argparse.html#upgrading-optparse-code
except, still using option = parse.parse_args() instead of args = ...

- using the following script in folder fdroidserver:
	for i in *.py; do
		sed -i -e 's/optparse/argparse/' \
			-e 's/OptionParser/ArgumentParser/' \
			-e 's/OptionError/ArgumentError/' \
			-e 's/add_option/add_argument/' \
			-e 's/(options, args) = parser/options = parser/' \
			-e 's/options, args = parser/options = parser/' \
			-e 's/Usage: %prog/%(prog)s/' $i;
	done
- use ArgumentParser argument to replace (option, args) = parser.parse()
  call
- use parser.error(msg) instead of raise ArgumentException as suggested
  in https://docs.python.org/2/library/argparse.html#exiting-methods
- in fdroid catch ArgumentError instead of OptionError
2015-09-06 10:34:50 +02:00
Ciaran Gultnieks
d254fb81f2 Use jarsigner-based verification in publish 2015-01-31 15:59:00 +00:00
Ciaran Gultnieks
3e7046e23b Use pre-retrieved Binary when publishing
This allows this system to work when the machine that runs 'fdroid
publish' is offline.
2015-01-31 15:36:57 +00:00
Hans-Christoph Steiner
6bc6ba05b2 fix typo in error message 2015-01-12 10:46:04 +01:00
Hans-Christoph Steiner
a14f82c49e prevent fdroid publish from repeatedly downloading the developer binary
wget's --continue makes wget not overwrite the existing file, or create a
new version with a .1 extension.  Instead it tries to finish an incomplete
download, or does nothing if the download is complete and matching.
2015-01-12 10:46:03 +01:00
Hans-Christoph Steiner
fa1cc48d57 run all SDK tools commands using SdkToolsPopen 2014-12-14 13:25:20 +01:00
Ciaran Gultnieks
872e57c8da Set correct defaults for Binaries metadata field 2014-10-27 17:21:04 +00:00
Daniel Martí
3829896a8a Fix all pep8 warnings 2014-10-24 22:23:58 +02:00
Ciaran Gultnieks
8568805866 Support for publishing signed binaries from elsewhere
Done after verifying that they match ones built using a recipe.
Everything in the metadata should be the same as normal, with the
addition of the Binaries: directive to specify where (with pattern
substitution) to get the binaries from.

Publishing only takes place if there is a proper match. (Which seems
very unlikely to be the case unless the exact same toolchain is used, so
I would imagine that unless the person building and signing the incoming
binaries uses fdroidserver to build them, probably the exact same
buildserver id, they will not match. But at least we have the
functionality to support that.)
2014-10-24 21:04:15 +01:00
Daniel Martí
94c29f9c37 Map apps in memory from appid to appinfo
Instead of storing them in a list and doing linear searches by appinfo['id']
2014-08-16 12:46:02 +02:00
Daniel Martí
d73f2b9368 Also find zipalign at the start 2014-07-03 00:31:10 +02:00
Ciaran Gultnieks
751daf0cda Fix too long lines in publish 2014-05-12 23:01:53 +01:00
Hans-Christoph Steiner
0e00b36db5 fix PEP8 E124/E125/126/127/128 indentation issues
* E124 closing bracket does not match visual indentation
* E125 continuation line does not distinguish itself from next logical line
* E126 continuation line over-indented for hanging indent
* E127 continuation line over-indented for visual indent
* E128 continuation line under-indented for visual indent
2014-05-06 14:36:33 -04:00
Hans-Christoph Steiner
aa5f317c26 fix PEP8 "W391 blank line at end of file" 2014-05-06 11:45:03 -04:00
Hans-Christoph Steiner
3f4f7a544b fix PEP8 "E302 expected 2 blank lines, found 1" 2014-05-06 11:45:03 -04:00
Hans-Christoph Steiner
2f2618e06c fix PEP8 "E401 multiple imports on one line" 2014-05-06 11:45:03 -04:00
Hans-Christoph Steiner
7e17fafc14 fix PEP8 "E225 missing whitespace around operator" 2014-05-06 11:45:03 -04:00
Hans-Christoph Steiner
998011d535 fix PEP8 "E231 missing whitespace after ','" 2014-05-06 11:45:02 -04:00
Ciaran Gultnieks
7f822b01bf Validate publish-related file existence before proceeding 2014-04-04 15:37:18 +01:00
Ciaran Gultnieks
e4ad174399 Use keystore options correctly
Corrects error in 525759b235
2014-04-04 15:31:07 +01:00
Hans-Christoph Steiner
e53092cffa fix genkey key listing in fdroid init
FDroidPopen() does not have a way to send to stdin, so we will use the
password file for now.  In the long run, at least the keypass should always
be sent via stdin rather than via a file.  Ideally, storepass would be too,
but if they are different, then storepass is less important.
2014-04-01 18:04:36 -04:00
Hans-Christoph Steiner
525759b235 stop passing passphrases via args, instead use prepared files
Any process can read the process table, and can therefore see the entire
command line of any other process.  That means its a bad idea to ever put
passwords as part of a command line.  Python is executing keytool and
jarsigner command lines here, so now instead of putting the password on the
command line, a file is passed instead with suitable file permissions.
This should reduce the exposure a lot.  But still, sensitive passwords
should not be written to any text file.

This change requires OpenJDK-7 since the :file option to -storepass and
-keypass was only added in Java 7's keytool and jarsigner.
2014-03-31 21:02:42 -04:00
Ciaran Gultnieks
37dda9414c Add --quiet option, restricting output to warnings/errors 2014-02-22 09:46:24 +00:00
Daniel Martí
b752aff8ed Don't crash if an apk got built without source (e.g. with --no-tarball) 2014-02-17 16:51:42 +01:00
Daniel Martí
2f93ba9bd6 Merge branch 'master' into logging
Conflicts:
	fdroidserver/common.py
2014-01-28 14:14:59 +01:00
Daniel Martí
3687147997 Update my own copyright notices 2014-01-28 14:07:19 +01:00
Daniel Martí
1e3c2eee25 More logging switching 2014-01-27 21:49:29 +01:00
Daniel Martí
62c3663df3 Lots more FDroidPopen replacements 2014-01-27 21:48:22 +01:00
Daniel Martí
8f3a2d4355 Add some remaining help strings 2013-12-19 23:18:27 +01:00
Daniel Martí
61def95320 Adapt publish to new format, improve completion 2013-12-19 22:55:17 +01:00
Daniel Martí
fb38eb6b8c First metadata checks rewrite; New metadata.py module 2013-11-19 15:35:16 +01:00
Ciaran Gultnieks
5245640fdc Verify generated key alias uniqueness
Refuses to sign in the event of any problem - see comments for details
2013-11-07 08:11:05 +00:00
Daniel Martí
c3be06fb1d Start rewriting options and config as common.py globals 2013-11-01 13:55:38 +01:00
Ciaran Gultnieks
08287a1fa8 Handle repo config in a more sensible way 2013-10-31 15:37:39 +00:00
Daniel Martí
2c804ef88a Switch all shebangs to 'env python2' 2013-10-31 13:27:24 +01:00
Daniel Martí
89a4e17c3b Added myself to copyright notices 2013-09-28 21:06:33 +02:00
Daniel Martí
76d3b56ff5 Remove a bunch of unused imports 2013-08-22 16:42:57 +02:00
Ciaran Gultnieks
0febe11eb0 Make it easier to reference another app's signature 2013-04-05 17:02:02 +01:00
Daniel Martí
7bb4d5865b has_key() is uglier and slower than "if key in..." 2013-03-13 17:56:17 +01:00
AlexanderR
2044a53cec Changed signing code to support JDK7 2012-06-11 02:33:25 +11:00
Ciaran Gultnieks
f643b0498c Make the server tools an installable package (with distutils) - wip 2012-03-11 11:59:19 +00:00
Renamed from publish.py (Browse further)