Skip to content

Commit ea46b7e

Browse files
committed
fix(android): allow to sign debug builds (for example for system apps development)
1 parent 035107a commit ea46b7e

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

lib/services/android/gradle-build-args-service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ export class GradleBuildArgsService implements IGradleBuildArgsService {
8080

8181
if (buildData.release) {
8282
args.push(
83-
"-Prelease",
83+
"-Prelease"
84+
);
85+
}
86+
if (buildData.release || buildData.keyStorePath) {
87+
args.push(
8488
`-PksPath=${path.resolve(buildData.keyStorePath)}`,
8589
`-Palias=${buildData.keyStoreAlias}`,
8690
`-Ppassword=${buildData.keyStoreAliasPassword}`,

vendor/gradle-app/app/build.gradle

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,27 @@ android {
219219

220220
signingConfigs {
221221
release {
222-
if (project.hasProperty("release")) {
223-
if (project.hasProperty("ksPath") &&
224-
project.hasProperty("ksPassword") &&
225-
project.hasProperty("alias") &&
226-
project.hasProperty("password")) {
227-
228-
storeFile file(ksPath)
229-
storePassword ksPassword
230-
keyAlias alias
231-
keyPassword password
232-
}
222+
if (project.hasProperty("ksPath") &&
223+
project.hasProperty("ksPassword") &&
224+
project.hasProperty("alias") &&
225+
project.hasProperty("password")) {
226+
227+
storeFile file(ksPath)
228+
storePassword ksPassword
229+
keyAlias alias
230+
keyPassword password
233231
}
234232
}
235233
}
236234
buildTypes {
235+
debug {
236+
if (project.hasProperty("ksPath") &&
237+
project.hasProperty("ksPassword") &&
238+
project.hasProperty("alias") &&
239+
project.hasProperty("password")) {
240+
signingConfig signingConfigs.release
241+
}
242+
}
237243
release {
238244
signingConfig signingConfigs.release
239245
}

0 commit comments

Comments
 (0)