[Script][GAPPS][KitKat] make your own custom package

Search This thread

wilmsn

Senior Member
May 27, 2014
221
211
Muenster
wilmie.de
Do you like to make your own GAPPS? Now you can do!

myGAPPS: create your own GAPPS for KitKat: small or big as you like it
By default you will create very small GAPPS (only 16MB)!

There are 2 scripts inside the zip filr:
"makeit.bat" will run on WINDOWS
"makeit.sh" will run on LINUX

Installing:
  1. Download my scripts http://github.com/wilmsn/myGAPPS/archive/master.zip and extract them at a place on your choice on your computer, called later. MYGAPPS-DIR
  2. Goto MYGAPPS-DIR\tools
  3. Make sure you have installed java runtime on your computer
  4. Linux user: make sure 7z is installed

Creating a GAPPS version:

  1. Download you favorite GAPPS as installable zip file
  2. Place it in MYGAPPS-DIR
  3. Start makeit.bat / makeit.sh
  4. You will find the result in \myGAPPS

Change the content of your GAPPS:

Inside the MYGAPPS-DIR/tools dir you will find 2 scripts:
  • deloldgapps.txt: Put anything in here what you would like the script to delete This will only be included if you answer "Delete old GAPPS from existing ROM [y/n]?" with y
  • instgapps.txt: Change it the way you like it This will allways be included

Tested on:
Samsung Galaxy S plus running CM 11 by ADC Team
Nexus 7 (grouper) running SlimROMs CM 11

Tested with:
GAPPS Package from ADC Team
GAPPS Package from SlimRoms

Visit my GITHUB here: http://github.com/wilmsn

Dont forget: You are responsible for your device.
I offered this script in the hope that it will be helpful to you and i do not take any responsibility for any damages that may caused by this script.
 
Last edited:

broodplank1337

Inactive Recognized Developer
Nov 24, 2011
4,992
10,155
Nijmegen
www.broodplank.net
Nice :), I suggest you could maybe just add the needed binaries in the folder.

so the installing part will be reduced from 5 steps to just 1.

Installing:

Download my scripts http://github.com/wilmsn/myGAPPS/archive/master.zip and extract them at a place on your choice on your computer, called later.
Goto \tools
Extract dos2unix here
Extract 7za442.zip here
Extract here this files from the sign archive: signapk.jar http://github.com/appium/sign/raw/ma...st/signapk.jar, testkey.pk8 http://github.com/appium/sign/raw/master/testkey.pk8, testkey.x509.pem http://raw.githubusercontent.com/app...stkey.x509.pem

(Make sure you have installed java runtime on your computer)

Second, thing I wanted to say, since actually all rom builders that will need gapps are on linux you could maybe make an additional shell script, since there wont be a lot of windows users that build open source roms ;)

here is some example of how it would be in bash/shell script (linux)

Code:
#!/bin/bash
mkdir tools
cd tools
echo "Now configuring your GAPPS...."
echo "ui_print(" ");" > updater-script
echo "ui_print("Make your own GAPPS");" >> updater-script
echo "ui_print(" ");" >> updater-script
echo "ui_print("   by N.Wilms");" >> updater-script
echo "ui_print("Mounting system...");" >> updater-script
echo "run_program("/sbin/busybox", "mount", "/system");" >> updater-script
echo "show_progress(10, 10);" >> updater-script
echo "I can delete the old GAPPS from your ROM."
echo "For Details look at "tools/deloldgapps.txt""
echo "If you have anything more to delete place it there!"
echo
echo "Delete old GAPPS from existing ROM [y/n]?:"
read delOLD 
if [[ $delOLD == "y" ]]
 cat `deloldgapps.txt` >> updater-script
echo "show_progress(10, 10);" >> updater-script
 cat `instgapps.txt` >> updater-script
