Upload generated .apk into Diawi using script - android

Is it possible to avoid manually uploading the .apk file into Diawi by using some scripts?
I saw that there is a plugin for Jenkins that uploads the .apk after CI and I was wondering if it is possible to do the same locally by using the command line.

After browsing in the Diawi documentation I found some guidance here. But I had issues with the HTTP 2 version and I had to force curl to use HTTP 1.1 instead. You can open the terminal of the Android Studio a just write the scripts. With the gradlew assembleRelease a .apk file will be generated, and after that, the curl command will upload it to your Diawi profile.
This is the command for Mac users:
./gradlew assembleRelease && curl -v --http1.1 https://upload.diawi.com/ -F token='<your_DIAWI_token>' -F file=#/<path_to_your_apk>/myapp-release.apk -F find_by_udid=0 -F callback_emails='<your_mail>'
This is for Windows users:
gradlew assembleRelease && curl -v --http1.1 https://upload.diawi.com/ -F token="<your_DIAWI_token>" -F file=#/<path_to_your_apk>/myapp-release.apk -F find_by_udid=0 -F callback_emails="<your_mail>"

Related

Install Git in Pydroid 3 terminal

I'm using Pydroid3 and would like to use Git in the Pydroid Terminal.
In my Termux terminal I was able to install Git as described here: Python and Git on Android
The git command is now only recognized in the Termux Terminal but not in Pydroid :(. Installation of Git with apt-get in the Pydroid Terminal is not possible.
Has anybody managed to install Git for Pydroid?
This is working for me; you might need to tweak the curl or configure commands if things fail. I haven't looked into ssh for now, only https.
# enter dev folder
cd $HOME
# set a prefix variable for convenience
export PREFIX="$(readlink -f "$PKG_CONFIG_PATH"/../..)"
# if you want git-remote-https, first build and install curl
curl -LO https://curl.se/download/curl-7.77.0.tar.bz2
tar -jxvf curl-7.77.0.tar.bz2
cd curl-7.77.0
./configure --prefix="$PREFIX" --disable-static --with-openssl --with-ca-path=/system/etc/security/cacerts --with-ca-bundle="$SSL_CERT_FILE"
make -j8 install
cd ..
# download and enter git sources
curl -LO https://www.kernel.org/pub/software/scm/git/git-2.32.0.tar.gz
tar -zxvf git-2.32.0.tar.gz
cd git-2.32.0
# reconfigure git for platform
./configure --prefix="$PREFIX" --without-tcltk --disable-pthreads LDFLAGS="-lssl -lcrypto -lz"
# if you didn't install curl, download autoconf's install script since there is no coreutils on android
# curl "http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;f=build-aux/install-sh;hb=HEAD" -o install
# otherwise copy curl's install script in
cp ../curl-*/install-sh install
# build and install git
make -j8 install INSTALL="sh $(pwd)/install"

How to assemble apk from disassembled .smali file?

Using SmaliBaksmali, I disassembled an apk to .smali files and made some code changes.
baksmali disassemble app.apk -o app
How to assemble these .smali file to apk file?
1.
build the apk using this command with apktool:
apktool.jar -f b <app-location> -o <output.apk>
2.
Then sign the apk, you can use uber-signer:
uber-apk-signer.jar --debug -a <output.apk> --overwrite --allowResign
3.
Install on device via adb:
adb -d install <output.apk>

AOSP 6.0 Build for hammerhead - proprietary binaries

I just built AOSP 6.0 for hammerhead and attempted to flash it. My phone froze at the Google logo and refused to boot. I'm assuming I need to use the proprietary binaries found here https://developers.google.com/android/nexus/drivers
How would I extract these and put them in to my build? Thanks.
Be certain to download the Nexus 5 binaries that match the version of AOSP that you're building. For example, if you're building the most recent version of AOSP, when you initialized your repo you entered this command:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.1_r72
Take that last branch code (everything after '-b') android-6.0.1_r72 and search for it over here:
https://source.android.com/source/build-numbers.html#source-code-tags-and-builds
It matches build M4B30X
Now, take that build code M4B30X and search for it over here:
https://developers.google.com/android/nexus/drivers
Download the corresponding binaries:
$ cd ~/Downloads
$ wget https://dl.google.com/dl/android/aosp/broadcom-hammerhead-m4b30x-7c7b231f.tgz
$ wget https://dl.google.com/dl/android/aosp/lge-hammerhead-m4b30x-74fa3aa5.tgz $ wget https://dl.google.com/dl/android/aosp/qcom-hammerhead-m4b30x-158606cf.tgz
Verify the integrity of each download:
$ echo "01a03cf36b20ee2460d108c1d199f4b012b084368cddfbff1e40ff8270b54d6f broadcom-hammerhead-m4b30x-7c7b231f.tgz" | sha256sum -c
$ echo "a533f4c82d430181b97ab2321acf10ab1e2b126de7bb15437c969331541af7cb lge-hammerhead-m4b30x-74fa3aa5.tgz" | sha256sum -c
$ echo "9a2760bda79e3be7bbe7203c05273c80b0d043d9aaf15be20361e35b16ef8905 qcom-hammerhead-m4b30x-158606cf.tgz" | sha256sum -c
Extract each gzip file:
$ tar xzvf broadcom-hammerhead-m4b30x-7c7b231f.tgz
$ tar xzvf lge-hammerhead-m4b30x-74fa3aa5.tgz
$ tar xzvf qcom-hammerhead-m4b30x-158606cf.tgz
Execute the resulting self-extracting files from the source tree's root folder(~/AOSP)
$ cd ~/AOSP
$ ~/Downloads/extract-broadcom-hammerhead.sh
$ ~/Downloads/extract-lge-hammerhead.sh
$ ~/Downloads/extract-qcom-hammerhead.sh
After executing each file hit the Enter key once and then hit
the Space bar until you reach the end of each document.
At the end of each document type:
I ACCEPT
and hit the Enter key.
To accommodate the new binaries you must initiate a full rebuild, so set the
environment:
$ ./ build/envsetup.sh
$ lunch aosp_hammerhead-userdebug
And make the synthetic target 'clobber' in order to clean:
$ make clobber
Now rebuild:
(If you're running a Core2Duo)
$ make -j4
(Or, if you're running something bigger)
$ make -j16
Uncompress the downloaded files, you will get bash files. Put all these files in the root directory of your AOSP project and execute them. You will have to accept the licenses and the binaries will be extracted in the right directory.
After this step. In the AOSP root directory, execute :
make clobber
It will clean the current build (out/**). It is needed for the make to notice the changes regarding the AOSP build official procedure.
Then you can compile again the sources.
make -j4
(or j8/j16 regarding your CPU threads number)

Titanium CLI not accepting the .keystore file provided

I am trying to make android build, target set to build for dist-playstore from Titanium CLI. I am using this command
titanium build -p android -b -d /Users/ajeetpratap005/Documents/Titanium_Studio_Workspace/androidTest
-f -L androidTest -A /Users/ajeetpratap005/android-sdks
-K /Users/ajeetpratap005/android-test.keystore
-T dist-playstore -O /Users/ajeetpratap005/Documents/Titanium_Studio_Workspace/androidTest/dist
It builds successfully but I am not able to get my build in the output folder. when I checked the build which is getting generated in the build/android/bin folder, it is signed with the default keystore file which is present in the
<titanium mobile SDK location>/3.0.0.G.A/android/dev_keystore
How do I make titanium CLI to take my .keystore file and dump the production build to the output folder mention in the command..
Please refer to this document
https://wiki.appcelerator.org/display/guides/Packaging+for+the+Android+Market
There are instructions on the android developer site for generating the certificate key file here: http://developer.android.com/guide/publishing/app-signing.html#cert
See this video for more clarity http://vimeo.com/10278960

Asset access error in APK made by using shell script

I wrote the shell script to build APK to automate build process. It's like below.
rm -rf obj
rm -rf gen
rm -rf bin
rm -f build.xml
rm -f local.properties
rm -f proguard-project.txt
ndk-build
android update project --path ./
ant release
jarsigner -verbose -keystore path/keystore -storepass password -signedjar bin/myApp-release-signed.apk bin/myApp-release-unsigned.apk alias
Currently, I got the APK successfully. But I found sometimes app is crashed when it try to access special asset like texture image. LogCat shows the log like below.
04-10 12:46:25.080: E/szipinf(2255): Error reading asset data
04-10 12:46:25.080: E/szipinf(2255): Unable to access asset data: -1
Eclipse can build APK well. I tried to find the way to fox APK's issue. But I cannot find.
Currently, I'm using android-12 and ndk-r6b. Also I'm working on Machintosh. Is there any special guide to fix such a thing?

Categories

Resources