• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2018 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package java
16
17import (
18	"android/soong/android"
19	"fmt"
20	"path/filepath"
21	"strings"
22
23	"github.com/google/blueprint"
24	"github.com/google/blueprint/proptools"
25)
26
27type AndroidLibraryDependency interface {
28	Dependency
29	ExportPackage() android.Path
30	ExportedProguardFlagFiles() android.Paths
31	ExportedRRODirs() []rroDir
32	ExportedStaticPackages() android.Paths
33	ExportedManifest() android.Path
34}
35
36func init() {
37	android.RegisterModuleType("android_library_import", AARImportFactory)
38	android.RegisterModuleType("android_library", AndroidLibraryFactory)
39}
40
41//
42// AAR (android library)
43//
44
45type androidLibraryProperties struct {
46	BuildAAR bool `blueprint:"mutated"`
47}
48
49type aaptProperties struct {
50	// flags passed to aapt when creating the apk
51	Aaptflags []string
52
53	// include all resource configurations, not just the product-configured
54	// ones.
55	Aapt_include_all_resources *bool
56
57	// list of directories relative to the Blueprints file containing assets.
58	// Defaults to ["assets"] if a directory called assets exists.  Set to []
59	// to disable the default.
60	Asset_dirs []string
61
62	// list of directories relative to the Blueprints file containing
63	// Android resources.  Defaults to ["res"] if a directory called res exists.
64	// Set to [] to disable the default.
65	Resource_dirs []string
66
67	// list of zip files containing Android resources.
68	Resource_zips []string `android:"path"`
69
70	// path to AndroidManifest.xml.  If unset, defaults to "AndroidManifest.xml".
71	Manifest *string `android:"path"`
72}
73
74type aapt struct {
75	aaptSrcJar            android.Path
76	exportPackage         android.Path
77	manifestPath          android.Path
78	proguardOptionsFile   android.Path
79	rroDirs               []rroDir
80	rTxt                  android.Path
81	extraAaptPackagesFile android.Path
82	noticeFile            android.OptionalPath
83	isLibrary             bool
84	uncompressedJNI       bool
85	useEmbeddedDex        bool
86	usesNonSdkApis        bool
87
88	splitNames []string
89	splits     []split
90
91	aaptProperties aaptProperties
92}
93
94type split struct {
95	name   string
96	suffix string
97	path   android.Path
98}
99
100func (a *aapt) ExportPackage() android.Path {
101	return a.exportPackage
102}
103
104func (a *aapt) ExportedRRODirs() []rroDir {
105	return a.rroDirs
106}
107
108func (a *aapt) ExportedManifest() android.Path {
109	return a.manifestPath
110}
111
112func (a *aapt) aapt2Flags(ctx android.ModuleContext, sdkContext sdkContext, manifestPath android.Path) (flags []string,
113	deps android.Paths, resDirs, overlayDirs []globbedResourceDir, rroDirs []rroDir, resZips android.Paths) {
114
115	hasVersionCode := false
116	hasVersionName := false
117	for _, f := range a.aaptProperties.Aaptflags {
118		if strings.HasPrefix(f, "--version-code") {
119			hasVersionCode = true
120		} else if strings.HasPrefix(f, "--version-name") {
121			hasVersionName = true
122		}
123	}
124
125	var linkFlags []string
126
127	// Flags specified in Android.bp
128	linkFlags = append(linkFlags, a.aaptProperties.Aaptflags...)
129
130	linkFlags = append(linkFlags, "--no-static-lib-packages")
131
132	// Find implicit or explicit asset and resource dirs
133	assetDirs := android.PathsWithOptionalDefaultForModuleSrc(ctx, a.aaptProperties.Asset_dirs, "assets")
134	resourceDirs := android.PathsWithOptionalDefaultForModuleSrc(ctx, a.aaptProperties.Resource_dirs, "res")
135	resourceZips := android.PathsForModuleSrc(ctx, a.aaptProperties.Resource_zips)
136
137	var linkDeps android.Paths
138
139	// Glob directories into lists of paths
140	for _, dir := range resourceDirs {
141		resDirs = append(resDirs, globbedResourceDir{
142			dir:   dir,
143			files: androidResourceGlob(ctx, dir),
144		})
145		resOverlayDirs, resRRODirs := overlayResourceGlob(ctx, dir)
146		overlayDirs = append(overlayDirs, resOverlayDirs...)
147		rroDirs = append(rroDirs, resRRODirs...)
148	}
149
150	var assetFiles android.Paths
151	for _, dir := range assetDirs {
152		assetFiles = append(assetFiles, androidResourceGlob(ctx, dir)...)
153	}
154
155	assetDirStrings := assetDirs.Strings()
156	if a.noticeFile.Valid() {
157		assetDirStrings = append(assetDirStrings, filepath.Dir(a.noticeFile.Path().String()))
158		assetFiles = append(assetFiles, a.noticeFile.Path())
159	}
160
161	linkFlags = append(linkFlags, "--manifest "+manifestPath.String())
162	linkDeps = append(linkDeps, manifestPath)
163
164	linkFlags = append(linkFlags, android.JoinWithPrefix(assetDirStrings, "-A "))
165	linkDeps = append(linkDeps, assetFiles...)
166
167	// SDK version flags
168	minSdkVersion := sdkVersionOrDefault(ctx, sdkContext.minSdkVersion())
169
170	linkFlags = append(linkFlags, "--min-sdk-version "+minSdkVersion)
171	linkFlags = append(linkFlags, "--target-sdk-version "+minSdkVersion)
172
173	// Version code
174	if !hasVersionCode {
175		linkFlags = append(linkFlags, "--version-code", ctx.Config().PlatformSdkVersion())
176	}
177
178	if !hasVersionName {
179		var versionName string
180		if ctx.ModuleName() == "framework-res" {
181			// Some builds set AppsDefaultVersionName() to include the build number ("O-123456").  aapt2 copies the
182			// version name of framework-res into app manifests as compileSdkVersionCodename, which confuses things
183			// if it contains the build number.  Use the PlatformVersionName instead.
184			versionName = ctx.Config().PlatformVersionName()
185		} else {
186			versionName = ctx.Config().AppsDefaultVersionName()
187		}
188		versionName = proptools.NinjaEscape(versionName)
189		linkFlags = append(linkFlags, "--version-name ", versionName)
190	}
191
192	return linkFlags, linkDeps, resDirs, overlayDirs, rroDirs, resourceZips
193}
194
195func (a *aapt) deps(ctx android.BottomUpMutatorContext, sdkContext sdkContext) {
196	sdkDep := decodeSdkDep(ctx, sdkContext)
197	if sdkDep.frameworkResModule != "" {
198		ctx.AddVariationDependencies(nil, frameworkResTag, sdkDep.frameworkResModule)
199	}
200}
201
202func (a *aapt) buildActions(ctx android.ModuleContext, sdkContext sdkContext, extraLinkFlags ...string) {
203	transitiveStaticLibs, staticLibManifests, staticRRODirs, libDeps, libFlags := aaptLibs(ctx, sdkContext)
204
205	// App manifest file
206	manifestFile := proptools.StringDefault(a.aaptProperties.Manifest, "AndroidManifest.xml")
207	manifestSrcPath := android.PathForModuleSrc(ctx, manifestFile)
208
209	manifestPath := manifestMerger(ctx, manifestSrcPath, sdkContext, staticLibManifests, a.isLibrary,
210		a.uncompressedJNI, a.useEmbeddedDex, a.usesNonSdkApis)
211
212	linkFlags, linkDeps, resDirs, overlayDirs, rroDirs, resZips := a.aapt2Flags(ctx, sdkContext, manifestPath)
213
214	rroDirs = append(rroDirs, staticRRODirs...)
215	linkFlags = append(linkFlags, libFlags...)
216	linkDeps = append(linkDeps, libDeps...)
217	linkFlags = append(linkFlags, extraLinkFlags...)
218	if a.isLibrary {
219		linkFlags = append(linkFlags, "--static-lib")
220	}
221
222	packageRes := android.PathForModuleOut(ctx, "package-res.apk")
223	srcJar := android.PathForModuleGen(ctx, "R.jar")
224	proguardOptionsFile := android.PathForModuleGen(ctx, "proguard.options")
225	rTxt := android.PathForModuleOut(ctx, "R.txt")
226	// This file isn't used by Soong, but is generated for exporting
227	extraPackages := android.PathForModuleOut(ctx, "extra_packages")
228
229	var compiledResDirs []android.Paths
230	for _, dir := range resDirs {
231		compiledResDirs = append(compiledResDirs, aapt2Compile(ctx, dir.dir, dir.files).Paths())
232	}
233
234	for i, zip := range resZips {
235		flata := android.PathForModuleOut(ctx, fmt.Sprintf("reszip.%d.flata", i))
236		aapt2CompileZip(ctx, flata, zip)
237		compiledResDirs = append(compiledResDirs, android.Paths{flata})
238	}
239
240	var compiledRes, compiledOverlay android.Paths
241
242	compiledOverlay = append(compiledOverlay, transitiveStaticLibs...)
243
244	if len(transitiveStaticLibs) > 0 {
245		// If we are using static android libraries, every source file becomes an overlay.
246		// This is to emulate old AAPT behavior which simulated library support.
247		for _, compiledResDir := range compiledResDirs {
248			compiledOverlay = append(compiledOverlay, compiledResDir...)
249		}
250	} else if a.isLibrary {
251		// Otherwise, for a static library we treat all the resources equally with no overlay.
252		for _, compiledResDir := range compiledResDirs {
253			compiledRes = append(compiledRes, compiledResDir...)
254		}
255	} else if len(compiledResDirs) > 0 {
256		// Without static libraries, the first directory is our directory, which can then be
257		// overlaid by the rest.
258		compiledRes = append(compiledRes, compiledResDirs[0]...)
259		for _, compiledResDir := range compiledResDirs[1:] {
260			compiledOverlay = append(compiledOverlay, compiledResDir...)
261		}
262	}
263
264	for _, dir := range overlayDirs {
265		compiledOverlay = append(compiledOverlay, aapt2Compile(ctx, dir.dir, dir.files).Paths()...)
266	}
267
268	var splitPackages android.WritablePaths
269	var splits []split
270
271	for _, s := range a.splitNames {
272		suffix := strings.Replace(s, ",", "_", -1)
273		path := android.PathForModuleOut(ctx, "package_"+suffix+".apk")
274		linkFlags = append(linkFlags, "--split", path.String()+":"+s)
275		splitPackages = append(splitPackages, path)
276		splits = append(splits, split{
277			name:   s,
278			suffix: suffix,
279			path:   path,
280		})
281	}
282
283	aapt2Link(ctx, packageRes, srcJar, proguardOptionsFile, rTxt, extraPackages,
284		linkFlags, linkDeps, compiledRes, compiledOverlay, splitPackages)
285
286	a.aaptSrcJar = srcJar
287	a.exportPackage = packageRes
288	a.manifestPath = manifestPath
289	a.proguardOptionsFile = proguardOptionsFile
290	a.rroDirs = rroDirs
291	a.extraAaptPackagesFile = extraPackages
292	a.rTxt = rTxt
293	a.splits = splits
294}
295
296// aaptLibs collects libraries from dependencies and sdk_version and converts them into paths
297func aaptLibs(ctx android.ModuleContext, sdkContext sdkContext) (transitiveStaticLibs, staticLibManifests android.Paths,
298	staticRRODirs []rroDir, deps android.Paths, flags []string) {
299
300	var sharedLibs android.Paths
301
302	sdkDep := decodeSdkDep(ctx, sdkContext)
303	if sdkDep.useFiles {
304		sharedLibs = append(sharedLibs, sdkDep.jars...)
305	}
306
307	ctx.VisitDirectDeps(func(module android.Module) {
308		var exportPackage android.Path
309		aarDep, _ := module.(AndroidLibraryDependency)
310		if aarDep != nil {
311			exportPackage = aarDep.ExportPackage()
312		}
313
314		switch ctx.OtherModuleDependencyTag(module) {
315		case instrumentationForTag:
316			// Nothing, instrumentationForTag is treated as libTag for javac but not for aapt2.
317		case libTag, frameworkResTag:
318			if exportPackage != nil {
319				sharedLibs = append(sharedLibs, exportPackage)
320			}
321		case staticLibTag:
322			if exportPackage != nil {
323				transitiveStaticLibs = append(transitiveStaticLibs, aarDep.ExportedStaticPackages()...)
324				transitiveStaticLibs = append(transitiveStaticLibs, exportPackage)
325				staticLibManifests = append(staticLibManifests, aarDep.ExportedManifest())
326
327			outer:
328				for _, d := range aarDep.ExportedRRODirs() {
329					for _, e := range staticRRODirs {
330						if d.path == e.path {
331							continue outer
332						}
333					}
334					staticRRODirs = append(staticRRODirs, d)
335				}
336			}
337		}
338	})
339
340	deps = append(deps, sharedLibs...)
341	deps = append(deps, transitiveStaticLibs...)
342
343	if len(transitiveStaticLibs) > 0 {
344		flags = append(flags, "--auto-add-overlay")
345	}
346
347	for _, sharedLib := range sharedLibs {
348		flags = append(flags, "-I "+sharedLib.String())
349	}
350
351	transitiveStaticLibs = android.FirstUniquePaths(transitiveStaticLibs)
352
353	return transitiveStaticLibs, staticLibManifests, staticRRODirs, deps, flags
354}
355
356type AndroidLibrary struct {
357	Library
358	aapt
359
360	androidLibraryProperties androidLibraryProperties
361
362	aarFile android.WritablePath
363
364	exportedProguardFlagFiles android.Paths
365	exportedStaticPackages    android.Paths
366}
367
368func (a *AndroidLibrary) ExportedProguardFlagFiles() android.Paths {
369	return a.exportedProguardFlagFiles
370}
371
372func (a *AndroidLibrary) ExportedStaticPackages() android.Paths {
373	return a.exportedStaticPackages
374}
375
376var _ AndroidLibraryDependency = (*AndroidLibrary)(nil)
377
378func (a *AndroidLibrary) DepsMutator(ctx android.BottomUpMutatorContext) {
379	a.Module.deps(ctx)
380	if !Bool(a.properties.No_framework_libs) && !Bool(a.properties.No_standard_libs) {
381		a.aapt.deps(ctx, sdkContext(a))
382	}
383}
384
385func (a *AndroidLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
386	a.aapt.isLibrary = true
387	a.aapt.buildActions(ctx, sdkContext(a))
388
389	ctx.CheckbuildFile(a.proguardOptionsFile)
390	ctx.CheckbuildFile(a.exportPackage)
391	ctx.CheckbuildFile(a.aaptSrcJar)
392
393	// apps manifests are handled by aapt, don't let Module see them
394	a.properties.Manifest = nil
395
396	a.Module.extraProguardFlagFiles = append(a.Module.extraProguardFlagFiles,
397		a.proguardOptionsFile)
398
399	a.Module.compile(ctx, a.aaptSrcJar)
400
401	a.aarFile = android.PathForModuleOut(ctx, ctx.ModuleName()+".aar")
402	var res android.Paths
403	if a.androidLibraryProperties.BuildAAR {
404		BuildAAR(ctx, a.aarFile, a.outputFile, a.manifestPath, a.rTxt, res)
405		ctx.CheckbuildFile(a.aarFile)
406	}
407
408	ctx.VisitDirectDeps(func(m android.Module) {
409		if lib, ok := m.(AndroidLibraryDependency); ok && ctx.OtherModuleDependencyTag(m) == staticLibTag {
410			a.exportedProguardFlagFiles = append(a.exportedProguardFlagFiles, lib.ExportedProguardFlagFiles()...)
411			a.exportedStaticPackages = append(a.exportedStaticPackages, lib.ExportPackage())
412			a.exportedStaticPackages = append(a.exportedStaticPackages, lib.ExportedStaticPackages()...)
413		}
414	})
415
416	a.exportedProguardFlagFiles = android.FirstUniquePaths(a.exportedProguardFlagFiles)
417	a.exportedStaticPackages = android.FirstUniquePaths(a.exportedStaticPackages)
418}
419
420// android_library builds and links sources into a `.jar` file for the device along with Android resources.
421//
422// An android_library has a single variant that produces a `.jar` file containing `.class` files that were
423// compiled against the device bootclasspath, along with a `package-res.apk` file containing  Android resources compiled
424// with aapt2.  This module is not suitable for installing on a device, but can be used as a `static_libs` dependency of
425// an android_app module.
426func AndroidLibraryFactory() android.Module {
427	module := &AndroidLibrary{}
428
429	module.AddProperties(
430		&module.Module.properties,
431		&module.Module.deviceProperties,
432		&module.Module.dexpreoptProperties,
433		&module.Module.protoProperties,
434		&module.aaptProperties,
435		&module.androidLibraryProperties)
436
437	module.androidLibraryProperties.BuildAAR = true
438
439	InitJavaModule(module, android.DeviceSupported)
440	return module
441}
442
443//
444// AAR (android library) prebuilts
445//
446
447type AARImportProperties struct {
448	Aars []string `android:"path"`
449
450	Sdk_version     *string
451	Min_sdk_version *string
452
453	Static_libs []string
454	Libs        []string
455
456	// if set to true, run Jetifier against .aar file. Defaults to false.
457	Jetifier *bool
458}
459
460type AARImport struct {
461	android.ModuleBase
462	android.DefaultableModuleBase
463	prebuilt android.Prebuilt
464
465	properties AARImportProperties
466
467	classpathFile         android.WritablePath
468	proguardFlags         android.WritablePath
469	exportPackage         android.WritablePath
470	extraAaptPackagesFile android.WritablePath
471	manifest              android.WritablePath
472
473	exportedStaticPackages android.Paths
474}
475
476func (a *AARImport) sdkVersion() string {
477	return String(a.properties.Sdk_version)
478}
479
480func (a *AARImport) minSdkVersion() string {
481	if a.properties.Min_sdk_version != nil {
482		return *a.properties.Min_sdk_version
483	}
484	return a.sdkVersion()
485}
486
487func (a *AARImport) targetSdkVersion() string {
488	return a.sdkVersion()
489}
490
491var _ AndroidLibraryDependency = (*AARImport)(nil)
492
493func (a *AARImport) ExportPackage() android.Path {
494	return a.exportPackage
495}
496
497func (a *AARImport) ExportedProguardFlagFiles() android.Paths {
498	return android.Paths{a.proguardFlags}
499}
500
501func (a *AARImport) ExportedRRODirs() []rroDir {
502	return nil
503}
504
505func (a *AARImport) ExportedStaticPackages() android.Paths {
506	return a.exportedStaticPackages
507}
508
509func (a *AARImport) ExportedManifest() android.Path {
510	return a.manifest
511}
512
513func (a *AARImport) Prebuilt() *android.Prebuilt {
514	return &a.prebuilt
515}
516
517func (a *AARImport) Name() string {
518	return a.prebuilt.Name(a.ModuleBase.Name())
519}
520
521func (a *AARImport) DepsMutator(ctx android.BottomUpMutatorContext) {
522	if !ctx.Config().UnbundledBuildUsePrebuiltSdks() {
523		sdkDep := decodeSdkDep(ctx, sdkContext(a))
524		if sdkDep.useModule && sdkDep.frameworkResModule != "" {
525			ctx.AddVariationDependencies(nil, frameworkResTag, sdkDep.frameworkResModule)
526		}
527	}
528
529	ctx.AddVariationDependencies(nil, libTag, a.properties.Libs...)
530	ctx.AddVariationDependencies(nil, staticLibTag, a.properties.Static_libs...)
531}
532
533// Unzip an AAR into its constituent files and directories.  Any files in Outputs that don't exist in the AAR will be
534// touched to create an empty file, and any directories in $expectedDirs will be created.
535var unzipAAR = pctx.AndroidStaticRule("unzipAAR",
536	blueprint.RuleParams{
537		Command: `rm -rf $outDir && mkdir -p $outDir $expectedDirs && ` +
538			`unzip -qo -d $outDir $in && touch $out`,
539	},
540	"expectedDirs", "outDir")
541
542func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
543	if len(a.properties.Aars) != 1 {
544		ctx.PropertyErrorf("aars", "exactly one aar is required")
545		return
546	}
547
548	aarName := ctx.ModuleName() + ".aar"
549	var aar android.Path
550	aar = android.PathForModuleSrc(ctx, a.properties.Aars[0])
551	if Bool(a.properties.Jetifier) {
552		inputFile := aar
553		aar = android.PathForModuleOut(ctx, "jetifier", aarName)
554		TransformJetifier(ctx, aar.(android.WritablePath), inputFile)
555	}
556
557	extractedAARDir := android.PathForModuleOut(ctx, "aar")
558	extractedResDir := extractedAARDir.Join(ctx, "res")
559	a.classpathFile = extractedAARDir.Join(ctx, "classes.jar")
560	a.proguardFlags = extractedAARDir.Join(ctx, "proguard.txt")
561	a.manifest = extractedAARDir.Join(ctx, "AndroidManifest.xml")
562
563	ctx.Build(pctx, android.BuildParams{
564		Rule:        unzipAAR,
565		Input:       aar,
566		Outputs:     android.WritablePaths{a.classpathFile, a.proguardFlags, a.manifest},
567		Description: "unzip AAR",
568		Args: map[string]string{
569			"expectedDirs": extractedResDir.String(),
570			"outDir":       extractedAARDir.String(),
571		},
572	})
573
574	compiledResDir := android.PathForModuleOut(ctx, "flat-res")
575	aaptCompileDeps := android.Paths{a.classpathFile}
576	aaptCompileDirs := android.Paths{extractedResDir}
577	flata := compiledResDir.Join(ctx, "gen_res.flata")
578	aapt2CompileDirs(ctx, flata, aaptCompileDirs, aaptCompileDeps)
579
580	a.exportPackage = android.PathForModuleOut(ctx, "package-res.apk")
581	srcJar := android.PathForModuleGen(ctx, "R.jar")
582	proguardOptionsFile := android.PathForModuleGen(ctx, "proguard.options")
583	rTxt := android.PathForModuleOut(ctx, "R.txt")
584	a.extraAaptPackagesFile = android.PathForModuleOut(ctx, "extra_packages")
585
586	var linkDeps android.Paths
587
588	linkFlags := []string{
589		"--static-lib",
590		"--no-static-lib-packages",
591		"--auto-add-overlay",
592	}
593
594	linkFlags = append(linkFlags, "--manifest "+a.manifest.String())
595	linkDeps = append(linkDeps, a.manifest)
596
597	transitiveStaticLibs, staticLibManifests, staticRRODirs, libDeps, libFlags := aaptLibs(ctx, sdkContext(a))
598
599	_ = staticLibManifests
600	_ = staticRRODirs
601
602	linkDeps = append(linkDeps, libDeps...)
603	linkFlags = append(linkFlags, libFlags...)
604
605	overlayRes := append(android.Paths{flata}, transitiveStaticLibs...)
606
607	aapt2Link(ctx, a.exportPackage, srcJar, proguardOptionsFile, rTxt, a.extraAaptPackagesFile,
608		linkFlags, linkDeps, nil, overlayRes, nil)
609}
610
611var _ Dependency = (*AARImport)(nil)
612
613func (a *AARImport) HeaderJars() android.Paths {
614	return android.Paths{a.classpathFile}
615}
616
617func (a *AARImport) ImplementationJars() android.Paths {
618	return android.Paths{a.classpathFile}
619}
620
621func (a *AARImport) ResourceJars() android.Paths {
622	return nil
623}
624
625func (a *AARImport) ImplementationAndResourcesJars() android.Paths {
626	return android.Paths{a.classpathFile}
627}
628
629func (a *AARImport) DexJar() android.Path {
630	return nil
631}
632
633func (a *AARImport) AidlIncludeDirs() android.Paths {
634	return nil
635}
636
637func (a *AARImport) ExportedSdkLibs() []string {
638	return nil
639}
640
641var _ android.PrebuiltInterface = (*Import)(nil)
642
643// android_library_import imports an `.aar` file into the build graph as if it was built with android_library.
644//
645// This module is not suitable for installing on a device, but can be used as a `static_libs` dependency of
646// an android_app module.
647func AARImportFactory() android.Module {
648	module := &AARImport{}
649
650	module.AddProperties(&module.properties)
651
652	android.InitPrebuiltModule(module, &module.properties.Aars)
653	InitJavaModule(module, android.DeviceSupported)
654	return module
655}
656