echo "Now extracting ....."
7za -o..\extract ..\*.zip META-INF\CERT.RSA > output.txt
7za x -o..\extract ..\*.zip META-INF\CERT.SF >> output.txt
7za x -o..\extract ..\*.zip META-INF\MANIFEST.MF >> output.txt
7za x -o..\extract ..\*.zip META-INF\com\google\android\update-binary >> output.txt
7za x -o..\extract ..\*.zip system\addon.d\*gapps.sh >> output.txt
7za x -o..\extract ..\*.zip system\app\GoogleContactsSyncAdapter.apk >> output.txt
7za x -o..\extract ..\*.zip system\etc\permissions\com.google.android.maps.xml >> output.txt
7za x -o..\extract ..\*.zip system\etc\permissions\com.google.android.media.effects.xml >> output.txt
7za x -o..\extract ..\*.zip system\etc\permissions\com.google.widevine.software.drm.xml >> output.txt
7za x -o..\extract ..\*.zip system\etc\permissions\features.xml >> output.txt
7za x -o..\extract ..\*.zip system\framework\com.google.android.maps.jar >> output.txt
7za x -o..\extract ..\*.zip system\framework\com.google.android.media.effects.jar >> output.txt
7za x -o..\extract ..\*.zip system\framework\com.google.widevine.software.drm.jar >> output.txt
7za x -o..\extract ..\*.zip system\priv-app\CalendarProvider.apk >> output.txt
7za x -o..\extract ..\*.zip system\priv-app\GoogleBackupTransport.apk >> output.txt
7za x -o..\extract ..\*.zip system\priv-app\GoogleFeedback.apk >> output.txt
7za x -o..\extract ..\*.zip system\priv-app\GoogleLoginService.apk >> output.txt
7za x -o..\extract ..\*.zip system\priv-app\GooglePartnerSetup.apk >> output.txt
7za x -o..\extract ..\*.zip system\priv-app\GoogleServicesFramework.apk >> output.txt
7za x -o..\extract ..\*.zip system\priv-app\Phonesky.apk  >> output.txt
7za x -o..\extract ..\*.zip system\priv-app\PrebuiltGmsCore.apk >> output.txt
7za x -o..\extract ..\*.zip system\priv-app\SetupWizard.apk >> output.txt
mv updater-script ..\extract\META-INF\com\google\android  >> output.txt
echo "if you would like to add some APKs?"
echo "Copy them to the right place in the "extract" dir."
echo "Or change something else?"
echo "Now its the time!"
echo
echo "Press any key to continue"
read any
echo "Zipping"
7za a -tzip "../updateold.zip" "../extract/*" -mx
echo "Signing"
java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 ../updateold.zip ../mygapps/mygapps.zip
cd ..
rm updateold.zip
echo "Press any key to continue"
read any


Not tested but this should somewhat do the trick on linux
 

a3361035

Senior Member
May 10, 2014
108
123
Modifying other random GAPPS packages is a bad idea as those are moving targets.
This script doesn't help in determining which files belong to which app nor is deloldgapps.txt a good starting point as it would miss lots of apps for pa_gapps-modular-full.
It also doesn't update addon.d.

Something like PA GAPPS REMOVER, which actually tracks the matching GAPPS package is the way to go:
http://xdaforums.com/showpost.php?p=50684852&postcount=8
 
Last edited:

RF men

New member
Nov 12, 2014
1
0
Hello Muenster, I can't get it working. I am using Windows 7. See the screen dump.

