summaryrefslogtreecommitdiffstats
path: root/tools/signapk/test/run
blob: 4e2462557c7c522039d851602c91d622ed14b02f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/make -f

package := NotePad.apk

all: out/signed-$(package)

clean:
	rm -rf out

.PHONY: FORCE

DSAPARAM := out/dsaparam
$(DSAPARAM):
	mkdir -p $(dir $@)
	umask 0077 && openssl dsaparam -out $@ 1024

%.pem: $(DSAPARAM) FORCE
	mkdir -p $(dir $@)
	umask 0077 && openssl gendsa -out $@.pk~ $(DSAPARAM)
	umask 0077 && openssl pkcs8 -topk8 -nocrypt \
		-in $@.pk~ -out $@.pk
	umask 0077 && openssl req -new -x509 -key $@.pk -out $@ -days 1095 \
	    -subj "/C=US/ST=California/L=Mountain View/O=Android/OU=Android/CN=Android/emailAddress=android@android.com"

cert := out/key1.pem
out/signed-$(package): $(package) $(cert)
	mkdir -p $(dir $@)
	SIGNAPK_DEBUG=1 \
	signapk -input $< -output $@ \
		-key $(cert).pk -cert $(cert) -tempdir out