Build script help

Discussion in 'Question & Answers' started by 1982Strand, Jun 17, 2012.

  1. 1982Strand

    1982StrandMembers

    Apr 2, 2011
    204
    10
    40
    Hey guys..
    I'm trying to make a small linux script for decompile/recompile of apks.

    I got 2 small issues. To start with, i got my script project in /root/test/ and the decompiled apks in /root/test/apk_in/
    I want to place the recompiled apks in /root/test/apk_out, but when i run the script, places them like this:
    /root/test/apk_out/apk_in/*.apk

    I've googled my way to the commands i use, but i'm doing some stupid error somewhere i'm just not seeing..

    And also. When the recompiling is done, i need to extract/inject the original META-INF (or re-signing the apks?), but i have no idea to do this, so any help is appreciated.

    Here's the commands in my script for recompiling:
    Code:
    for b in `find apk_in/* -maxdepth 0 -type d`; do
    echo "Recompiling $b.apk"
    apktool -q b -f $b ./apk_out/$b.apk
    done
    Hope to get some tips on this and thanks for your patience with a non-programmer :)
     
  2. iBotPeaches

    iBotPeachesScript Gatekeeper

    Oct 31, 2011
    3,811
    1,115
    335
    Kansas
    Thats confusing to me.

    cd into the directory.


    Code:
    for file in *.apk; do;
    apktool -q b -f "$(basename $file)" "./apk_out/$(basename $file).apk"
    done
     

Share Our Site