I'm trying to deconstruct the Android app development process by creating and installing a sample app entirely from the command line (without even using Ant). I've composed a script which seems to work until the very last command, at which point I get the message
134 KB/s (10496 bytes in 0.076s)
pkg: /data/local/tmp/MyActivity-debug.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
Please don't be put off by the fact that my script is a Windows .bat script. I'm just calling code from the SDK's tools and platform-tools directories. Anyway, here's the script. If find what I'm missing that's giving me the NO_CERTIFICATES error, please reply...
call "c:\program files (x86)\Android\android-sdk\tools\android" create project --target 10 --name MyAndroidProject --path c:\MyProjects\MyAndroidProject --activity MyActivity --package com.allmycode.samples
cd \MyProjects\MyAndroidProject
mkdir C:\MyProjects\MyAndroidProject\res
mkdir C:\MyProjects\MyAndroidProject\libs
mkdir C:\MyProjects\MyAndroidProject\bin
mkdir C:\MyProjects\MyAndroidProject\gen
mkdir C:\MyProjects\MyAndroidProject\bin\classes
"C:\Program Files (x86)\Android\android-sdk\platform-tools\aapt.exe" package -f -m -M C:\MyProjects\MyAndroidProject\AndroidManifest.xml -S C:\MyProjects\MyAndroidProject\res -I "C:\Program Files (x86)\Android\android-sdk\platforms\android-9\android.jar" -J C:\MyProjects\MyAndroidProject\gen
"c:\program files\java\jdk1.7.0\bin\javac" -d C:\MyProjects\MyAndroidProject\bin\classes -classpath C:\MyProjects\MyAndroidProject\bin\classes;C:\MyProjects\MyAndroidProject;c:\ant\lib\ant-launcher.jar;"C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip";C:\ant\lib\ant-antlr.jar;C:\ant\lib\ant-apache-bcel.jar;C:\ant\lib\ant-apache-bsf.jar;C:\ant\lib\ant-apache-log4j.jar;C:\ant\lib\ant-apache-oro.jar;C:\ant\lib\ant-apache-regexp.jar;C:\ant\lib\ant-apache-resolver.jar;C:\ant\lib\ant-apache-xalan2.jar;C:\ant\lib\ant-commons-logging.jar;C:\ant\lib\ant-commons-net.jar;C:\ant\lib\ant-jai.jar;C:\ant\lib\ant-javamail.jar;C:\ant\lib\ant-jdepend.jar;C:\ant\lib\ant-jmf.jar;C:\ant\lib\ant-jsch.jar;C:\ant\lib\ant-junit.jar;C:\ant\lib\ant-junit4.jar;C:\ant\lib\ant-netrexx.jar;C:\ant\lib\ant-swing.jar;C:\ant\lib\ant-testutil.jar;C:\ant\lib\ant.jar;"C:\Program Files\Java\jdk1.7.0\lib\tools.jar" -sourcepath C:\MyProjects\MyAndroidProject\src;C:\MyProjects\MyAndroidProject\gen -target 1.5 -bootclasspath "C:\Program Files (x86)\Android\android-sdk\platforms\android-9\android.jar" -encoding UTF-8 -g -source 1.5 c:\MyProjects\MyAndroidProject\src\com\allmycode\samples\*.java
call "C:\Program Files (x86)\Android\android-sdk\platform-tools\dx.bat" --dex --output=C:\MyProjects\MyAndroidProject\bin\classes.dex C:\MyProjects\MyAndroidProject\bin\classes
"C:\Program Files (x86)\Android\android-sdk\platform-tools\aapt.exe" package -f --debug-mode -M C:\MyProjects\MyAndroidProject\AndroidManifest.xml -S C:\MyProjects\MyAndroidProject\res -I "C:\Program Files (x86)\Android\android-sdk\platforms\android-9\android.jar" -F C:\MyProjects\MyAndroidProject\bin\MyActivity-debug-unaligned.apk
"C:\Program Files (x86)\Android\android-sdk\tools\zipalign.exe" -f 4 C:\MyProjects\MyAndroidProject\bin\MyActivity-debug-unaligned.apk C:\MyProjects\MyAndroidProject\bin\MyActivity-debug.apk
start "Launch an emulator" "C:\Program Files (x86)\Android\android-sdk/tools/emulator.exe" -avd Gingerbread
timeout /T 60
"C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" install -r C:\MyProjects\MyAndroidProject\bin\MyActivity-debug.apk
You need to sign your apk
Hey, I believe all you need to do is sign your .apk with a certificate.
Here is a link about creating a certificate if you dont already have one. I tried to include a link but it wont let me. (sorry im a new user)
Once you have acquired a certificate, you can then use the JDK utitility called jarsigner. The terminal command should be something like this...
jarsigner -verbose -keystore my-release-key.keystore final.apk alias_name
Click to expand...
Click to collapse
Hope this helps ya out.
Ahoy, I'm Rumbla Threepwood....a mighty pirate...
...wait, that's for another time, another story....
Hello fellas, here I am with an adventure in the Fabulous world of "BlueStacks Rooting and Debloating".
When I first started rooting BlueStacks this way, you needed a linux machine/VM to mount the root.fs in a read/write mode and modify it.
That's not very practical, isn't it?
Also, lately, they changed the format of these "filesystem" file to 'vdi' (Virtual Box format?) and these are not so easily mountable anymore.
So what?
Well, I came up with another, much simpler and less demanding method.
This new one, won't require any linux OS, nor copy around your filesystems!
Keep in mind that's always better have a backup of these filesystem you're going to modify, but even that it's not really necessary.
You could always just uninstall/reinstall BlueStacks and start anew!
Ohh....and this method should be working with EVERY BlueStacks version.
That's it, from 0.9.x to the latest 2.3.x
Once again, I don't know if this method will work with future BlueStacks versions, but hey, I will gladly accept a crystall ball as donation, if you wish to do so!
Like in the previous thread, we will still be using the closed-source classic Android App "SuperSU" (from chainfire!)
Here's the link: http://download.chainfire.eu/921/SuperSU/UPDATE-SuperSU-v2.65-20151226141550.zip
If you want to know more about it here are some links:
https://su.chainfire.eu
http://forum.xda-developers.com/apps/supersu
http://forum.xda-developers.com/showthread.php?t=1538053
If you don't like "Closed Source" you could try this method using the WiP Open-Source Android app "SuperUser", but then you're on your own.
As for SuperSU, here's some links about "phh's SuperUser":
http://www.xda-developers.com/the-importance-of-open-source-in-root/
http://forum.xda-developers.com/android/software-hacking/wip-selinux-capable-superuser-t3216394
https://github.com/phhusson/Superuser
Well, let's get started!
First of all, to root BlueStacks this way you need access to just one thing: "cmd.exe" (with admin-privileges, for some tasks)
You will also need some linux knowledge. It's not stricly necessessary, but I won't provide any support about the part dealing with linux commands. You could just follow my instructions blindly and probably you will be able to root it, but it might not be that simple...well, at least, I told you.
The second step requires you to gather the necessary software. Namely, an Android App to handle root-permission (SuperSU/SuperUser).
At this time, you should be able to find SuperSu v2.65 (Stable). The instructions should be the same with other SuperSU versions. I can't really say.
About SuperUser, you're on your own (but if you try and you succeed, I would like to read about your discoveries...and instruction, so I can add them here!)
Here is a link (it should be the direct link from the developers...ChainFire!):
https://download.chainfire.eu/921/SuperSU
Well, you should now have all the needed software, but you may want to gather some APKs with the software you like the most...so you can install it right away!
In fact, if you follow this How-To fully, you would end up even without the stock BlueStacks launcher, so be prepared.
This How-To assumes you already have BlueStacks installed on your system, but make sure it isn't running.
So, let's get started.
WARNING These instructions are for BlueStacks 2.3.29.6222. They may be slightly different for older/newer versions, but the method is the same!
Click to expand...
Click to collapse
1) Unpack SuperSU/SuperUser zip archive somewhere. You need to copy files from this archive into your Root.fs!
1b) Unpack your busybox (I usually use this one: https://busybox.net/downloads/binaries/latest/busybox-i686, already unpacked!) and keep it ready.
1c) You could install busybox using an APK, the outcome should be same...I usually don't do that tho (see 1b)...
2) Start up your cmd.exe. This will be your best-friend for the next 10/15 minutes
3) Let's start changing some "Registry" values.
These changes should stop your BlueStacks calling back-home.
They will turn off BlueStacks Camera.
They will fake your "position" to 0.0/0.0, turning off the GPS too.
They will turnoff SystemStats (is this really needed?).
They will take away some of the default "Shared-Folders"
Code:
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Agent\AppSync /f /v Enabled /t REG_DWORD /d 0
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Agent\Cloud /f /v Host /t REG_SZ /d https://127.0.0.1
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Agent\Cloud /f /v Host2 /t REG_SZ /d https://127.0.0.1
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Agent\Cloud /f /v CCPinCheckSecs /t REG_DWORD /d 0xffffffff
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Agent\Cloud /f /v SyncIntervalSecs /t REG_DWORD /d 0xffffffff
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Config /f /v OEM /t REG_SZ /d BlueStacks
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\Config /f /v Camera /t REG_DWORD /d 0
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\Config /f /v IsFrontendFirstLaunch /t REG_DWORD /d 0
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\Config /f /v SystemStats /t REG_DWORD /d 0
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\Config /f /v UsbAutoMount /t REG_DWORD /d 0
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\Config /f /v GpsMode /t REG_DWORD /d 0
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\Config /f /v GpsLatitude /t REG_SZ /d "0.0"
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\Config /f /v GpsLongitude /t REG_SZ /d "0.0"
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\Config /f /v OEM /t REG_SZ /d BlueStacks
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Updater /f /v ManifestURL /t REG_SZ /d "http://127.0.0.1/updates/manifest_2.3.29.6222"
# Admin Privileges required for these changes ###########
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\SharedFolder\1 /f /v Name /t REG_SZ /d "InputMapper"
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\SharedFolder\1 /f /v Path /t REG_SZ /d "C:\BlueStacks\UserData\InputMapper\"
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\SharedFolder\2 /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\SharedFolder\3 /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\SharedFolder\4 /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\SharedFolder\5 /f
4) To speed up BlueStacks slightly, you could turn off both BlueStacks Updater and BlueStacks Logs
How? Very simple, but you need admin privileges to do so:
Code:
# Admin Privileges required for these changes ###########
move "C:\Program Files (x86)\BlueStacks\HD-LogRotatorService.exe" "C:\Program Files (x86)\BlueStacks\HD-LogRotatorService.norun.exe"
move "C:\Program Files (x86)\BlueStacks\HD-LogRotator.exe" "C:\Program Files (x86)\BlueStacks\HD-LogRotator.norun.exe"
move "C:\Program Files (x86)\BlueStacks\HD-LogCollector.exe" "C:\Program Files (x86)\BlueStacks\HD-logCollector.norun.exe"
move "C:\Program Files (x86)\BlueStacks\HD-Updater.exe" "C:\Program Files (x86)\BlueStacks\HD-Updater.norun.exe"
5) Now, let's get to the "core" of the rooting process!
First of all we need adb working so:
Code:
sc start BstHdAndroidSvc
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" kill-server
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" start-server
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" wait-for-device
6) Now, let's start an adb shell and get done with the "SECRET" (or the core of this rooting method)
Code:
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" shell
Now you should have an user-prompt (can you see that $?).
To modify our filesystem we need root privileges, tho....
...but BlueStacks' guys were so kind they left an hidden "su" for us!
Let's run it...getting some root privileges!
Code:
/system/xbin/bstk/su
Now you should have a root-prompt (can you see that #?).
Keep this cmd.exe windows open....remember? It's your best-friend now.
7) Now that we are the Nietzsche's SuperHuman, we can go on and do all of our stuff!!!
First of all, let's mount "system" as read/write. I also create a tmp directory there, to store my tmp stuff
Code:
mount -o remount,rw /dev/sda1 /system
mkdir /system/tmp
Now, you should open another cmd.exe window and use it to push some stuff in our newly-create directory
Code:
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" push path_to/SuperSU/2.65/common/SuperUser.apk /system/tmp
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" push path_to/SuperSU/2.65/x86/su /system/tmp
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" push path_to/SuperSU/2.65/x86/supolicy /system/tmp
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" push path_to/SuperSU/2.65/x86/libsupol.so /system/tmp
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" push path_to/busybox/busybox-i686 /system/tmp/
Get back at your android-root-prompt.
Time to copy the apk:
Code:
chown system:system /system/tmp/SuperUser.apk
chmod 664 /system/tmp/SuperUser.apk
mv /system/tmp/SuperUser.apk /system/app
This will actually permanently "root" out BlueStacks
Code:
chown root:root /system/tmp/su
chown root:root /system/tmp/supolicy
chown root:root /system/tmp/libsupol.so
chmod 775 /system/tmp/su
chmod 775 /system/tmp/supolicy
chmod 664 /system/tmp/libsupol.so
cp /system/tmp/su /system/xbin/daemonsu
mv /system/tmp/su /system/xbin/
mv /system/tmp/supolicy /system/xbin/
mv /system/tmp/libsupol.so /system/lib/
Busybox installation...not really needed, but I do it!
Code:
chmod 775 /system/tmp/busybox-i686
chown root:root /system/tmp/busybox-i686
cp /system/tmp/busybox-i686 /system/xbin/
mv /system/tmp/busybox-i686 /system/xbin/busybox
init.sh modification to have the su binary listening as a daemon
Code:
awk '/\tdo_init/{print;print "\t\t/system/xbin/daemonsu --auto-daemon &";next}1' /system/etc/init.sh > /system/etc/init.sh.tmp
mv /system/etc/init.sh /system/etc/init.sh.bs
mv /system/etc/init.sh.tmp /system/etc/init.sh
chown system:system /system/etc/init.sh
chmod 664 /system/etc/init.sh
Let's now "Debloat" our system. This is not necessary, but I do it!
Code:
ls /system/app/
rm /system/app/BasicSmsReceiver.apk
rm /system/app/Calculator.apk
rm /system/app/Calendar.apk
rm /system/app/Camera2.apk
rm /system/app/DeskClock.apk
rm /system/app/DocumentsUI.apk
rm /system/app/DownloadProviderUi.apk
rm /system/app/Gallery.apk
rm /system/app/LiveWallpapersPicker.apk
rm /system/app/Music.apk
rm /system/app/NotePad.apk
rm /system/app/PicoTts.apk
rm /system/app/PrintSpooler.apk
rm /system/app/QuickSearchBox.apk
rm /system/app/SoundRecorder.apk
rm /system/app/TelephonyProvider.apk
rm /system/app/com.google.android.apps.uploader.apk
rm /system/app/com.google.android.syncadapters.calendar.apk
rm /system/app/com.google.android.syncadapters.contacts.apk
ls /system/priv-app/
rm /system/priv-app/BackupRestoreConfirmation.apk
rm /system/priv-app/CalendarProvider.apk
rm /system/priv-app/Contacts.apk
rm /system/priv-app/ContactsProvider.apk
rm /system/priv-app/Dialer.apk
rm /system/priv-app/MusicFX.apk
rm /system/priv-app/OneTimeInitializer.apk
rm /system/priv-app/SharedStorageBackup.apk
rm /system/priv-app/TeleService.apk
rm /system/priv-app/WallpaperCropper.apk
Now let's clean up our mess (not really a mess, is it?) and remount "system" as read-only
Code:
rm /system/tmp/*
rmdir /system/tmp
mount -o remount,ro /dev/sda1 /system
Some more "Debloating" in process
Code:
mount -t ext4 /dev/block/sdd1 /mnt/prebundledapps
ls /mnt/prebundledapps/downloads/
rm /mnt/prebundledapps/downloads/AppGuidance.apk
rm /mnt/prebundledapps/downloads/AppSettings.apk
rm /mnt/prebundledapps/downloads/BstFakeGps.apk
rm /mnt/prebundledapps/downloads/MyBluestacks.apk
rm /mnt/prebundledapps/downloads/S2P.apk
rm /mnt/prebundledapps/downloads/WindowsFileManager.apk
rm /mnt/prebundledapps/downloads/bluestacksHome.apk
rm /mnt/prebundledapps/downloads/bluestacksServices.apk
rm /mnt/prebundledapps/downloads/newAppFinder.apk
rm /mnt/prebundledapps/downloads/setupWizard.apk
ls /mnt/prebundledapps/app/
rm /mnt/prebundledapps/app/com.google.android.apps.photos-1.apk
ls /mnt/prebundledapps/system-app
rm /mnt/prebundledapps/system-app/com.google.android.apps.uploader.apk
rm /mnt/prebundledapps/system-app/com.google.android.syncadapters.calendar.apk
rm /mnt/prebundledapps/system-app/com.google.android.syncadapters.contacts.apk
ls /mnt/prebundledapps/system-priv-app
umount /mnt/prebundledapps
ls /data/app/
rm /data/app/com.google.android.apps.photos-1.apk
Man, we should be done now. Let's clear the Dalvik-cache!
Code:
find /data/dalvik-cache/ -type f -exec rm {} +
exit
exit
And we're DONE!!!
8) Let's now restart BlueStacks...and see what happend!
From your cmd.exe
Code:
sc stop BstHdAndroidSvc
#### wait some seconds (10?)
sc start BstHdAndroidSvc
Now, I usually go modify the Oem.cfg file (admin privileges are needed to do so).
Why? Becase I don't EVER start BlueStacks using "GameManager", but merely the "classic" FrontEnd.
So, open the file and search for:
Code:
<IsFrontendBorderHidden>true</IsFrontendBorderHidden>
Change it to
Code:
<IsFrontendBorderHidden>false</IsFrontendBorderHidden>
This will bring back the "classic" windows' decoration to the Frontend!
And here is how I ALWAYS start my BlueStacks:
Code:
"C:\Program Files (x86)\BlueStacks\HD-Frontend.exe" Android
If you want to use GameManager, you should probably skip the last couple of tasks...
Keep in mind that I won't give any support if you decide to do so (cause I NEVER tested it)
WoW.....scary, isn't it? Nothing appears on your BlueStacks window but a black background and a tiny "#" notification on top.
You should also get a request for your "Position"....I usually decline that...
Well, nothing to fear about. It's just our "almost completely debloated" BlueStacks running.
If this is the case....YES...YOU DID IT!
Just click the "#" notification.
You will be prompted about a SuperSU update. Choose the "normal" way and after the update, restart your BlueStacks.
Code:
"C:\Program Files (x86)\BlueStacks\HD-Quit.exe"
"C:\Program Files (x86)\BlueStacks\HD-Frontend.exe" Android
The notification should be gone now!
Your BlueStacks is now Rooted&Debloated.
9) BlueStacks like this, is not really usable...so we need to do something more.
Remember when I told you to gather your preffered APKs somewhere...well, this is the reason.
It's time to install these now.
From a cmd.exe window
Code:
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" kill-server
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" start-server
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" wait-for-device
Now we can use "push" and "shell pm"
Code:
### Apex Launcher 3.1.0 (PlayStore)
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" push apk\com.anddoes.launcher-3.1.0-3101-minAPI15.apk /sdcard/Download
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" shell pm install /sdcard/Download/com.anddoes.launcher-3.1.0-3101-minAPI15.apk
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" shell rm /sdcard/Download/com.anddoes.launcher-3.1.0-3101-minAPI15.apk
Here is an example to install ApexLauncher!
Do the same with all of your APKs and you're done.
You could probably Drag the APS directly on BlueStacks' window...
Here is what I usually install
ApexLauncher
Fx (RootExplorer!)
Full!Screen
ConnectBot (terminal emulator and ssh client)
As always, please, report back any mistake you spot....
...and any suggestion you may have about all this how-to!
Hope you enjoyed this how-to and I hope you will enjoy your newly rooted BlueStacks.
Thanks for the tutorial.
Could you describe how to install xposed as well?
Edit: I forgot that I can just use the installer :silly:
Hey guys, I'm sorry, I know that this is an old thread that was started back in June of 2016, so if I am posting this question in the wrong place or if there's a newer, more relevant thread please point me in the right direction. I found this topic by doing a web search.
As I was following the steps in this topic everything worked as expected until I reached step 7. The first part you have to mount the system as read/write and then create a temp directory to store everything in. I did that in adb shell but then you go back to command window to push some things to your new temp directory and each thing I tried to push, the command window did not give me an error but each time it spits out a long list of instructions/ commands to use in ADB.
Will someone please assist me? Thank you for your help
TRexombo said:
Hey guys, I'm sorry, I know that this is an old thread that was started back in June of 2016, so if I am posting this question in the wrong place or if there's a newer, more relevant thread please point me in the right direction. I found this topic by doing a web search.
As I was following the steps in this topic everything worked as expected until I reached step 7. The first part you have to mount the system as read/write and then create a temp directory to store everything in. I did that in adb shell but then you go back to command window to push some things to your new temp directory and each thing I tried to push, the command window did not give me an error but each time it spits out a long list of instructions/ commands to use in ADB.
Will someone please assist me? Thank you for your help
Click to expand...
Click to collapse
If it is just returning the usage of ADB like you said, it really sounds like a typo in the command being ran. Either the filename or directory is slightly off.
IDK for sure based on your post. But when ADB does that to me, it is 9.5 times out of 10, because of a character out of place in the command.
Hope that helps.
TRexombo said:
Hey guys, I'm sorry, I know that this is an old thread that was started back in June of 2016, so if I am posting this question in the wrong place or if there's a newer, more relevant thread please point me in the right direction. I found this topic by doing a web search.
As I was following the steps in this topic everything worked as expected until I reached step 7. The first part you have to mount the system as read/write and then create a temp directory to store everything in. I did that in adb shell but then you go back to command window to push some things to your new temp directory and each thing I tried to push, the command window did not give me an error but each time it spits out a long list of instructions/ commands to use in ADB.
Will someone please assist me? Thank you for your help
Click to expand...
Click to collapse
After having the same issue (and reading your post), I thought I'd throw you a bone... when you see the author using the term path_to/SuperSU/2.65/..., he is implying that the user input the "path to" the directory you have your files. In other words, if you created the SuperSU directory on the root of your C: Drive, then you would substitute path_to with C:/.
So,
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" push path_to/SuperSU/2.65/x86/su /system/tmp
should really be entered as
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" push C:/SuperSU/2.65/x86/su /system/tmp
:victory:
For those not familiar with Linux (or Windows, for that matter), it is all too easy to assume that path_to is a special command. :laugh:
How do i make this tool by: Ryuinferno Windows Sign Em v2-0
[TOOL][WINDOWS]Sign-em! v2.0 ->Batch sign zip files | No signature verification error
[TOOL][WINDOWS]Sign-em! v2.0 ->Batch sign zip files | No signature verification error Sign-em! v2.0 Hi all! As we know, making zip files is a must no matter when we want to flash a new ROM, theme, mods and so on...but at times we need to sign...
forum.xda-developers.com
Work with the new apksigner.jar file which on windows has to be used through the apksigner bat file?
The batch script in the tool from Ryuinferno is this:
@Echo off
COLOR 70
title "Sign-em! 2.0"
ECHO.
ECHO Sign-em! v2.0 by Ryuinferno @ XDA 2013
ECHO.
ECHO This script signs multiple zip files automatically...
ECHO.
ECHO **REMINDER!!! Do not leave spaces when you name your zip files...**
ECHO.
FOR %%A in (.\Input\*.zip) do (
ECHO Signing - %%~nA.zip
java -jar .\Tools\signapk.jar -w .\Tools\testkey.x509.pem .\Tools\testkey.pk8 %%A .\Output\%%~nA-signed.zip
)
FOR %%A in (.\Output\*.zip) do (
ECHO Calculating md5 checksum
.\Tools\md5sums.exe -u %%A >> ./Output/md5.txt
)
ECHO.
ECHO Files signed successfully if no errors above...
ECHO.
ECHO Hope you enjoyed my work...
ECHO Ryuinferno @ XDA 2013
ECHO.
pause
peter1miller2 said:
How do i make this tool by: Ryuinferno Windows Sign Em v2-0
[TOOL][WINDOWS]Sign-em! v2.0 ->Batch sign zip files | No signature verification error
[TOOL][WINDOWS]Sign-em! v2.0 ->Batch sign zip files | No signature verification error Sign-em! v2.0 Hi all! As we know, making zip files is a must no matter when we want to flash a new ROM, theme, mods and so on...but at times we need to sign...
forum.xda-developers.com
Work with the new apksigner.jar file which on windows has to be used through the apksigner bat file?
Click to expand...
Click to collapse
To execute a .JAR-file on Windows, you need to install Java on your system. Go to Java Download Page and install it.
I am not asking how to execute a JAR file. I am asking how to make the Apk Signer sign all files in a folder like this tool does with the older zip signer.
If you do not have OpenSSL installed on Windows machine, download and install it. You need OpenSSL to create a private key and a corresponding public key, which act as your digital signature.
On elevated Windows command prompt enter the following commands to generate a new private key and a corresponding public key for yourself:
Code:
openssl genrsa -out key.pem 1024
openssl req -new -key key.pem -out request.pem
openssl x509 -req -days 9999 -in request.pem -signkey key.pem -out certificate.pem
openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8 -nocrypt
In Windows you create a folder named ZipSignerTool with 4 subfolders named InFiles & OutFiles & Tools & Keys.
In subfolder InFiles you place all the .ZIP-files what should get signed.
In subfolder Tools you place the Java executable named signapk.jar.
In subfolder Keys you place the 2 files you generated by means of OpenSSL as shown above.
You create a Windows batch-file in folder ZipSignerTool named ZipSigner.bat ( or whatever ) that does the job:
Code:
@echo off & setlocal
pushd "%~dp0"
set "InFiles=%CD%\Infiles"
set "OutFiles=%CD%\OutFiles"
set "Signer=%CD%\Tools\signapk.jar"
set "Keys=%CD%\Keys"
for /F %%a in ('dir %InFiles%\*.zip /B') do (
set "ZIP=%%a"
if NOT "?%ZIP%"=="?" (
java -jar %Signer% %Keys%\certificate.pem %Keys%\key.pk8 %ZIP% %OutFiles%\signed-%ZIP%
)
)
popd
endlocal & @echo on & exit
jwoegerbauer said:
If you do not have OpenSSL installed on Windows machine, download and install it. You need OpenSSL to create a private key and a corresponding public key, which act as your digital signature.
On elevated Windows command prompt enter the following commands to generate a new private key and a corresponding public key for yourself:
Code:
openssl genrsa -out key.pem 1024
openssl req -new -key key.pem -out request.pem
openssl x509 -req -days 9999 -in request.pem -signkey key.pem -out certificate.pem
openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8 -nocrypt
In Windows you create a folder named ZipSignerTool with 4 subfolders named InFiles & OutFiles & Tools & Keys.
In subfolder InFiles you place all the .ZIP-files what should get signed.
In subfolder Tools you place the Java executable named signapk.jar.
In subfolder Keys you place the 2 files you generated by means of OpenSSL as shown above.
You create a Windows batch-file in folder ZipSignerTool named ZipSigner.bat ( or whatever ) that does the job:
Code:
@echo off & setlocal
pushd "%~dp0"
set "InFiles=%CD%\Infiles"
set "OutFiles=%CD%\OutFiles"
set "Signer=%CD%\Tools\signapk.jar"
set "Keys=%CD%\Keys"
for /F %%a in ('dir %InFiles%\*.zip /B') do (
set "ZIP=%%a"
if NOT "?%ZIP%"=="?" (
java -jar %Signer% %Keys%\certificate.pem %Keys%\key.pk8 %ZIP% %OutFiles%\signed-%ZIP%
)
)
popd
endlocal & @echo on & exit
Click to expand...
Click to collapse
Thank you very much for your answer. I am sure it would work. Thought since i completely failed to explain the real problem i have. it is currently not working for me. I hope i explained the problem better in my new post here: https://forum.xda-developers.com/t/how-can-i-batch-sign-zip-files-on-windows.4361871/ and thank you again wery much for the answer.
I asked this previously.
But i did not specify the problem correctly When i unpack the:
build-tools_r30.0.1-windows.zip to the C drive i get this:
C:\android-11\
If i try to use the ApkSigner.JAR in the:
C:\android-11\lib\
Folder Directly through those two commands:
cd C:\Program Files\AdoptOpenJDK\jre-16.0.1.9-hotspot\bin\
Followed by:
java.exe C:\android-11\lib\apksigner.jar sign --key C:\keys\mykey.pk8 --cert C:\certificates\mycert.pem --min-sdk-version 20 C:\files\MyZipFile.zip
I get this:
Error: Could not find or load main class C:\android-11\lib\apksigner.jar
Caused by: java.lang.ClassNotFoundException: C:\android-11\lib\apksigner.jar
If i use the ApkSigner.JAR INDIRECTLY Through the ApkSigner.BAT File in the:
C:\android-11\
Folder Through those two commands:
cd C:\android-11\
Followed by:
apksigner.bat sign --key C:\keys\mykey.pk8 --cert C:\certificates\mycert.pem --min-sdk-version 20 C:\files\MyZipFile.zip
Than it works But the apksigner.BAT File does not work with the batch signer i mentioned in this post: https://forum.xda-developers.com/t/how-to-batch-sign-zip-files.4258547/
Which is why Batch signing is not working for me with the current apksigner.JAR File.
Since because of this
Error:
Could not find or load main class C:\android-11\lib\apksigner.jar
Caused by: java.lang.ClassNotFoundException: C:\android-11\lib\apksigner.jar
I cannot use it directly.
The script from the apksigner.BAT File is this:
@Echo off
REM Copyright (C) 2016 The Android Open Source Project
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM don't modify the caller's environment
setlocal
REM Locate apksigner.jar in the directory where apksigner.bat was found and start it.
REM Set up prog to be the path of this script, including following symlinks,
REM and set up progdir to be the fully-qualified pathname of its directory.
set prog=%~f0
@Rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
exit /b 1
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
exit /b 1
:init
set jarfile=apksigner.jar
set "frameworkdir=%~dp0"
rem frameworkdir must not end with a dir sep.
set "frameworkdir=%frameworkdir:~0,-1%"
if exist "%frameworkdir%\%jarfile%" goto JarFileOk
set "frameworkdir=%~dp0lib"
if exist "%frameworkdir%\%jarfile%" goto JarFileOk
set "frameworkdir=%~dp0..\framework"
:JarFileOk
set "jarpath=%frameworkdir%\%jarfile%"
set javaOpts=
set args=
REM By default, give apksigner a max heap size of 1 gig and a stack size of 1meg.
rem This can be overridden by using "-JXmx..." and "-JXss..." options below.
set defaultXmx=-Xmx1024M
set defaultXss=-Xss1m
REM Capture all arguments that are not -J options.
REM Note that when reading the input arguments with %1, the cmd.exe
REM automagically converts --name=value arguments into 2 arguments "--name"
REM followed by "value". apksigner has been changed to know how to deal with that.
set params=
:firstArg
if [%1]==[] goto endArgs
set "a=%~1"
if [%defaultXmx%]==[] goto notXmx
if "%a:~0,5%" NEQ "-JXmx" goto notXmx
set defaultXmx=
:notXmx
if [%defaultXss%]==[] goto notXss
if "%a:~0,5%" NEQ "-JXss" goto notXss
set defaultXss=
:notXss
if "%a:~0,2%" NEQ "-J" goto notJ
set javaOpts=%javaOpts% -%a:~2%
shift /1
goto firstArg
:notJ
set params=%params% %1
shift /1
goto firstArg
:endArgs
set javaOpts=%javaOpts% %defaultXmx% %defaultXss%
call "%java_exe%" %javaOpts% -jar "%jarpath%" %params%
The script From the SignEm v2.0 Tool: From this Post:
https://forum.xda-developers.com/t/...iles-no-signature-verification-error.1966007/
By @Ryuinferno is this
@Ryuinferno said:
@Echo off
COLOR 70
title "Sign-em! 2.0"
ECHO.
ECHO Sign-em! v2.0 by Ryuinferno @ XDA 2013
ECHO.
ECHO This script signs multiple zip files automatically...
ECHO.
ECHO **REMINDER!!! Do not leave spaces when you name your zip files...**
ECHO.
FOR %%A in (.\Input\*.zip) do (
ECHO Signing - %%~nA.zip
java -jar .\Tools\signapk.jar -w .\Tools\testkey.x509.pem .\Tools\testkey.pk8 %%A .\Output\%%~nA-signed.zip
)
FOR %%A in (.\Output\*.zip) do (
ECHO Calculating md5 checksum
.\Tools\md5sums.exe -u %%A >> ./Output/md5.txt
)
ECHO.
ECHO Files signed successfully if no errors above...
ECHO.
ECHO Hope you enjoyed my work...
ECHO Ryuinferno @ XDA 2013
ECHO.
pause
Click to expand...
Click to collapse
And the Script created by: @jwoegerbauer As this answer:
https://forum.xda-developers.com/t/how-to-batch-sign-zip-files.4258547/post-84798393
To my earlier post is here:
@jwoegerbauer said:
@Echo off & setlocal
pushd "%~dp0"
set "InFiles=%CD%\Infiles"
set "OutFiles=%CD%\OutFiles"
set "Signer=%CD%\Tools\signapk.jar"
set "Keys=%CD%\Keys"
for /F %%a in ('dir %InFiles%\*.zip /B') do (
set "ZIP=%%a"
if NOT "?%ZIP%"=="?" (
java -jar %Signer% %Keys%\certificate.pem %Keys%\key.pk8 %ZIP% %OutFiles%\signed-%ZIP%
)
)
popd
endlocal & @ECHO on & exit
Click to expand...
Click to collapse
And I wery much Hope someone can help me with this problem.
Are you sure that apksigner.jar is in the folder of 'C:\android-11\lib'?
James_Watson said:
Are you sure that apksigner.jar is in the folder of 'C:\android-11\lib'?
Click to expand...
Click to collapse
Yes i am sure about that.
I am trying to create windows batch script to check the size of file after it is downloaded but it fails with this message. The Process cannot access the file as it is used by another process 2048 was unexpected at this time. Thanks in advance for any help.
Code -
@Echo off
d:\wget.exe ...
Rem this wget process downloads tst_file.xml
set file="tst_file.xml"
set maxbytesize=2048
for /F "usebackq" %%A IN ('%file%') DO set size=%%~zA
if %size% LSS %maxbytesize% (echo file is less than 2KB)
If download gets interrupted for whatever reason then file isn't get properly closed by WGET.
BTW:
1. Location of downloaded file isn't correctly determined: file's path is missing.
2. Use FORFILES to determine file size
Code:
rem List the size of downloaded file:
for /F "tokens=*" %%a in ('FORFILES /M %downloaded_file% /C "cmd /c echo @fsize"') do ( set /A downloaded_bytes=%%a )