Now configuring your GAPPS....
I can delete the old GAPPS from your ROM.
For Details look at "tools/deloldgapps.txt"
If you have anything more to delete place it there!
Delete old GAPPS from existing ROM [y/n]?: n
Now extracting .....
dos2unix: converting file updater-script to Unix format...
Het systeem kan het opgegeven pad niet vinden. (can't find the path)
If you would like to add some APKs?
Copy them to the right place in the "extract" dir.
Or change something else?
Now its the time!
Druk op een toets om door te gaan. . .

Regards,

RF men
 

wilmsn

Senior Member
May 27, 2014
221
211
Muenster
wilmie.de
Hello RF men,

looks like you did not install "dos2unix.exe". You will find it on my github - see OP.

Regards
wilmsn
PS: Sorry for late answer.
 

L0X0R

Senior Member
Dec 15, 2014
337
79
Melbourne
I never tested it.
So be the first one to test it and post your results here

Hey, I'm trying to build for lollipop as well, but having trouble cause I probably don't fully understand what I'm doing :p
My build just ends up as 16kb with just the meta-if folder which is a lot different from the pico gapps I'm trying to base it off.

Just wondering how I get new googleservices.apk's etc.. into a new flashable gapps.
Not sure what I'm doing wrong :p
 

wilmsn

Senior Member
May 27, 2014
221
211
Muenster
wilmie.de
Hey, I'm trying to build for lollipop as well, but having trouble cause I probably don't fully understand what I'm doing :p
My build just ends up as 16kb with just the meta-if folder which is a lot different from the pico gapps I'm trying to base it off.

Just wondering how I get new googleservices.apk's etc.. into a new flashable gapps.
Not sure what I'm doing wrong :p

Hi LOXOR,
as i wrote before my package was designed for Kitkat.
If you would like to build it just follow the steps in OP.

If you need any further help give me more details here in the forum.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 32
    Do you like to make your own GAPPS? Now you can do!

    myGAPPS: create your own GAPPS for KitKat: small or big as you like it
    By default you will create very small GAPPS (only 16MB)!

    There are 2 scripts inside the zip filr:
    "makeit.bat" will run on WINDOWS
    "makeit.sh" will run on LINUX

    Installing:
    1. Download my scripts http://github.com/wilmsn/myGAPPS/archive/master.zip and extract them at a place on your choice on your computer, called later. MYGAPPS-DIR
    2. Goto MYGAPPS-DIR\tools
    3. Make sure you have installed java runtime on your computer
    4. Linux user: make sure 7z is installed

    Creating a GAPPS version:

    1. Download you favorite GAPPS as installable zip file
    2. Place it in MYGAPPS-DIR
    3. Start makeit.bat / makeit.sh
    4. You will find the result in \myGAPPS

    Change the content of your GAPPS:

    Inside the MYGAPPS-DIR/tools dir you will find 2 scripts:
    • deloldgapps.txt: Put anything in here what you would like the script to delete This will only be included if you answer "Delete old GAPPS from existing ROM [y/n]?" with y
    • instgapps.txt: Change it the way you like it This will allways be included

    Tested on:
    Samsung Galaxy S plus running CM 11 by ADC Team
    Nexus 7 (grouper) running SlimROMs CM 11

    Tested with:
    GAPPS Package from ADC Team
    GAPPS Package from SlimRoms

    Visit my GITHUB here: http://github.com/wilmsn

    Dont forget: You are responsible for your device.
    I offered this script in the hope that it will be helpful to you and i do not take any responsibility for any damages that may caused by this script.
    7
    Script updated - now working also on linux

    I have just uploaded a new version.
    • Inside you will find a script "makeit.sh" which will work on linux systems. Be sure the programm 7z is installed!
    • Some small update in file structure
    • Aditional programms are included now
    3
    Modifying other random GAPPS packages is a bad idea as those are moving targets.
    This script doesn't help in determining which files belong to which app nor is deloldgapps.txt a good starting point as it would miss lots of apps for pa_gapps-modular-full.
    It also doesn't update addon.d.

    Something like PA GAPPS REMOVER, which actually tracks the matching GAPPS package is the way to go:
    http://xdaforums.com/showpost.php?p=50684852&postcount=8
    3
    You can find it inside the zip file: sign-master-1.zip ==> sign-master => dist
    Or go to my github i forked it.

    Sweet thanks :) I will feature your work in the portal :)
    3
    Nice :), I suggest you could maybe just add the needed binaries in the folder.

    so the installing part will be reduced from 5 steps to just 1.

    Installing:

    Download my scripts http://github.com/wilmsn/myGAPPS/archive/master.zip and extract them at a place on your choice on your computer, called later.
    Goto \tools
    Extract dos2unix here
    Extract 7za442.zip here
    Extract here this files from the sign archive: signapk.jar http://github.com/appium/sign/raw/ma...st/signapk.jar, testkey.pk8 http://github.com/appium/sign/raw/master/testkey.pk8, testkey.x509.pem http://raw.githubusercontent.com/app...stkey.x509.pem

    (Make sure you have installed java runtime on your computer)

    Second, thing I wanted to say, since actually all rom builders that will need gapps are on linux you could maybe make an additional shell script, since there wont be a lot of windows users that build open source roms ;)

    here is some example of how it would be in bash/shell script (linux)

    Code:
    #!/bin/bash
    mkdir tools
    cd tools
    echo "Now configuring your GAPPS...."
    echo "ui_print(" ");" > updater-script
    echo "ui_print("Make your own GAPPS");" >> updater-script
    echo "ui_print(" ");" >> updater-script
    echo "ui_print("   by N.Wilms");" >> updater-script
    echo "ui_print("Mounting system...");" >> updater-script
    echo "run_program("/sbin/busybox", "mount", "/system");" >> updater-script
    echo "show_progress(10, 10);" >> updater-script
    echo "I can delete the old GAPPS from your ROM."
    echo "For Details look at "tools/deloldgapps.txt""
    echo "If you have anything more to delete place it there!"
    echo
    echo "Delete old GAPPS from existing ROM [y/n]?:"
    read delOLD 
    if [[ $delOLD == "y" ]]
     cat `deloldgapps.txt` >> updater-script
    echo "show_progress(10, 10);" >> updater-script
     cat `instgapps.txt` >> updater-script
    echo "Now extracting ....."
    7za -o..\extract ..\*.zip META-INF\CERT.RSA > output.txt
    7za x -o..\extract ..\*.zip META-INF\CERT.SF >> output.txt
    7za x -o..\extract ..\*.zip META-INF\MANIFEST.MF >> output.txt
    7za x -o..\extract ..\*.zip META-INF\com\google\android\update-binary >> output.txt
    7za x -o..\extract ..\*.zip system\addon.d\*gapps.sh >> output.txt
    7za x -o..\extract ..\*.zip system\app\GoogleContactsSyncAdapter.apk >> output.txt
    7za x -o..\extract ..\*.zip system\etc\permissions\com.google.android.maps.xml >> output.txt
    7za x -o..\extract ..\*.zip system\etc\permissions\com.google.android.media.effects.xml >> output.txt
    7za x -o..\extract ..\*.zip system\etc\permissions\com.google.widevine.software.drm.xml >> output.txt
    7za x -o..\extract ..\*.zip system\etc\permissions\features.xml >> output.txt
    7za x -o..\extract ..\*.zip system\framework\com.google.android.maps.jar >> output.txt
    7za x -o..\extract ..\*.zip system\framework\com.google.android.media.effects.jar >> output.txt
    7za x -o..\extract ..\*.zip system\framework\com.google.widevine.software.drm.jar >> output.txt
    7za x -o..\extract ..\*.zip system\priv-app\CalendarProvider.apk >> output.txt
    7za x -o..\extract ..\*.zip system\priv-app\GoogleBackupTransport.apk >> output.txt
    7za x -o..\extract ..\*.zip system\priv-app\GoogleFeedback.apk >> output.txt
    7za x -o..\extract ..\*.zip system\priv-app\GoogleLoginService.apk >> output.txt
    7za x -o..\extract ..\*.zip system\priv-app\GooglePartnerSetup.apk >> output.txt
    7za x -o..\extract ..\*.zip system\priv-app\GoogleServicesFramework.apk >> output.txt
    7za x -o..\extract ..\*.zip system\priv-app\Phonesky.apk  >> output.txt
    7za x -o..\extract ..\*.zip system\priv-app\PrebuiltGmsCore.apk >> output.txt
    7za x -o..\extract ..\*.zip system\priv-app\SetupWizard.apk >> output.txt
    mv updater-script ..\extract\META-INF\com\google\android  >> output.txt
    echo "if you would like to add some APKs?"
    echo "Copy them to the right place in the "extract" dir."
    echo "Or change something else?"
    echo "Now its the time!"
    echo
    echo "Press any key to continue"
    read any
    echo "Zipping"
    7za a -tzip "../updateold.zip" "../extract/*" -mx
    echo "Signing"
    java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 ../updateold.zip ../mygapps/mygapps.zip
    cd ..
    rm updateold.zip
    echo "Press any key to continue"
    read any


    Not tested but this should somewhat do the trick on linux