[Q] Help using Android command line dev tools - General Questions and Answers

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.

Related

[Q] Signing in debug mode

I'm trying to use command line tools to develop an Android app. I'm calling aapt as follows:
"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
I assume that, because I've specified --debug-mode, aapt will attach a debug certificate, making my app runnable on an emulator. But I keep getting the message
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
How can I diagnose the problem?

[APP][DEV][GUIDE] Using the Android Java Internal/Hidden API classes

Using Java Reflection with Eclipse ADT to Access Internal/Hidden API classes.
Purpose
We present a way to access all the Internal and Hidden Java packages/classes
in the AOS. To do this we need to both repackage the Android.jar and hack the
Eclipse ADT plugin, to allow using these internal packages.
Posting
==================================================
Do NOT post general questions/requests on how to
do this or that, they will not be answered here.
DO post if you have additional tricks, hacks or
information that can help/benefit this tutorial.
==================================================
Background
There are two reasons one cannot use internal packages. One reason is that, if
you're using Eclipse as your development platform, those packages are
internally blocked in the Eclipse ADT plugin. Second reason is that the normal
development android.jar runtime does not contain those *.class files that
belong to the internal packages.
"There is no easy way to use com.android.internal package (internal API) or
anything marked with @hide attribute (hidden API) without using reflection.
That’s because android.jar file does not contain classes from internal and
hidden API and because of this nobody can reference those classes in compile
time."
Thus we need to first restore the "original" android.jar which will allow us
to use internal and hidden APIs. But the runtime equivalent of Android SDK’s
android.jar file is framework.jar. This file is located in the
/system/framework/ directory of your device. We will extract and use this for
our pleasure.
The general procedure:
A) Grab the "full" framwork.jar from your device
B) extract the class files
C) add them to "full" android.jar ??
D) Hack the Eclipse ADT plugin jar.
Finally, NOTHING would have been possible without the excellent step-by-step
instructions on the devmaze-blog by senior Android developer Ievgenii Nazaruk
(aka. "inazaruk"). THANK YOU Ievgenii!​References
http://stackoverflow.com/questions/...d-sdk-with-hidden-and-internal-apis-available
http://stackoverflow.com/questions/...-state-permission-for-apps-ran-on-gingerbread
http://code.google.com/p/smali/wiki/DeodexInstructions
http://code.google.com/p/adt-addons/
​
The General Procedure
NOTE: All this was performed on Windows Vista with Cygwin.(1) Grab BOOTCLASSPATH from init.rc
Find the line in your init.rc file that reads something like:
Code:
[SIZE=2]export BOOTCLASSPATH /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar[/SIZE]
Extract and reformat the path to:
Code:
[SIZE=2]core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar[/SIZE]
(2) Grab the "framework" from your device
Create a working directory somewhere, let's call it "_framework":
Code:
[SIZE=2]mkdir ./_framework[/SIZE]
[SIZE=2]cd _framework[/SIZE]
Grab all the framework files from your device:
Code:
[SIZE=2]adb pull /system/framework .[/SIZE]
Rename directory if needed.
NOTE-1: From now on I'll assume you know where you are!
NOTE-2: Most GB 2.3.4+ devices uses .odex'ed files,
with name pairs like: <package>.jar and <package>.odex.
These need to be converted.
(3) Use baksmali with (1)
You can also use baksmali with the switch: -d <framwork-dir>.
The general command is something like below, but in windows there may be "wrappers"
that allow you to just type "baksmali" without the "java -jar" prefix and without
the ".jar" post fix. Anyway here is the command I used:
Code:
[SIZE=2]java -Xmx1024m -jar ./../../baksmali.jar -a 10 -c :core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar -x framework.odex[/SIZE]
==> This results in all files put in the "out" sub-directory.
This directory contain 3 sub-directories (for GB 2.3.4):
Code:
[I]android [/I](Hidden APIs)
[I]com [/I](Internal APIs)
[I]javax [/I](Hidden APIs)
NOTE: If you are using Google's own API's, you will probably also need to add
those packages to the path above. (Eg. Email.jar, etc etc ?)
(4) Then use smali to create a dex file from "out" directory
Code:
java -jar smali.jar out
==> creates out.dex from "out" directory.
(5) Run dex2jar on out.dex
Code:
[SIZE=2]./dex2jar.bat out.dex[/SIZE]
==> creates out_dex2jar.jar
(This .jar contain close to 4900 files at 12 MB!)
(6) Rename "out_dex2jar.jar" to "framework-classes.zip"
Code:
[SIZE=2]mv out_dex2jar.jar framework-classes.zip
unzip framework-classes.zip[/SIZE]
(7) Find and copy your Android SDK's android.jar file
Go to: /path/to/android-sdk-windows/platforms/android-X/android.jar
where X is the API level of interest. This obviously have to match the
API level of the files you extracted from your device in: /system/framework .
This .jar file contain more than 5300 files when expanded, but missing all
the internal packages. Our job is to add them back in.
Let's first make a copy that we can use to expand and add files from (6):
Code:
cp android.jar custom-android.zip
unzip custom-android.zip
(8) Add all *.class files from (6) in to (7)
Copy and replace all existing *.class files from framework-classes.zip into
custom-android.zip:
Code:
[SIZE=2]cp -R /path/to/framework-classes/* /path/to/custom-android/.[/SIZE]
The root content of that directory should then look something like this:
Code:
[SIZE=2]android[/SIZE]
[SIZE=2]assets[/SIZE]
[SIZE=2]com[/SIZE]
[SIZE=2]dalvik[/SIZE]
[SIZE=2]java[/SIZE]
[SIZE=2]javax[/SIZE]
[SIZE=2]junit[/SIZE]
[SIZE=2]META-INF[/SIZE]
[SIZE=2]org[/SIZE]
[SIZE=2]res[/SIZE]
[SIZE=2]AndroidManifest.xml[/SIZE]
[SIZE=2]resources.arsc[/SIZE]
(9) Rename directory and create your new "classy-android.jar"
We rename it so not confuse with the original:
Code:
mv custom-android classy-android
zip classy-android
mv classy-android.zip classy-android.jar
IMPORTANT:
Make absolutely sure that the folder structure of your zip archive
is exactly the same as what you intended. To check, unzip the file
and see if it is what you (and eventually Eclipse) would expect.
(For example, if you use 7zip to zip a directory file called "test",
into "test.zip", you may end-up extracting it to ./test/test/... )
(10) Enabling & Restricting Access to classy-android.jar
Instead of just replacing the android.jar with classy-android.jar, we choose
to create a customized Android platform. This way you can enable the Internal
and Hidden API's for those projects requiring them, while other standard
projects doesn't have access to those.
(a) Go to: /path/to/android-sdk-windows/platforms/
and copy the relevant directory (for example):
Code:
cp -R android-10 android-10-internals
(b) Replace android.jar with your classy-android.jar:
Code:
cp classy-android.jar android.jar
("cp" overwrites!)
(c) Edit the build.prop file:
Edit/replace the following lines:
Code:
[SIZE=2]ro.build.version.sdk=10 ==> ro.build.version.sdk=[COLOR=Black][B]-10[/B][/COLOR][/SIZE]
[SIZE=2]ro.build.version.release=2.3.3 ==> ro.build.version.release=2.3.internal[/SIZE]
(11) Customizing the Eclipse ADT
In order to be able to use com.android.internal packages in the Eclipse ADT,
you have to disable the internal protection mechanism of the plugin, that
prevent you to use these libraries. You can see this by right-clicking on your
project package and navigate to:
Code:
[SIZE=2]==> Properties ==> Java Build Path ==> Libraries (tab) [/SIZE]
[SIZE=2]--> Android 2.x.x --> android.jar [/SIZE]
[SIZE=2]--> "Access rules: 1 rule defined": [B][COLOR=Red](X)[/COLOR][/B] [B]Forbidden: com/android/internal/**[/B][/SIZE]
This can not be removed (bug?), even though the interface allows changing, it
never persists after closing the Properties window. So we have to hack it!
The way to do it, is to hexedit the correct java class file and change the
name from "internal" to "internax". First let's find the correct file. The
plugin file is located in the ./eclipse/plugins/ directory, and its name is
something like:
Code:
com.android.ide.eclipse.adt_18.0.0.v201203301601-306762.jar
(a) make a backup copy of this (with the exact name preserved) in another directory.
(b) make a another copy of this in another directory.
(c) unzip (b) in that directory
Code:
[SIZE=2]cp com.android.ide.eclipse.adt_18.0.0.v201203301601-306762.jar hacked_adt.zip[/SIZE]
[SIZE=2]unzip hacked_adt.zip[/SIZE]
[SIZE=2]cd hacked_adt[/SIZE]
This is a huge directory system, so forget poking around in it,
just go to the correct sub-directory:
Code:
[SIZE=2]cd ./com/android/ide/eclipse/adt/internal/project/[/SIZE]
Then find the correct file and the approximate string location within that file:
Code:
[SIZE=2]strings.exe -f -4 -t x ./*.class |grep "android\/internal"[/SIZE]
It happens to be in "AndroidClasspathContainerInitializer.class". Now, use a
hexeditor to find and change the string "com/android/internal/**"
to "com/android/internax/**". That will do it!
Now zip-up your hacked jar directory and copy it over the old one.
(Remember that "cp" overwrites without warning!)
Code:
[SIZE=2]zip hacked_adt[/SIZE]
[SIZE=2]cp hacked_adt.zip /path/to/eclipse/plugins/com.android.ide.eclipse.adt_18.0.0.v201203301601-306762.jar[/SIZE]
You Are Done!
Enjoy your newly hacked Eclipse! ​Errors
If you get any errors;
1. make sure you have zipped up everything properly as warned before.
2. make sure you have included Google API packages in your BOOTCLASSPATH in step (3).
3. Try to "clean-up" the Java by: "Right-Click" ==> Source ==> "Clean Up...".
4. Google them
5. Ignore them
6. Give up. Not! But I can't help you!
If it still doesn't work, try to download inazaruk's pre-compiled set of internal android.jar's from here.
(For android 7,8,10,15.)
​
WIP! <here be dragons2>
For a project using internal package imports, see my thread:
"[TOOL][APP][WIP] Native AT Command Injector"
<here be more dragons>
Following the instructions in posts 1-2 above, may not always work. It is not known to me at this time, why it shouldn't. One theory is that it can have something to do with how Eclipse and Android.jar is packaging their files and the resulting sizes.
This was mentioned in this Stackoverflow post:
"Jar files: why does extracting then compression a jar file create a file of a different size to the original?"
Then reading the man pages for "jar" we can inform ourselves with:
Code:
[SIZE=2] c Creates a new archive file named jarfile (if f is specified) or to
standard output (if f and jarfile are omitted). Add to it the
files and directories specified by inputfiles.
u Updates an existing file jarfile (when f is specified) by adding
to it files and directories specified by inputfiles.
x Extracts files and directories from jarfile (if f is specified) or
standard input (if f and jarfile are omitted). If inputfiles is
specified, only those specified files and directories are
extracted. Otherwise, all files and directories are extracted.
t Lists the table of contents from jarfile (if f is specified) or
standard input (if f and jarfile are omitted). If inputfiles is
specified, only those specified files and directories are listed.
Otherwise, all files and directories are listed.
i Generate index information for the specified jarfile and its
dependent jar files.
[/SIZE]
More info is provided here:
The JAR Overview @
http://java.sun.com/javase/6/docs/technotes/guides/jar/jarGuide.html
The JAR File Specification @
http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html
The JARIndex Spec @
http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html
JAR Tutorial @
http://java.sun.com/docs/books/tutorial/jar/
pack200 Reference Page @
http://java.sun.com/javase/6/docs/technotes/tools/share/pack200.html
Another theory is that it may have something to do with what seem to be, that Google have revoked the the use of MODIFY_PHONE_STATE since Android 2.3, and that this influences the Eclipse behavior, when using and modifying older android.jar's. This was mentioned here and here.
Any help would be very much appreciated!
< bump >
Hi, thanks for the info, I made it using linux and worked really nice, these were the lines that I used, hope be useful.
This is my Android folder at home
Code:
Android/
├── eclipse
├── ndk
├── platforms-internals
├── sdk
└── tools
Start an avd running the desired API to modify in this case API-17
Code:
$ emulator -avd avd_api_17 -no-window &
Get the framework
Code:
$ cd ~/Android/
$ mkdir _framework
$ cd _framework
$ adb -s emulator-5554 pull /system/framework .
Grab BOOTCLASSPATH
Code:
$ adb -s emulator-5554 shell cat init.rc | grep BOOTCLASSPATH > bootclasspath
I didn't have the tools used in this tutorial, so I included the steps for getting them
Decompile with baskmali
Code:
$ cd ~/Android/tools
$ wget https://smali.googlecode.com/files/baksmali-1.4.2.jar
$ cd ~/Android/_framework
$ java -Xmx1024m -jar ../tools/baksmali-1.4.2.jar -a 17 -c core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:telephony-common.jar:mms-common.jar:android.policy.jar:services.jar:apache-xml.jar -x framework.odex
The parameter -a for baksmali refers to the API we are working with.
Generate out.dex with smali
Code:
$ cd ~/Android/tools
$ wget https://smali.googlecode.com/files/smali-1.4.2.jar
$ cd ~/Android/_framework
$ java -jar ../tools/smali-1.4.2.jar out
Get internal and hidden classes using dex2jar
Code:
$ cd ~/Android
$ wget https://dex2jar.googlecode.com/files/dex2jar-0.0.9.15.zip
$ unzip dex2jar-0.0.9.15.zip
$ rm dex2jar-0.0.9.15.zip
$ cd _framework/
$ ../tools/dex2jar-0.0.9.15/d2j-dex2jar.sh out.dex
$ unzip out-dex2jar.jar -d framework-classes
Add these classes to plataform's default android.jar
Code:
$ cd ~/Android
$ unzip sdk/platforms/android-17/android.jar -d custom-android
$ cp -r _framework/framework-classes/* custom-android/
$ rm -r _framework
$ cd custom-android
$ zip -r ../custom-android.jar *
$ cd ..
$ rm -r custom-android
Create new extended platform
Code:
$ cd ~/Android
$ cp -r sdk/platforms/android-17 platforms-internals/android-17-internals
$ mv custom-android.jar platforms-internals/android-17-internals/android.jar
$ vi platforms-internals/android-17-internals/build.prop
ro.build.version.release=4.2.2
ro.build.version.release=4.2.2.internal
$ ln -s ~/Android/platforms-internals/android-17-internals ~/Android/sdk/platforms/android-17-internals
I use a symlink for keep it a little organized
Hack ADT
Code:
$ cd ~/Android
$ unzip eclipse/plugins/com.android.ide.eclipse.adt_22.0.4.v201307151829--741630.jar -d hacked_adt
Go to right folder
Code:
$ cd hacked_adt/com/android/ide/eclipse/adt/internal/project/
Find file where is our desired string
Code:
$ strings -f -a -t x * | grep "android\/internal"
Edit with an hex editor
Code:
$ bless AndroidClasspathContainerInitializer.class &
Here we change the l for the x.
Replace original file making a backup
Code:
$ cd ~/Android
$ cp eclipse/plugins/com.android.ide.eclipse.adt_22.0.4.v201307151829--741630.jar eclipse/plugins/com.android.ide.eclipse.adt_22.0.4.v201307151829--741630.jar.original
$ cd hacked_adt/
$ zip -r ../eclipse/plugins/com.android.ide.eclipse.adt_22.0.4.v201307151829--741630.jar *
$ cd ..
$ rm -r hacked_adt
This worked for me... thanks E:V:A
I got just one error related to a dropbox class, but i think this is not important... hope that
lenieto3 said:
...Start an avd running the desired API to modify in this case API-17... This worked for me... I got just one error related to a dropbox class, but i think this is not important...
Click to expand...
Click to collapse
Thanks and sorry for late reply. I'm very happy to hear these instructions still works with API-17! Could you also upload your hacked JAR somewhere so that people can save some time when experimenting?
I was just here to check-in and try to bump this thread to see if it is still useful to anyone.
E:V:A said:
Thanks and sorry for late reply. I'm very happy to hear these instructions still works with API-17! Could you also upload your hacked JAR somewhere so that people can save some time when experimenting?
I was just here to check-in and try to bump this thread to see if it is still useful to anyone.
Click to expand...
Click to collapse
ive got access to ActivityManager's hidden methods.
I want to use the removeTask method, but it keeps saying that I dont have the REMOVE_TASKS permissions even though I added it to the manifest (and turned off lint).
Permission Denial: removeTask() from pid=9963, uid=10179 requires android.permission.REMOVE_TASKS
Does someone know if there are any automated tools to do/performs steps 1-9?
I'd like to see a tool to automatically pull (from phone), extract and create a compatible android.jar.
@Mohammad_Adib: Sorry, this is the wrong thread for those type of questions.
see this link stackoverflow.com|questions|30656933|android-system-framework-jar-files

[UBUNTU][DEBIAN]Common Commands used in Linux

Common Commands used in Linux.
Since, Android is based on Linux, there is much possibility that there is a need to use a Linux based OS. For such use, UBUNTU
is favoured, for its easy and more user friendly.
Today, I am going to Post a few commands that are very useful to the newbies to development
I myself am new, and have faced many problems with this, so I am posting a this thread, to help all the noobs/newbies find what they need in a single place
Okay so, lets start with some basic commands, which can be classified as general commands, and each Linux user MUST KNOW ALL OF THEM !!
Code:
sudo
It simply means "Superuser do". It requires password.
Code:
sudo apt-get install APPLICATION_name
This installs the application finding it on the internet, and gives you the suitable output(If the app exists or not).
Code:
sudo apt-get remove APPLICATION_name
It Removes the application
Code:
sudo apt-get update
it updates the repositories
Code:
sudo apt-get upgrade
upgrades your installed application with their latest versions from Ubuntu repositories
Code:
killall APPLICATION_NAME
kills (terminates) an application
Code:
ps -e
displays currently running processes
Code:
kill APPLICATION_PID
kills an application; where APPLICATION_PID.
NOTE: YOU CAN FIND "PID" USING EARLIER CODE.
Code:
wget http://path_to_file.com
downloads a file from the web to current directory
Code:
cd /PATH/TO/DIR
changes current directory to DIR. Use cd to change the current directory into any dir
Code:
cd ..
Like ms-dos, goes up one directory
Code:
dir
OR
Code:
ls
lists directory content
Code:
man COMMAND
Displays manual for command.
eg: man sudo
Code:
cp ORIGINALFILE NEWFILE
Copy a file
Code:
mv SOURCE DESTINATION
Moves a file
NOTE: YOU CAN ALSO RENAME A FILE WITH THIS.
EG: mv old_filename new_filename
Code:
mkdir FOLDERNAME
Make a directory/folder
Miscellaneous: Level 2
Code:
du -sh folder name
This calculates the size of the folder
Code:
ps -aux
This shows all the running processes
Code:
chown -R User:User dir
Change owner of files and directories
Code:
chmod 777 yourScript
This makes a shell script ".sh" extension
Code:
netstat -anltp | grep "LISTEN"
See all open ports on your machine
Code:
sudo apt-get install ufw
sudo ufw allow 80/tcp
sudo ufw allow 22/tcp
sudo ufw allow 443/tcp
sudo ufw allow 21/tcp
sudo ufw enable
Ubuntu provides a uncomplicated firewall (ufw). To install it and only allow SSH, FTP, and webtraffic use the following command.
Network Commands
Code:
ifconfig
Shows the network connections
WILL UPDATE REGULARLY AS MUCH I COULD.
Code:
passwd
Run after installing Linux when you see "[email protected]:~$" to set your root pass word
Code:
adduser
Replace and run to add a new user
Code:
adduser sudo
Replace and run to add that user to sudo
Code:
sudo apt-get purge
Replace and run to purge your system of that package
Code:
apt-cache search
Replace and run to search for new packages to install
Note: "wild cards" eg "*" are acceptable
Code:
find -type f -iname 'some-compressed-file*' -print0 | xargs -0 sudo tar -vxpzf
Replace with at least the "root" directory you want to search through and Replace " some-compressed-file " (leave the single quotes ' ' and the wild card *) and run to find every file under the given directory that has that name and the pipe " | " it out to tar so that'll extract to your current directory
Note: "find" does the finding, the "-type -f" tells find to only look for files, the "-iname" tells find to search parts of file names, the ' ' around "some-compressed-file" keeps the * from doing bad things, the "print0" tells find to "scrub" for spaces and such before outputting a result, the " | " pipes the results of find to xargs, the "-0" is because of "print0" in the find side of the pipe, and "sudo tar - vxpzf" is where tar extracts the findings of find.
Code:
find $HOME -type f -iname '*zip' -print0 | xargs -0 ls
Run to find and list every zip file under the home folder
Say you want to make a file to contain some notes wile in the command line
Code:
sudo cat > $HOME/someNotes.txt <<EOF
# place a command here
echo "hello world, I update aptget"
sudo apt-get update -q
EOF
Try editing the part after $HOME; type it in or write a file that contains the combo of " cat > $HOME/someNotes.txt <<EOF " some text or commands " EOF " and you'll find making custom scripts of varying complexity to be easy.
.......
Hope some of these are also found to be useful for others.
Thanks for starting this here thread.
Hit the link in my signature for more help with Linux for new and seasoned users
Edit 08082013- added another useful tip and reformatted commands to better fit the OP's formatting.
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey
Yo ! Nice Share
To delete contents of a large text file ..
Code:
cat /dev/null > NameOfTheFile
Useful variations of ls command :
Show dir content in a list
Code:
ls -l
Show dir content in a list sorted by modification time (newer first)
Code:
ls -lt
Show dir content in a list sorted by modification time (older first)
Code:
ls -lrt
Show subdirectories recursively
Code:
ls -R
If you want to show files starting with . (hidden file), you can add -a option.
More options with command :
Code:
man ls
Useful variations of grep command :
grep is used to print lines matching a pattern.
Find the entry for current user in file /etc/passwd :
Code:
cat /etc/passwd | grep $USER
Find all the entry except current user entry in file /etc/passwd :
Code:
cat /etc/passwd | grep -v $USER
Find all the numbers in file /etc/passwd :
Code:
cat /etc/passwd|grep '[0-9]*'
Add color to grep command :
Code:
cat /etc/passwd | grep --color $USER
(You can add
Code:
alias grep='grep --color=auto'
in ~/.bashrc to always have colored grep)
Useful variations of tar command :
Create archive_name.tar from dirname :
Code:
tar cvf archive_name.tar dirname/
Create archive_name.tar.gz (compressed) from dirname :
Code:
tar zcvf archive_name.tar.gz dirname/
Extract archive_name.tar.gz :
Code:
tar zxvf archive_name.tar.gz
Useful variations of mkdir command :
Create directory and subdirectories if not existing :
Code:
mkdir -p /tmp/a/b/c
(mkdir /tmp/a/b/c will fail if /tmp/a and /tmp/a/b don't exist)
Useful tip :
Use bash variable "!$" to get the value of the last argument of the last command interpreted.
For example :
Code:
mkdir /tmp/test_a
cd !$ (equivalent cd /tmp/test_a)
or,
Code:
mv /tmp/a /tmp/b
ls !$ (equivalent ls /tmp/b)

[Emulator][How-To] Manually Root and Debloat BlueStacks

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:

[SOLVED] [HELP] Can't install bsdiff4 and use .bin Payload Dumper

Yo hello, i installed a custom rom for my motorola one (deen), and i need to root it again with magisk. But the rom has a .bin file instead of normal boot.img stuff. So i got this Payload dumper, but it doesn't want to work. Everytime i try to install the dependencies it says
C:\Users\nego ney\Downloads\payload_dumper-master\payload_dumper-master>python3 -m pip install -r requirements.txt
Requirement already satisfied: protobuf==3.6.0 in c:\users\nego ney\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from -r requirements.txt (line 1)) (3.6.0)
Requirement already satisfied: six==1.11.0 in c:\users\nego ney\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from -r requirements.txt (line 2)) (1.11.0)
Collecting bsdiff4>=1.1.5
Using cached bsdiff4-1.2.1.tar.gz (11 kB)
Requirement already satisfied: setuptools in c:\program files\windowsapps\pythonsoftwarefoundation.python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\site-packages (from protobuf==3.6.0->-r requirements.txt (line 1)) (56.0.0)
Using legacy 'setup.py install' for bsdiff4, since package 'wheel' is not installed.
Installing collected packages: bsdiff4
Running setup.py install for bsdiff4 ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\nego ney\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\nego ney\\AppData\\Local\\Temp\\pip-install-mp5zoj50\\bsdiff4_b64f4fb7c8d44c99a8989c37191075a4\\setup.py'"'"'; __file__='"'"'C:\\Users\\nego ney\\AppData\\Local\\Temp\\pip-install-mp5zoj50\\bsdiff4_b64f4fb7c8d44c99a8989c37191075a4\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\nego ney\AppData\Local\Temp\pip-record-tk6s6_pk\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\nego ney\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\bsdiff4'
cwd: C:\Users\nego ney\AppData\Local\Temp\pip-install-mp5zoj50\bsdiff4_b64f4fb7c8d44c99a8989c37191075a4\
Complete output (19 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\bsdiff4
copying bsdiff4\cli.py -> build\lib.win-amd64-3.9\bsdiff4
copying bsdiff4\format.py -> build\lib.win-amd64-3.9\bsdiff4
copying bsdiff4\test_all.py -> build\lib.win-amd64-3.9\bsdiff4
copying bsdiff4\__init__.py -> build\lib.win-amd64-3.9\bsdiff4
running build_ext
building 'bsdiff4.core' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\bsdiff4
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\include -IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um /Tcbsdiff4/core.c /Fobuild\temp.win-amd64-3.9\Release\bsdiff4/core.obj
core.c
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\include\pyconfig.h(59): fatal error C1083: Nao ‚ poss¡vel abrir arquivo incluir: 'io.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30037\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\nego ney\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\nego ney\\AppData\\Local\\Temp\\pip-install-mp5zoj50\\bsdiff4_b64f4fb7c8d44c99a8989c37191075a4\\setup.py'"'"'; __file__='"'"'C:\\Users\\nego ney\\AppData\\Local\\Temp\\pip-install-mp5zoj50\\bsdiff4_b64f4fb7c8d44c99a8989c37191075a4\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\nego ney\AppData\Local\Temp\pip-record-tk6s6_pk\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\nego ney\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\bsdiff4' Check the logs for full command output
"
"
And i could not find any tutorial solving that, please help me bois
help reeeeeee
please answer me i beg
bump
Solved, i used it on a vm running clean python + vs instalations, sorry for useless thread
iHatePayloadDumper said:
Solved, i used it on a vm running clean python + vs instalations, sorry for useless thread
Click to expand...
Click to collapse
hey, how did u solved that problem? im stuck here too
Larry112 said:
hey, how did u solved that problem? im stuck here too
Click to expand...
Click to collapse
Had the same issue. Downgrading protobuf to 3.19.3 fixed it for me

Categories

Resources