Set the android:debuggable flag when building an APK in debug mode (#4523)
See https://github.com/flutter/flutter/issues/4438
This commit is contained in:
parent
b2938f40e3
commit
484c36f145
@ -104,7 +104,7 @@ class _ApkBuilder {
|
|||||||
runCheckedSync(packageArgs);
|
runCheckedSync(packageArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void package(File outputApk, File androidManifest, Directory assets, Directory artifacts, Directory resources) {
|
void package(File outputApk, File androidManifest, Directory assets, Directory artifacts, Directory resources, BuildMode buildMode) {
|
||||||
List<String> packageArgs = <String>[_aapt.path,
|
List<String> packageArgs = <String>[_aapt.path,
|
||||||
'package',
|
'package',
|
||||||
'-M', androidManifest.path,
|
'-M', androidManifest.path,
|
||||||
@ -112,6 +112,8 @@ class _ApkBuilder {
|
|||||||
'-I', _androidJar.path,
|
'-I', _androidJar.path,
|
||||||
'-F', outputApk.path,
|
'-F', outputApk.path,
|
||||||
];
|
];
|
||||||
|
if (buildMode == BuildMode.debug)
|
||||||
|
packageArgs.add('--debug-mode');
|
||||||
if (resources != null)
|
if (resources != null)
|
||||||
packageArgs.addAll(<String>['-S', resources.absolute.path]);
|
packageArgs.addAll(<String>['-S', resources.absolute.path]);
|
||||||
packageArgs.add(artifacts.path);
|
packageArgs.add(artifacts.path);
|
||||||
@ -333,7 +335,7 @@ int _buildApk(
|
|||||||
File unalignedApk = new File('${tempDir.path}/app.apk.unaligned');
|
File unalignedApk = new File('${tempDir.path}/app.apk.unaligned');
|
||||||
builder.package(
|
builder.package(
|
||||||
unalignedApk, components.manifest, assetBuilder.directory,
|
unalignedApk, components.manifest, assetBuilder.directory,
|
||||||
artifactBuilder.directory, components.resources
|
artifactBuilder.directory, components.resources, buildMode
|
||||||
);
|
);
|
||||||
|
|
||||||
int signResult = _signApk(builder, components, unalignedApk, keystore);
|
int signResult = _signApk(builder, components, unalignedApk, keystore);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user