bigrushdog

Untitled

Oct 28th, 2011
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.81 KB | None | 0 0
  1. VERSION = $(shell git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/*\s//g')
  2. ROM=miui
  3. DEVICE=shooter
  4. BUILD_DATE=$(shell date +-%F_%H%M)
  5.  
  6. ## FRAMEWORK is the array of framework files that are built each time.
  7. ## Each framework file path is also prefixed by build/. e.g
  8. # FRAMEWORK = build/system/framework/framework.jar
  9. FRAMEWORK = build/system/framework/framework-res.apk build/system/framework/framework.jar build/system/framework/android.policy.jar build/system/framework/services.jar
  10.  
  11. ## APPLICATIONS is the array of applications that are built each time with apktool.
  12. ## Each application path is prefixed by build/. e.g
  13. # APPLICATIONS = build/system/app/Browser.apk
  14. APPLICATIONS = build/system/app/Launcher2.apk
  15.  
  16. ## TEST_SIGNED is the array of applications that are test signed.
  17. ## Each application bath is prefixed by sign/.
  18. TEST_SIGNED = build/system/app/Launcher2.apk
  19.  
  20. # Apps we dont build because of Signature issues
  21. # build/system/app/Maps.apk
  22.  
  23. # Apps that cannot be build ATM
  24. # build/system/app/LiveWallpaperPicker.apk
  25. # build/system/app/EmailGoogle.apk
  26.  
  27. .PHONY: java
  28.  
  29. all: build
  30.  
  31. clean:
  32.     rm -rfv build
  33.     rm -rfv decompiled/*/*/build
  34.     rm -rfv decompiled/framework/*/resources/classes.dex
  35.     rm -rfv decompiled/*/*.unsigned
  36.     cd java && make clean
  37.  
  38. ramdisk-build: clean
  39.     mkdir -p build/resources/ && cd ramdisk && find . | cpio -H newc -o | gzip > ../build/resources/ramdisk.gz
  40.  
  41. java:
  42.     cd java && make
  43.  
  44. build/system/app/%.apk: system-build java
  45.     mkdir -p build/system/app
  46.     apktool b decompiled/app/$* decompiled/app/$*.apk
  47.     cd decompiled/app/$*/zip-resources && zip -r ../../$*.apk AndroidManifest.xml  META-INF
  48.     mv decompiled/app/$*.apk build/system/app/$*.apk
  49.  
  50. build/system/framework/%.jar: system-build java
  51.     mkdir -p build/system/framework
  52.     smali decompiled/framework/$*/smali -o decompiled/framework/$*/resources/classes.dex
  53.     cd decompiled/framework/$*/resources && zip ../$*.jar -r *
  54.     mv decompiled/framework/$*/$*.jar build/system/framework/$*.jar
  55.  
  56. build/system/framework/%.apk: system-build
  57.     mkdir -p build/system/framework
  58.     apktool b decompiled/framework/$* decompiled/framework/$*.apk
  59.     cd decompiled/framework/$*/zip-resources && zip -r ../../$*.apk AndroidManifest.xml  META-INF
  60.     mv decompiled/framework/$*.apk build/system/framework/$*.apk
  61.  
  62. system-build: clean
  63.     mkdir -p build/system
  64.     cp -Rv system/* build/system/
  65.  
  66. update-zip-build: clean
  67.     mkdir -p build/
  68.     cp -Rv update-zip/* build/
  69.  
  70. build:  system-build update-zip-build ${FRAMEWORK} ${APPLICATIONS}
  71.     mkdir -p out && cd build && zip ../out/Tiamat-$(DEVICE)-$(ROM)-$(VERSION)$(BUILD_DATE).zip -r *
  72.     java -classpath `which testsign.jar` testsign out/Tiamat-$(DEVICE)-$(ROM)-$(VERSION)$(BUILD_DATE).zip out/Tiamat-$(DEVICE)-$(ROM)-$(VERSION)$(BUILD_DATE)_signed.zip
  73.     rm out/Tiamat-$(DEVICE)-$(ROM)-$(VERSION)$(BUILD_DATE).zip
  74.  
Advertisement
Add Comment
Please, Sign In to add comment