@@ -198,11 +198,6 @@ def compile_dir(dfn):
198198
199199
200200def make_package (args ):
201- url_scheme = 'kivy'
202-
203- # Figure out versions of the private and public data.
204- private_version = str (time .time ())
205-
206201 # # Update the project to a recent version.
207202 # try:
208203 # subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t',
@@ -253,6 +248,14 @@ def make_package(args):
253248 shutil .copy (args .presplash or default_presplash ,
254249 'res/drawable/presplash.jpg' )
255250
251+ # If extra Java jars were requested, copy them into the libs directory
252+ if args .add_jar :
253+ for jarname in args .add_jar :
254+ if not os .path .exists (jarname ):
255+ print ('Requested jar does not exist: {}' .format (jarname ))
256+ sys .exit (- 1 )
257+ shutil .copy (jarname , 'libs' )
258+
256259 versioned_name = (args .name .replace (' ' , '' ).replace ('\' ' , '' ) +
257260 '-' + args .version )
258261
@@ -263,6 +266,10 @@ def make_package(args):
263266 version_code += int (i )
264267 args .numeric_version = str (version_code )
265268
269+ if args .intent_filters :
270+ with open (args .intent_filters ) as fd :
271+ args .intent_filters = fd .read ()
272+
266273 render (
267274 'AndroidManifest.tmpl.xml' ,
268275 'AndroidManifest.xml' ,
@@ -345,6 +352,16 @@ def parse_args(args=None):
345352 default = join (curdir , 'whitelist.txt' ),
346353 help = ('Use a whitelist file to prevent blacklisting of '
347354 'file in the final APK' ))
355+ ap .add_argument ('--add-jar' , dest = 'add_jar' , action = 'append' ,
356+ help = ('Add a Java .jar to the libs, so you can access its '
357+ 'classes with pyjnius. You can specify this '
358+ 'argument more than once to include multiple jars' ))
359+ ap .add_argument ('--intent-filters' , dest = 'intent_filters' ,
360+ help = ('Add intent-filters xml rules to the '
361+ 'AndroidManifest.xml file. The argument is a '
362+ 'filename containing xml. The filename should be '
363+ 'located relative to the python-for-android '
364+ 'directory' ))
348365
349366 if args is None :
350367 args = sys .argv [1 :]
0 commit comments