[Shell Script]GetJava (get java code from apks instantly) - Galaxy S 4 Developer Discussion [Developers-Only]

I wrote this small shell script that basically extracts classes.dex from an apk/jar, then decompiles the classes.dex to jar classes, extracts the classes and converts them to java code.
Script got posted on the portal (http://www.xda-developers.com/android/getjava-helps-you-convert-apks-into-java-projects/)
Installation: (dont skip this step)
place it in ~/bin, give execute rights and then run
Code:
getjava --getdeps
Usage:
Code:
getjava file.apk [--debug]
--debug param is optional and gives extra output
when entering "getjava apkname.apk" you will get as output a folder called:
apkname.apk_java
which contains the decompiled classes.
obfuscation may scramble the code
Script:
Code:
#!/bin/bash
# getjava v1.0
# to get java code from apks instantly
# by broodplank
#
# Credits:
# Dex2Jar - Google
# JAD - Pavel Kouznetsov
if [[ ( $1 = "--getdeps" ) || ( $2 = "--getdeps" ) ]]; then
echo "Installing required dependencies..."
echo
sudo apt-get install p7zip unzip wget -y
wget -P ~ http://www.broodplank.net/files/getjava_dep.zip
unzip -o ~/getjava_dep.zip -d ~/bin
rm -f ~/getjava_dep.zip
echo "Done, please restart the script"
exit
fi;
if [[ $2 = "--debug" ]]; then
export DEBUGPARAM1="-d -v"
export DEBUGPARAM2="-v"
else
export DEBUGPARAM1=""
export DEBUGPARAM2=""
fi;
if [[ ( $1 = "" ) || ( $1 = "--help" ) || ( $1 = "-help" ) ]]; then
echo "getjava -- get java from apk or jar instantly"
echo "usage: getjava [apk/jar path] [options]"
echo
echo "options:"
echo " --getdeps Installs all required dependencies automatically"
echo " --debug Show additional debugging information"
echo
echo "by broodplank"
exit
else
DIR=${1%/*}
FILE=${1##*/}
EXTENSION=${1##*.}
OUTDIR="${PWD}/${FILE}_out"
fi;
rm -Rf ${OUTDIR}
rm -Rf ${PWD}/${FILE}_java
mkdir -p ${OUTDIR}
7za x -yr -o${OUTDIR} ${1} classes.dex
d2j-dex2jar.sh ${DEBUGPARAM1} -os -ts ${OUTDIR}/classes.dex -o ${OUTDIR}/classes_dex2jar.jar
7za x -yr -o${OUTDIR}/out ${OUTDIR}/classes_dex2jar.jar
find -iname '*.class' -execdir jad ${DEBUGPARAM2} -o -r -s .java -d ${OUTDIR}/java -o {} \;
rm ${OUTDIR}/classes.dex ${OUTDIR}/classes_dex2jar.jar
mv -f ${OUTDIR}/java ${PWD}/${FILE}_java
rm -Rf ${OUTDIR}

After converted apk to java, the most important question is "did it run on java enabled phone" ?

z720 said:
After converted apk to java, the most important question is "did it run on java enabled phone" ?
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

z720 said:
After converted apk to java, the most important question is "did it run on java enabled phone" ?
Click to expand...
Click to collapse
Wat :silly:
So you're actually saying if the java code itself did run on a java enabled phone? which are all android devices. no it does not of course.
or if you mean if you're able to recompile the apk with the decompiled sources? if so, then in some cases you can but mostly on small apps.
the script is made for getting an insight on how the code is built.
defcomg said:
Click to expand...
Click to collapse
+1:good:

broodplank1337 said:
Wat :silly:
So you're actually saying if the java code itself did run on a java enabled phone? which are all android devices. no it does not of course.
or if you mean if you're able to recompile the apk with the decompiled sources? if so, then in some cases you can but mostly on small apps.
the script is made for getting an insight on how the code is built.
+1:good:
Click to expand...
Click to collapse
Hey dude,
Congrats! nice work. Have you done a side by side comparison of your script against DED or Android DARE? When I get home tonight I will give it a run and feed you back my results. Have you got a common APK that I could use as a control?
I will send you the resulting decompiled Java classes from DARE for you to look at

noice great work
any work making a repacker version?

Jarmezrocks said:
Hey dude,
Congrats! nice work. Have you done a side by side comparison of your script against DED or Android DARE? When I get home tonight I will give it a run and feed you back my results. Have you got a common APK that I could use as a control?
I will send you the resulting decompiled Java classes from DARE for you to look at
Click to expand...
Click to collapse
Thanks! No I haven't done any comparison actually, I just wrote it and shared it on Dev forums, I never expected it to hit the portal so it's still a really simple script, will extend it and make it better. If anyone would like to contribute to the script, take look at github (just made it) https://github.com/broodplank/GetJava
Attached an apk that is not obfuscated and has very decent java output
ayysir said:
noice great work
any work making a repacker version?
Click to expand...
Click to collapse
Thanks, well implementing a repacker is not really the idea. it's because almost all apks will not repack successfully. What I can create tho is an option to export it to an eclipse project such as in ApktoJava (my windows version of this tool)

@broodplank1337
Thx for this great script. This is what I were looking for some years ago. Good work :good:.

Quick question, how's this different from dex2jar?

10tacleBoy said:
@broodplank1337
Thx for this great script. This is what I were looking for some years ago. Good work :good:.
Click to expand...
Click to collapse
You're welcome it's always handy to have ;p
elesbb said:
Quick question, how's this different from dex2jar?
Click to expand...
Click to collapse
Well if you read the OP you will see that it does more then just convert the dex to a jar file. sine thats the only thing dex2jar can do
I wrote this small shell script that basically extracts classes.dex from an apk/jar, then decompiles the classes.dex to jar classes, extracts the classes and converts them to java code.

broodplank1337 said:
Well if you read the OP you will see that it does more then just convert the dex to a jar file. sine thats the only thing dex2jar can do
I wrote this small shell script that basically extracts classes.dex from an apk/jar, then decompiles the classes.dex to jar classes, extracts the classes and converts them to java code.
Click to expand...
Click to collapse
-.- yes i get that. Thats obvious from the thread title.. but you can use JDGui or other tools to get the java source from the jar files.. In terms of conversion, how is this different from dex2jar?

elesbb said:
-.- yes i get that. Thats obvious from the thread title.. but you can use JDGui or other tools to get the java source from the jar files.. In terms of conversion, how is this different from dex2jar?
Click to expand...
Click to collapse
well. JAD and JDgui (which I use in ApktoJava) are class to java decompilers, but dex2jar converts the dalvik byte code (classes.dex) to java classes. so they are very different, also dex2jar always does it's job correctly all the time, while java decompiler tend to fail now and then (to give you a reasonably readable code)

This will be useful for those beginners for who wants to learn java for android especially like me. Amazing thumps

broodplank1337 said:
well. JAD and JDgui (which I use in ApktoJava) are class to java decompilers, but dex2jar converts the dalvik byte code (classes.dex) to java classes. so they are very different, also dex2jar always does it's job correctly all the time, while java decompiler tend to fail now and then (to give you a reasonably readable code)
Click to expand...
Click to collapse
If i use your script to decompile(dex2jar) systemui.apk.would i able to recompile it
Sent from my GT-S5570 using XDA Premium 4 mobile app

arpitkh96 said:
If i use your script to decompile(dex2jar) systemui.apk.would i able to recompile it
Sent from my GT-S5570 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
I think not, it contains pretty much code and next to that it needs the android environment to be compiled. almost all system apks cannot be recompiled unfortunately

broodplank1337 said:
I think not, it contains pretty much code and next to that it needs the android environment to be compiled. almost all system apks cannot be recompiled unfortunately
Click to expand...
Click to collapse
Ok.(i have android environment)
Sent from my GT-S5570 using XDA Premium 4 mobile app

One thing that dex2jar has a hard time with is switch/case statements, and big if/then/else ladders. When compiling down to dalvik code, these often get broken out to seemingly random parts of the function with just an if-eqz :labelname and a return statement. This often means that the code for the case statement shows up outside of the switch statement when converted back to .class files.
TLDR: No, most of the time the resulting java code will not recompile without some tweaking.

Fenny said:
One thing that dex2jar has a hard time with is switch/case statements, and big if/then/else ladders. When compiling down to dalvik code, these often get broken out to seemingly random parts of the function with just an if-eqz :labelname and a return statement. This often means that the code for the case statement shows up outside of the switch statement when converted back to .class files.
TLDR: No, most of the time the resulting java code will not recompile without some tweaking.
Click to expand...
Click to collapse
Its impossible to recompile any java decompiled apk due to resource ids.
Im wondering if this scrip will return the //Internal error// in a lot of apps when decompiling.

Not the best way to recover your lost work. Tried it on an APK I have written 2 years ago and I can barely recognize my code. Better than nothing I guess, thanks.

Can someone explain how to exactly use this script and in which bin folder to place it in?

Related

[TUTORIAL]Guide to resizing apps to QVGA[STEP BY STEP]

Ok so a lot of you guys have been requesting a resizing tutorial so you can all help out on the new fresh roms like thenextsense and senseonfire.
Everyone gets directed to http://forum.xda-developers.com/showthread.php?p=6739512#post6739512 and get all confused because it doesn't actually explain much so I decided to post one written by me (I resize things in my rom, senseonfire)
Note: I am using linux Operating System and resizing to my HTC wildfire.
First off you are going to want to download apktool and the dependences for your operating system. It runs on windows, linux and mac OSX so it won't matter what OS you are running, you will be able to use it.
Once you have got apktool installed you are going to open terminal (or command prompt on your windows)
You are then going to navigate to the directory you installed apktool into:
Code:
cd /install...dir../apktool
Once that is done you are going to look at the rom that contains the app you are about to resize. You are going to open the rom archive and navigate to the framework
Code:
/system/framework/
and extract any files ending in .apk to the apktool dir
You are going to go back to the open terminal and type in
Code:
./apktool install-framework extracted_framework_filename.apk
or if you are on a windows computer
Code:
apktool install-framework extracted_framework_filename.apk
This will install the framework file/s so apktool can decompile stock apps correctly.
Once it installs correctly you are then going to choose the app you are going to resize. For the sake of this tutorial I am going to resize HtcMusic.apk
Navigate to the app folder in the rom archive
Code:
/system/app
and extract HtcMusic.apk to apktool dir
Then you are going to decompile the app to start resizing
In the still open terminal you are going to type
Code:
./apktool d HtcMusic.apk
This will decompile the htcmusic to a folder in the apktool dir called HtcMusic
To make resizing easier you should grab your phone and open HtcMusic and see what needs resizing. Now this is where the trial and error comes in.
Navigate to the layout folder in HtcMusic
Code:
/res/layout
or
Code:
/res/layout-mdpi
and choose the .xml file you believe you are looking at on your phone screen. For example on the HtcMusic app if you are resizing the playback screen it would be audio_player.xml that you would have to edit.
Play with things that have sizes (y.y px) especially things that say layout_width=y.y px... change the y value to something smaller.
If there is something that has a value @dimen/... it means that the value is in the dimens.xml in the /res/values folder
If there is something that has a value @com.htc:dimen/... it means that the value is in the dimens.xml in the com.htc.resources.apk
Once you finish the changes you are going to have to recompile the app
Go back to the terminal app that you still should have open (if you don't you will have to open it and cd to the apktool dir)
type in this code (make sure you delete the HtcMusic.apk out of the apktool directory prior to doing this)
Code:
./apktool b HtcMusic HtcMusic.apk
if you get an error and you are on linux try this
Code:
sudo ./apktool b HtcMusic HtcMusic.apk
sudo chown [your username] HtcMusic.apk
Once you finish this you will have to sign your apk. The easiest way to do this is to use dsixda's kitchen's signing tool.
Once this is done you can either push the app to your phone using adb (this never works for me)
Code:
./adb push HtcMusic.apk /system/app
if that doesn't work
Code:
./adb remount rw
./adb push HtcMusic.apk /system/app
But if that causes HtcMusic to disappear like it did to mine you will have to use dsixda's kitchen to open the rom, add htcmusic, sign all apps, and cook the rom again, then flash it on your phone.(I will not type out how to do this, there are lots of threads on how to use the kitchen)
Actually you can do it a lot easier than flashing the whole ROM again. I will post how to do this soon [28/6/12]
Open the app and look what has changed (if any) and then try again till you get it right. Trust me it takes a long while to get it right so don't expect for it to be right on your first go
Oh and if this helped you hit thanks!
APK Manager
There is an app called APK Manager that will make this easier i think it is just for windows but i don't know there might be a linux version
if this is helpfull remember to THANK
linux too http://forum.xda-developers.com/showthread.php?t=695701
Nice ! (ADB works never for me to )
THanks for the tutorial Vigidroid
I am new to this followed your steps perfectly but couldn't find any file with extension xml
I am on windows 7 all files are .smali extension
Can you elaborate a little ...Thanks
Edit :weird but works now
hey guys i'm a complete noob
i did follow all of d above steps and i'm stuck on d "AndroidManifest.xml" ... i'm not able 2 open d xml !!!!! it gives me a phrasing error( in mozilla) and an "encoding error"(in jedit)
could some 1 pls help me out !!!
thankya in advance
You must be trying to open up a .xml file that hasn't been decompiled yet. Try using apktool again to decompile all the contents of the app and then you should be able to open all .xml files correctly.
Opening the android manifest that has been decompiled:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Opening the android manifest that hasn't been decompiled:
hi VigiDroid,
thanks for all the work you do for our wildfires. ive tried, unsuccessfully to use apktool a few times so i can learn how to resize apps. i cant even get to open apktool.
i downloaded the apktool1.4.3.tar.bz2 and apktool-install-wind...,tar.bz2 and unpacked them onto a folder on my desktop (windows xp). in the tut you say to install apktool, i assume you mean to open the tar files to a folder?
when i open a command and try and run apktool i keep getting a syntax error message. i have the apktool ms-dos batch file and executable jar file with the aapt file in a folder on my desktop called (not very originally ) "apktool" so i typed into the command box
cd/C:\Documents and Settings\KnK\Desktop\apktool/apktool
as instructed in your tut ie cd /install...dir../apktool. install directory being C:\Documents and Settings\KnK\Desktop\apktool.
any help would be appreciated. ive attached a screen shot of the command promt
Here's a couple of guides I followed in the beginning. First one is for setting up java, adb http://forum.xda-developers.com/showthread.php?t=879701
Second is for apk multi tool, it used to be apk manager, install this after setting up java and the Android-sdk, its basically apktool but with a gui. Great tool for beginners.http://forum.xda-developers.com/showthread.php?t=1310151
There is another one I used for just setting up apktool but I can't find it so have a crack with the multi tool.
Sent from my HTC Wildfire using xda premium
Nice 1 Scratch, as always there with a helping hand for our little wildfire community. Thanx m8
Sent from my Wildfire using xda premium
... on the learning progress , my dream is to be a chef and share my work here ... thx for the tutorial it really help me a lot ..
Sent from my Wildfire using Tapatalk 2
Does anyone know why do I always get errors on compiling with apktool ? I have java installed for sure, I installed the framework , got no problems with the decompiling and then it just wouldn't build up :X
P.S. I was trying to edit one layout xml in this apk ,but no success. Would be really grateful if someone can compile it for me :S

[2015/03/07] BotBrew: *nix tools for Android

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The remainder of this post contains historical information. Please read the update. Thank you.
__________________
​ BotBrew is
a repository of *nix software (such as bzip2, curl, openssl, python, and ruby) for ARM-based Android
a package manager powered by Opkg, a lightweight program that feels like dpkg+apt
a service manager powered by runit
a build system for anyone looking to build and package his/her own scripts and programs
Thanks: mateorod and xela92 for testing the heck out of this thing; racks11479 for delicious artwork; you for using this project, reporting bugs, and making it better
If I missed anyone, let me know!
Warning: BotBrew has been used successfully on a variety of rooted ARM devices, and is developed using a Nook Color, but you should still make backups before trying, just in case.
Install BotBrew
[ Google Play | BotBrew.apk | BotBrew.debug.apk ]
Read the Quick-Start Guide & Manual
[ botbrew.com/manual.htm ]​
Click to expand...
Click to collapse
Alternative (Command Line) Installation
If the BotBrew app fails to bootstrap, you might be able to bootstrap using the command line:
Code:
wget http://repo.botbrew.com/anise/bootstrap/install.sh -O- | su
Such a setup should be compatible with the app, though it may not work perfectly. The manual has more tips for command line usage.
Enjoy!
Install BotBrew+1
The next release of BotBrew, named basil, will be powered by Debian's Dpkg and Apt. This is a non-trivial update, so the app is being rewritten from scratch. I've posted some usage instructions, in case you are adventurous enough to try. Thanks! This app may be used in parallel with the current-stable BotBrew release, without conflict.
[ Google Play | GitHub ]​
Click to expand...
Click to collapse
Changes
5/20: the next release of BotBrew is in development!
4/20: improve support for long package names; fix list of repairable packages
4/16: new UI for devices with wide-enough screens; experimental support for moving to /sd-ext
4/9: Google Play release of BotBrew "anise"; previous release is now BotBrew.oldstable.apk; lots of updates since oldstable
3/16: lots of installer and filesystem changes for cross-device compatibility, work started on multiuser support
3/10: installers now depend on botbrew-core, which will (in the future) pull in basic packages that everyone should have
3/4: swipe left and right to see all/installed/upgradable packages
3/3: added ability to start installation of *.opk files from file managers
3/2: added ability to start installation from browser after clicking *.opk link
3/1: fixed some BotBrew.apk bugs; updated command line installer
2/27: reworked BotBrew.apk; new packages in stable repo
2/18: testing repository now open; new opkg -- please read before upgrading
2/16: make BotBrew.apk display latest versions in the package list
2/2: bugfix release of BotBrew.apk
Well, I now have python, ncurses, openssl and a couple other packages running on my nook. I have indeed printed 42, and even wrote my own (proprietary) code to advance the project some that printed 43. Advanced scripting.
But seriously, this is sweet. I am all over anything that opens up this device. I don't think I have ever bought a piece of hardware that has so outstripped my expectations.
Thanks for the program. I will report back after I play with it some.
Wow, what a great idea! Looks like my Nook will be used for a bit more than entertaining my family with casual games; nice to have some productivity back I was thinking about installing Ubuntu on my Nook for this sort of thing, but there's no need anymore.
It would be great to get this a bit more recognition, and getting more useful things such as gcc or even the GNU toolchain installable with this package manager. Might put a link in my signature, if you don't mind.
Now to look for an affordable lightweight bluetooth keyboard...
You read my mind I got binutils, gmp, mpfr, and mpc working earlier today... and gcc is in the pipeline. My main reason for wanting a native gcc is that some software (such as python) do not like to be cross-compiled at all. I'm having a bit of trouble with gcc, but I'll keep hacking away at it.
Please, go right ahead and share this thread; this is a young project but I think it could be more useful. On the one hand, there's a whole lot of free software (such as the GNU stuff) just asking to be built and packaged; on the other hand, many people who hang out around here have a few scripts/programs of our own to distribute.
In case you're interested, here's where all the packages live. There are actually two more ways to install (remote and local) stuff using Opkg:
Code:
opkg install http://host/path/to/package.opk
Code:
opkg install path/to/package.opk
Very nice project !!!
I have python 2.7 standalone on android.
One problem, in python commandline i can't import hashlib, i can fix this?
Thanks.
So, I just got a working build of GCC+binutils and pushed the packages to the stable repo. Please keep in mind that for now, stable means I tested it a couple of times and it works, so be careful and use at your own risk.
To install gcc and binutils, make sure you have about 160mb of storage free in /system and run:
Code:
opkg update
opkg install gcc-4.6
That's about 70mb's worth of downloads, and my server's underpowered, so please wait patiently and retry if it fails (failure when receiving data from the peer). When that's done, you might want to compile something:
Code:
cd /cache
wget http://dl.dropbox.com/u/1213413/htdocs/agcc/hello.c
gcc -o hello hello.c
And if that completed successfully, you should have a new executable, which you could run for a classic greeting. I was not able to get the C++ libraries compiled, but C code should compile alright.
@Fritos2: I've been trying to fix this issue, but I'm not confident that I could do it without help. Python (and Perl) are very resistant to cross-compilation, and even after I hammered it into submission, some modules do not work. Another module that I'd really like is readline, which gives you enhanced editing capabilities in the interactive interpreter. I'm a Pythonista, but I've got to say: Ruby does cross-building right. Even sqlite3 supports readline. I suspect that Python might have to be compiled natively, and this is where native gcc comes in.
I'd appreciate any help, of course
I'll follow this project with great interesting.
Hey guys, there have been a few updates:
opkg's lock file has been moved to /cache/opkg/lock so there's no need for a read-write /system just to query packages
gnupg has been packaged, for those who like to sign their stuff
python... well, I'm still working on it >.<
Anyway, I thought I'd do something to make this project more accessible. I don't have any apk's for you yet, but I've attached a screenshot of the work-in-progress
I am very impressed with the progress. I am a super-noob but have enjoyed toying with the packages from your opening post. I haven't had time to do much but explore, but this sure does open up a whole new world for the nook, from an accessability stand point alone. I wouldn't be suorised to see an uptick in interest as some if the more experienced coders are able to turn their attention from cm9.
I will probably install those latest packages sometime this weekend. Just real strong stuff.
Edit. Ok, o I just went ahead and did it now. Obviously, I couldn't get it to work. Have downloaded the FCC and got the hello file fro the dropbox. I ran the gcc -o hello hello.c and was returned a hashtag only. If I ran gcc hello, it outputted the hello program code. I tried several things basically willynilly until I got tired of getting a fatal error and having the build canceled.
If this is too basic and will clog the thread, I would happily accept a pm with a good tutorial. Thanks a bunch.
The problem with python maybe relationed with python-devel package?
Sorry is the question is stupid, i'm so noob.
The Python build process has two steps: first, you get the main Python executable, and then you get the modules. The executable built in the first step is used to test the modules in the second step. So, naively cross-compiling Python would result in most modules not passing the test (because you cannot actually run the Python you just built), and these modules would be removed. As it turns out, you could patch the build scripts to run the tests using a host-native Python, but even then, there are a few modules with particular requirements that still don't pass. This is where we are now, but I think we could do better.
Okay, so more progress: BotBrew.apk is out in the wild! I decided to put it off until I got some basic functionality working. What is this?
a basic GUI for package management
lists all packages
searches for packages by name
shows package information
installs/upgrades/removes packages
manages list of repositories
I've only really tested it with CM7, but it works on the latest CM9 previews as well.
Screenshots
​
mateorod said:
Edit. Ok, o I just went ahead and did it now. Obviously, I couldn't get it to work. Have downloaded the FCC and got the hello file fro the dropbox. I ran the gcc -o hello hello.c and was returned a hashtag only. If I ran gcc hello, it outputted the hello program code. I tried several things basically willynilly until I got tired of getting a fatal error and having the build canceled.
Click to expand...
Click to collapse
No worries. If gcc did not complain and dropped you back in the shell, this means it's done! Just list the directory to find a new file named hello, which you could run:
Code:
# gcc -o hello hello.c
# ls
backup download hello.c opkg
dalvik-cache hello lost+found recovery
# ./hello
hello world
#
I hope this helps!
Sorry if this sounds ignorant but is there any future usage aside from being a very interesting project? Will we be able to distribute open source projects / software specifically made for Android devices like on common Linux distributions?
BobbyBest said:
Sorry if this sounds ignorant but is there any future usage aside from being a very interesting project? Will we be able to distribute open source projects / software specifically made for Android devices like on common Linux distributions?
Click to expand...
Click to collapse
A valid question, I think. BotBrew has the potential of becoming a Cydia of sorts, distributing system extensions, interface customizations, and other useful software for rooted Android devices. Android has a vibrant community of programmers and scripters, but there isn't any standard way to manage software that are not apps. And there's a large body of open source Linux software that might work well on Android. Of course, BotBrew is also able to handle root apps that live in /system/app (i.e. gapps); for user-level apps, the various app stores already work quite well.
In order for this to become a serious platform, we'll need a couple of things: a solid technical foundation, developer support, and a user base. I've been making progress mostly towards the first point; hopefully the rest would follow.
Well I'll be. Yeah it worked. Who knew?
Okay, so that's great! I have printed 43 (my own design) and now the standard greeting has been successfully built and ran as well. I must toodle with it some more. What would you recommend to try? Remember, i am slow-witted and totally inexperienced.
If you say print 44 i will totally understand. : )
How about this, i would like to learn and i would like to help you with your program. I will probably be of most use as a guinea pig, but since i spend a fair amount of time jiggering system files and databases, I have to complete wipe about once a week. failure or risk doesn't bother me.
---------- Post added at 02:27 AM ---------- Previous post was at 01:51 AM ----------
Okay, i just got the apk. I autoremoved all installed packages. I installed opkg, python, gcc (binutils came along as a dependency) and the hello executable. But when i went into a terminal once i cd cache, it only lists opkg out of the five packages. This worked when i did the wget through the terminal. The packages show as installed within the botbrew app (nice icon and UI, btw).
I known I am doing something very simple incorrectly. Do you have enough information to be able to tell me what that is?
Congrats on a successful build! Now that you have a working program, you could package it up for distribution
What's more, you could do it directly on Android. Let's call this package mateorod-hello, prefixing it with the vendor's (your) name to avoid conflicts with other variants. We'll also rename the executable itself.
We'll install the program to /system/bin, where it would feel at home with all the other programs; so we create a staging directory tree that mimics the structure of an Android system, but contains just the one program:
Code:
cd /cache
mkdir -p system/bin
cp hello system/bin/mateorod-hello
Next, we need a control file to describe what's in the package. It might be easier to create the file on a computer and push it over, but we could also create it using the command line:
Code:
echo "Package: mateorod-hello" > control
echo "Version: 1.0" >> control
echo "Architecture: armeabi" >> control
echo "Description: a greeting from mateorod" >> control
And, finally, a magic value to signify what kind of package this is:
Code:
echo -n "2.0" > debian-binary
Okay, now let's pack this up:
Code:
tar zcvf data.tar.gz system
tar zcvf control.tar.gz control
ar -r mateorod-hello.opk debian-binary data.tar.gz control.tar.gz
We now have mateorod-hello.opk, which we could test by installing:
Code:
opkg install mateorod-hello.opk
Now that it's installed, the program within is also available:
Code:
mateorod-hello
This is quite a bit of work for something that could just be pushed over adb, but it could be automated and it works tremendously well for more complex software. The control file helps keep track of versions, and lets you specify dependencies too.
Oh, and to clean up a bit: (the first command makes sure you're in /cache and do not accidentally erase /system)
Code:
cd /cache
rm -r system control data.tar.gz control.tar.gz debian-binary
/edit:
mateorod said:
But when i went into a terminal once i cd cache, it only lists opkg out of the five packages. This worked when i did the wget through the terminal. The packages show as installed within the botbrew app (nice icon and UI, btw).
Click to expand...
Click to collapse
What did you do, cd /cache then ls? If so, you're most likely looking at the /cache/opkg directory, which contains temporary data. If you want to see what's installed using the command line, try opkg list-installed
I uh... picked a random icon I had lying around, and I plan to swap it out when I have time to make one. Thanks, though :3
The amount of help you're offering is just staggering. I will put the above together tonight and will report back.
I have a bug here in the GUI.
Rotation makes the app start looking for updates again.
edit: Reentering does the same...
opkg has then problems with set locks.
(CM7 KANG by MiRaGe)
Currently trying to install gcc to compile and run a small program...
edit2: gcc-4.6 installed. Still trying to compile a small prog. Will continue tomorrow...
Edit3: Well, problem with GUI fixed itself somehow.
Still, maybe you should check out how the GUI behaves during the installation process when rotated.
Yes, I can see how this bug could occur, and it should only happen during the first run. When the package cache is empty, the app tries to update by itself, and it seems that rotation causes something to restart. I've uploaded an update, which hopefully fixes this issue. Thanks for the report.
/edit:
Bug fixed for real. You may now rotate with impunity. Man, why can't Android have sensible defaults?
Okay, took me awhile, but...
$ export PATH=/data/local/bin:$PATH:.
$su
# cd cache/
# wget http://dl.dropbox.com/u/1213413/htdocs/agcc/hello.c
Connecting to dl.dropbox.com (174.129.218.194:80)
hello.c 100% |************************************| 93 0:00:00 ETA
# gcc -o hello hello.c
#ls
dalvik-cache hello lost+found recovery
download hello.c opkg
# ./hello
hello world
#mkdir -p system/bin
# cp hello system/bin/mateo-hello
#echo "Package: mateo-hello" > control
#echo "Version: 1.0" >> control
#echo "Architecture: armeabi" >> control
# echo "Description: a word from Mateo" >> control
#echo -n "2.0" > debian-binary
# tar zcvf data.tar.gz system
system/
system/bin/
system/bin/mateo-hello
# tar zcvf control.tar.gz control
control
# ar -r mateo-hello.opk debian-binary data.tar.gz control.tar.gz
ar: creating mateo-hello.opk
#opkg install mateo-hello.opk
Installing mateo-hello (1.0) to root...
Collected errors:
Two sets of collected errors related to system not being mounted R/W excised
Installing mateo-hello (1.0) to root...
Configuring mateo-hello.
#mateo-hello
hello world
#
So there it is. I just followed your more-then-generous guide, with some phrasing changes to show i didn't just copy/paste.
Some notes from the inexperienced:
-As you can see, I had to use the wget command to work on the hello.c script. I had hello as an installed package through the Botbrew GUI already, but no matter what permutation of hello command I ran, gcc would not recognize it as an input file. Just to say that your guide to the initial build, as written, i don't think will work for anyone who installs the packages through the apk. I don't know the solution, but i bet it's simple.
Edit: I guess the package you get through your apk is a fully built executable? I hadn't gone through the later steps when I first tried to build it, so I never thought to simply enter "hello". Output a much fancier greeting then the one I built. Capital letters and an exclamation mark! Very nice.
- For other newbies- make sure that system is mounted R/W through root explorer or some such. And if you employ a firewall, if you intend to use the wget command, not only do you need to allow your terminal through, you also need to allow applications running as root! I am sure this is news to no one, but it cost me FOREVER!
I feel like this constitutes progress. Thanks for all the work!

[TOOL][AIO] StudioAndroid # Automize everything! [GUI]

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
vlt96 said:
You shouldn't try it out when you have free time, it will give you free time
Click to expand...
Click to collapse
Features
FEATURES LIST​Image
Install Image Tools: Install ImageMagick and/or PIL to use my Image Tools
Convert Image: Convert any image in given directory to given extension
Resize: Batch-resizes files found in given directory with given percent or given DPIs, or resizes an APK with given DPIs
Batch Theme: Applies a theme overlay (caclulated with luminosity values) to all images found in a given directory (e.g. THEME!)
Batch Rename: Batch renames all files found in a directory with a given pattern, and renames them to given out (for porting Themes)
CopyFrom: Copies images present in directory 1 FROM directory 2 (if present in dir 2) - for themers!
OptimizeImage: Optimizes Image, so that size will be smaller
Development
Prepare Building: Installs necessary build tools
Build from Source: Builds one from many sources and even choose a device (if available)
Add Governor: Add a governor to a kernel
Install Android SDK
Install Java JDK
APK
(De)Compile
Extract/Repackage APK
Sign APK with different keys
Zipalign APK
Install APK
Optimize Images INSIDE APK
Advanced
(Bak)Smali: Lets you edit the code inside classes.dex and compile back
ODEX: ODEX a ROM
DE-ODEX: DE-ODEX a ROM
Compile to an Exe: lets you compile Python scripts to an executable for your OS
Android
Configure ADB: Connect to devices over IP, enable/disable Network ADB on connected device
Logcat
Build.Prop: Pulls Build.prop from device and let you edit it
Backup / Restore: full backup of (all optional) apps, system apps, data, shared storage
ADB File Explorer
StudioAndroid options
Clean workspace and go back to before you used this tool the first time!
Debug: Includes printing the used commands before executing and testing the latest changes
Check the log in a scrollable window with selectable text
Report a bug: Opens a reply on this XDA thread with the content of your log in it
Changelog: See what's changed!
Update: Update StudioAndroid and choose between Stable en Nightly
Restart
About: shows information about the developer, contact info, profile image, twitter etc
​
Click to expand...
Click to collapse
SCALED PREVIEW: (Click to see full preview)
​
Click to expand...
Click to collapse
Instructions
Download the latest update OR one of the stable updates
Extract in your home directory
double-click StudioUnix
Click to expand...
Click to collapse
Preparation:
Download one of the stable updates
Extract in a path without spaces (e.g. NOT in "Documents and Settings")
Double-click StudioWindows.exe
Click to expand...
Click to collapse
OR
Download and run Python
Download and run PYGTK - 32-bits
Download the latest update OR one of the stable updates
Extract in a path without spaces (e.g. NOT in "Documents and Settings")
Right-click Studio.py > Open with > Python
Click to expand...
Click to collapse
Preparation:
install python2.7: 64-bit/32-bit x86-64/i386 / 32-bit i386/PPC
Install this (GTK+ and PyGTK)
Download THIS
Run StudioUnix
Click to expand...
Click to collapse
Click to expand...
Click to collapse
​
[Cross-Platform] StudioAndroid [GUI]
vlt96 said:
You shouldn't try it out when you have free time, it will give you free time
Click to expand...
Click to collapse
Translate?
LINUX
First navigate to StudioAndroid directory.
Then
xgettext -k_ -kN_ -o messages.pot Studio.py
msginit
Click to expand...
Click to collapse
A new file will be created (***.po)
Open that file with PoEdit and translate the right-column
When finished, save it and rename ***.po to Studio.po and put it in StudioAndroid/lang/yourlang_YOURLANG/LC_MESSAGES
afterwards, compile it:
msgfmt Studio.po -o yourlang_YOURLANG/LC_MESSAGES/Studio.mo
Click to expand...
Click to collapse
When I update it, merge the changes using:
xgettext -k_ -kN_ -o messages.pot Studio.py
msgmerge -U Studio.po messages.pot
Click to expand...
Click to collapse
and translate the new strings in PoEdit
The file I need is yourlang_YOURLANG/LC_MESSAGES/Studio.mo, but it's handy for you and me if you also include yourlang_YOURLANG/LC_MESSAGES/Studio.po
WINDOWS
Open lang/LanguageFiles/en_US.po in a text editor
msgid indicates the original string
msgstr indicates the string you need to translate.
So translate the msgstr strings.
Afterwards, send me en_US.po renamed to yourlanguage_YOURCOUNTRY.po
Thanks!
If you cant upload files anywhere, then past the content of SA.po in Pastebin and send me the link
THanks in advance
FULL CREDITS WILL BE GIVEN
Click to expand...
Click to collapse
Info
All info is now available at Github:
Git Source
Changelog
Bugs & Feature requests
BitLy Stats
Click to expand...
Click to collapse
Credits
Ablankzin : Contributor to StudioAndroid
Popdog123: He took the MAC side of the project
vlt96: Making a game to play while waiting
KeitlG: Compiled for windows!!!
KeitlG: Helped me testing the long-awaited ReCompile Fix!
Rookie407 : He compiled this tool for windows! AWESOME! You don't have to install Python and GTK anymore!!!
Lithid-CM : He was my messias on Python in general and GTK specific. Go and give him a "THANKS!"
KeitG: Gettext translation
WilliamCharles & Lycan: Windows testers - AWESOME, THANK THE GUYS!!
Click to expand...
Click to collapse
Hey, I looked through your post, but I don't see what this tool is supposed to do. could you maybe write a description in the op?
Sent from my SGH-I777 using Tapatalk
Waddle said:
Hey, I looked through your post, but I don't see what this tool is supposed to do. could you maybe write a description in the op?
Sent from my SGH-I777 using Tapatalk
Click to expand...
Click to collapse
Hmmn I'll make a screenshot
EDIT: OK NOW?
Greets!
Incoming:
Batch APK de- recompile
Change Animation speed
Text color
IMPORTANT: Porting APK MULTI-TOOL - Wich is for Windows only ATM.
I'll include it in my tool and ask the dev to pay $10 for it (joke ofcourse)
IMPORTANT: FINISHING the "build from source option
mDroidd said:
Incoming:
Batch APK de- recompile
Change Animation speed
Text color
IMPORTANT: Porting APK MULTI-TOOL - Wich is for Windows only ATM.
I'll include it in my tool and ask the dev to pay $10 for it (joke ofcourse)
IMPORTANT: FINISHING the "build from source option
Click to expand...
Click to collapse
So is this for windows or linux?
Sent From My Mecha
nativi said:
So is this for windows or linux?
Sent From My Mecha
Click to expand...
Click to collapse
This tool will stay for linux.
APK MULTI-TOOL is a great tool, but for windows only, so I am gonna port it
APK MUlti Tool:
888 Lines in ONLY the Start script.
But I AM porting it.
Updated this tool first, V1C2A
Changelog V1C2 & V1C1
#v1c1:
[^]Added copyright
[^]Updated Animation
[^]Added second section; looks better
[^]OOPS! I added CopieFrom under the option "c" wich is already changelog!
[^]Improved other than home directory - was not working
[^]ICS Blue characters <3
[^]Added BUILD FROM SOURCE option
[^]Custom animation speed
[>]To try if this works, please go into terminal and type:
cat --help
if it tells you the manual for "cat", then you are fine.
Option D from the main menu.
#v1c2:
[^] Added more comments
[^] Newer CM source - not MIK_OS but now stock CM, wich includes newest adfad
[^] Custom WaitTime
[^] New script version
[^] Fixed some bugs
Will it work on windows
Hey! will this app work on windows? How to batch resize using this? Can this handle transperency? And will it perfectly fit to MDPI from HDPI or it will have FC's???
bhaviksatra87 said:
Hey! will this app work on windows? How to batch resize using this? Can this handle transperency? And will it perfectly fit to MDPI from HDPI or it will have FC's???
Click to expand...
Click to collapse
fc has nothing to do with size, I think...
windows, not yet. How to resize: option resize and follow on screen notifications.can handle transparency.
But no windows yet
Greets!
Hey, I was just wondering what the build from source option does. (I'm not that amazing dev so this might help). Does it compile stuff Aosp, or cm7?
Sent from my GT-I9100 using Tapatalk
Waddle said:
Hey, I was just wondering what the build from source option does. (I'm not that amazing dev so this might help). Does it compile stuff Aosp, or cm7?
Sent from my GT-I9100 using Tapatalk
Click to expand...
Click to collapse
yep IT does! It can prepare your PC for building, and compile AOSP GB, ICS, oxygen, cm7, and maybe another one I forgot... Wasn't it clear? I'll as more screens
Greets!
mDroidd said:
yep IT does! It can prepare your PC for building, and compile AOSP GB, ICS, oxygen, cm7, and maybe another one I forgot... Wasn't it clear? I'll as more screens
Greets!
Click to expand...
Click to collapse
Seems cool. This will really help me out with starting an Aosp rom. Thanks
Sent from my GT-I9100 using Tapatalk
Waddle said:
Seems cool. This will really help me out with starting an Aosp rom. Thanks
Sent from my GT-I9100 using Tapatalk
Click to expand...
Click to collapse
You're welcome.happy users, that's what I am doing it for!
Today ,I made a big update, and added the option batch theme. Also made the tool git, installer file (much smaller and better), new directories support, code cleanup, and some fixes. And also, Apk multi tool is not more then a weak away from release.
Greets!
Thanks man,
This is a pretty amazing program. I looked at the script code and i am really suprised by how long it is. Nice job! As i type this, i am downloading the source code for gingerbread.
Waddle said:
Thanks man,
This is a pretty amazing program. I looked at the script code and i am really suprised by how long it is. Nice job! As i type this, i am downloading the source code for gingerbread.
Click to expand...
Click to collapse
Nice
If you want to, I can learn you how to code it. If you look at the code of the dsixda kitchen inside the scripts directory, copy that and put it in the main menu, it's as longas my script is now. That's what I wanted: ONE script
Greets!
How do I resize?
Is saying values:
I Have to put the directory?
Can you make a quickly tutorial for me? I just need to resize and then I will give credits to you also.
hyztname said:
How do I resize?
Is saying values:
I Have to put the directory?
Can you make a quickly tutorial for me? I just need to resize and then I will give credits to you also.
Click to expand...
Click to collapse
If I am right, it says
Usage: SrcDir ext DestDir perc
Source dir contains the images you want to resize
Extension should be png
DestDir is where the resized images will be put
Perc is the percentage, from HDPI to MDPI IS 66%
Hope I helped.
Greets!
mDroidd said:
If I am right, it says
Usage: SrcDir ext DestDir perc
Source dir contains the images you want to resize
Extension should be png
DestDir is where the resized images will be put
Perc is the percentage, from HDPI to MDPI IS 66%
Hope I helped.
Greets!
Click to expand...
Click to collapse
Yes it says, Usage: SrcDir ext DestDir perc
But you have to type on the Value thing I said before.
I typed:
Code:
~/src 9.png ~/src/new 36
36 is ldpi(is that right?)
And says this is not a command.
hyztname said:
Yes it says, Usage: SrcDir ext DestDir perc
But you have to type on the Value thing I said before.
I typed:
Code:
~/src 9.png ~/src/new 36
36 is ldpi(is that right?)
And says this is not a command.
Click to expand...
Click to collapse
Gimme the screen res of LDPI and Ill calculate. Never resize .9.png
Greets!
I'm not a fake.
I prefer people to reply to me and give feedback instead of thanking me!
But thanking me does show if you apreciate my works.

[Q]CM9 Compiling problem

Hi guys I am kind of a noob when it comes to linux and compiling and have hit a brick wall. I have this posted here in Chef Central and in general android Q&A so hopefully someone has an idea. I have been trying to compile CM9 for about three days now and no matter what I do I get this output. It is 95% of the time after the "install libwebcore.so" line.
Code:
install: out/target/product/maguro/system/lib/libwebcore.so
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.android.dx.util.IntList.(IntList.java:87)
at com.android.dx.rop.code.RopMethod.calcPredecessors(RopMethod.java:154)
at com.android.dx.rop.code.RopMethod.labelToPredecessors(RopMethod.java:95)
at com.android.dx.dex.code.RopTranslator.pickOrder(RopTranslator.java:352)
at com.android.dx.dex.code.RopTranslator.translateAndGetResult(RopTranslator.java:212)
at com.android.dx.dex.code.RopTranslator.translate(RopTranslator.java:106)
at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:293)
at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:134)
at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:87)
at com.android.dx.command.dexer.Main.processClass(Main.java:483)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
at com.android.dx.command.dexer.Main.access$400(Main.java:67)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
at com.android.dx.command.dexer.Main.processOne(Main.java:418)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
at com.android.dx.command.dexer.Main.run(Main.java:206)
at com.android.dx.command.dexer.Main.main(Main.java:174)
at com.android.dx.command.Main.main(Main.java:95)
make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/noproguard.classes-with-local.dex] Error 3
Before I tried to compile CM I did successfully compile AOSP for my Gnex. I have searched and tried everything I could find. I've tried these values in the common.py file and just about every combo I could think of per recommendations I found online.
Code:
check = (sys.maxsize > 2**32)
if check is True:
cmd = ["java", "Xmx2048m", "-jar",
os.path.join(OPTIONS.search_path, "framework", "signapk.jar")]
else:
cmd = ["java", "-Xmx1024m", "-jar",
os.path.join(OPTIONS.search_path, "framework", "signapk.jar")]
I have also checked my swap and as far as I can tell its there and working but it seams to never be used. I have tried all the commands I could find online to make sure it was enabled but Idk what else to try or check.
Also I am using a quad core AMD with 6GB of RAM if anyone is curious. Any and all advice/ideas would be very much appreciated at this point I am at a complete loss. Thanks for looking and helping guys.
EDIT:I just finished a successful build of AOSP for my galaxy nexus so I am really confused as to why I run out of memory for CM9.
Sky-
Try something for me please.
open your terminal. Can you run this please?
test.py
Code:
#!/usr/bin/env python
import sys
import platform
p = platform.dist()
distro = p[0]
version = p[1]
name = p[2]
check = (sys.maxsize > 2**32)
print "Distro: %s\nVersion: %s\n Name: %s\n 64bit OS: %s" % (distro, version, name, check)
Code:
python test.py
Alright I just got home from work so just give me about 30 mins or so and I'll give it a try.
Sent from my GT-N7000 or Galaxy Nexus
I tried the commands you posted here and either I am missing some stuff that should be installed on my computer or I am to much of a noob to enter the commands correctly. Here was my output as I entered the commands.
Code:
[email protected]:~$ test.py
test.py: command not found
[email protected]:~$ #!/usr/bin/env python
[email protected]:~$ import sys
[email protected]:~$ import platform
[email protected]:~$
[email protected]:~$ p = platform.dist()
bash: syntax error near unexpected token `('
[email protected]:~$ distro = p[0]
distro: command not found
[email protected]:~$ version = p[1]
version: command not found
[email protected]:~$ name = p[2]
No command 'name' found, did you mean:
Command 'named' from package 'bind9' (main)
Command 'namei' from package 'util-linux' (main)
Command 'lame' from package 'lame' (multiverse)
Command 'cname' from package 'cfs' (universe)
Command 'uname' from package 'coreutils' (main)
Command 'mame' from package 'sdlmame' (multiverse)
name: command not found
[email protected]:~$
[email protected]:~$ check = (sys.maxsize > 2**32)
bash: syntax error near unexpected token `('
[email protected]:~$
[email protected]:~$ print "Distro: %s\nVersion: %s\n Name: %s\n 64bit OS: %s" % (distro, version, name, check)
bash: syntax error near unexpected token `('
[email protected]:~$ python test.py
python: can't open file 'test.py': [Errno 2] No such file or directory
[email protected]:~$
Sorry if I entered them incorrectly, I am learning linux as fast as I can. Should I have entered them differently?
Sky-
Haha..yes...you needed to put everything from the # all the way to the end of check) in a file called test.py...then enter python test.py in your command line
Use your editor of choice
Don't worry, everyone was new once.
Sent from my SGH-I757M using xda premium
reallybigabe said:
Haha..yes...you needed to put everything from the # all the way to the end of check) in a file called test.py...then enter python test.py in your command line
Use your editor of choice
Don't worry, everyone was new once.
Sent from my SGH-I757M using xda premium
Click to expand...
Click to collapse
Thank you sir. I'm such a dope . I'll do that tonight when I get home from work.
Sent from my GT-N7000 or Galaxy Nexus
sorry about that, I didn't know you were new. Apologies.
Copy and paste these commands.
Command 1:
Code:
(cat << EOF) > $HOME/test.py
#!/usr/bin/env python
import sys
import platform
p = platform.dist()
distro = p[0]
version = p[1]
name = p[2]
check = (sys.maxsize > 2**32)
print "Distro: %s\nVersion: %s\n Name: %s\n 64bit OS: %s" % (distro, version, name, check)
EOF
press [enter]
Command 2:
Code:
chmod a+x $HOME/test.py
Command 3:
Code:
python $HOME/test.py
Thanks for the beginners guide lol, it worked now. Here was the output of that command.
Code:
[email protected]:~$ python $HOME/test.py
Distro: Ubuntu
Version: 10.04
Name: lucid
64bit OS: True
[email protected]:~$
That's what you were looking for correct?
If I were you I would run a mem check on your memory. There shouldn't be any reason that your getting those errors.
I have 8 gigs and I never have an issue.
lithid-cm said:
If I were you I would run a mem check on your memory. There shouldn't be any reason that your getting those errors.
I have 8 gigs and I never have an issue.
Click to expand...
Click to collapse
How would I go about doing that? Sorry for the noobish questions I just have never had to do this before on any of my PC's. Its just so weird because I'm compiling AOSP as we speak. Just wish it was CM lol.
EDIT: My bad I can do it with the ubuntu install dvd I have.
Sent from my GT-N7000 or Galaxy Nexus
Also if you dont mind me asking lithid, what version of linux do you use to build?
skyhigh2004 said:
Also if you dont mind me asking lithid, what version of linux do you use to build?
Click to expand...
Click to collapse
ubuntu 12.04 64bit
Well I am running a mem test now. If it all goes just fine I think I'm gonna do a fresh install of 12.04 and reset everything up and try again. I'm at a complete loss .
Sent from my GT-N7000 or Galaxy Nexus
Well my computer passed the memory rest with zero errors. So I'm installing 12.04 on a fresh format so hopefully I have better luck later tonight or tomorrow getting it to build.
Sent from my GT-N7000 or Galaxy Nexus
skyhigh2004 said:
Well my computer passed the memory rest with zero errors. So I'm installing 12.04 on a fresh format so hopefully I have better luck later tonight or tomorrow getting it to build.
Sent from my GT-N7000 or Galaxy Nexus
Click to expand...
Click to collapse
I am really interested in this. Please keep this post updated with your success!
lithid-cm said:
I am really interested in this. Please keep this post updated with your success!
Click to expand...
Click to collapse
I'll definitely keep you posted. I'm syncing tonight, then hopefully I'll set it up to build when I leave for work in the morning and I'll have good news when I get off in the afternoon.
Sent from my GT-N7000 or Galaxy Nexus
Well all I can say is ***k yeah. I guess reinstalling ubuntu and upgrading to 12.04 in the process cured my computer . I still have no idea as to why I couldnt build before but at least it works now.
Code:
Package complete: /home/skylar/cm9/out/target/product/maguro/update-cm-9.0.0-RC0-maguro-UNOFFICIAL-signed.zip
097429908172684449fb5a3fe796c290 update-cm-9.0.0-RC0-maguro-UNOFFICIAL-signed.zip
[email protected]:~/cm9$
Now to learn how to cherry pick
skyhigh2004 said:
Well all I can say is ***k yeah. I guess reinstalling ubuntu and upgrading to 12.04 in the process cured my computer . I still have no idea as to why I couldnt build before but at least it works now.
Code:
Package complete: /home/skylar/cm9/out/target/product/maguro/update-cm-9.0.0-RC0-maguro-UNOFFICIAL-signed.zip
097429908172684449fb5a3fe796c290 update-cm-9.0.0-RC0-maguro-UNOFFICIAL-signed.zip
[email protected]:~/cm9$
Now to learn how to cherry pick
Click to expand...
Click to collapse
Easy man.
Click cherry pick.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click copy
change directories in your repo path corresponding to the change. In this example frameworks_base from your repo path.
Code:
cd frameworks/base
paste in that command you just copied. press enter and you have just cherry picked to test a new cm commit.
That sounds very easy. Thanks again for a noob tutorial . Also what would you do to remove the cherry pick if you didnt like the commit? Is that path just added to the local manifest just like device trees and kernels sources?
Sent from my GT-N7000 or Galaxy Nexus
skyhigh2004 said:
That sounds very easy. Thanks again for a noob tutorial . Also what would you do to remove the cherry pick if you didnt like the commit? Is that path just added to the local manifest just like device trees and kernels sources?
Sent from my GT-N7000 or Galaxy Nexus
Click to expand...
Click to collapse
While inside the same path you applied the cp.
git reset --hard HEAD
That will reset to the last cm commit. You can do specific files as well by appending the file path after the command.
Sent from my Nexus S 4G using xda premium

can't build the kernel

I have been trying to compile the remix OS kernel, downloaded from their github repo
Code:
CHECK usr/include/linux/wimax/ (1 files)
CHECK usr/include/linux/ (411 files)
./usr/include/linux/if_pppox.h:26: included file 'linux/if_pppolac.h' is not exported
./usr/include/linux/if_pppox.h:27: included file 'linux/if_pppopns.h' is not exported
scripts/Makefile.headersinst:120: recipe for target 'usr/include/linux/.check' failed
make[4]: *** [usr/include/linux/.check] Error 123
scripts/Makefile.headersinst:127: recipe for target 'linux' failed
make[3]: *** [linux] Error 2
Makefile:1080: recipe for target 'headers_check' failed
make[2]: *** [headers_check] Error 2
any ideas?
I'm using the command "make -j 3 deb-pkg" to build.
speculatrix said:
I have been trying to compile the remix OS kernel, downloaded from their github repo
Code:
CHECK usr/include/linux/wimax/ (1 files)
CHECK usr/include/linux/ (411 files)
./usr/include/linux/if_pppox.h:26: included file 'linux/if_pppolac.h' is not exported
./usr/include/linux/if_pppox.h:27: included file 'linux/if_pppopns.h' is not exported
scripts/Makefile.headersinst:120: recipe for target 'usr/include/linux/.check' failed
make[4]: *** [usr/include/linux/.check] Error 123
scripts/Makefile.headersinst:127: recipe for target 'linux' failed
make[3]: *** [linux] Error 2
Makefile:1080: recipe for target 'headers_check' failed
make[2]: *** [headers_check] Error 2
any ideas?
I'm using the command "make -j 3 deb-pkg" to build.
Click to expand...
Click to collapse
No but i will go down to to same road so i can enable my wifi, maybe i find something!
Why are you using make -j 3 deb-pkg, should it not be ¨make arch=x86_64¨ ?
just copy the default config first to somewhere else, like cp arch/x86/android-x86_64_defconfig /work/config/,config
Then make -o /work/config/.config xconfig
make -j4 -o work/config/.config
TerrorToetje said:
No but i will go down to to same road so i can enable my wifi, maybe i find something!
Click to expand...
Click to collapse
Kernel compiled fine here, however I forgot https://github.com/jide-opensource/remixos-kernel/tree/jide_x86_lollipop/android/configs;)
TerrorToetje said:
Why are you using make -j 3 deb-pkg, should it not be ¨make arch=x86_64¨ ?
just copy the default config first to somewhere else, like cp arch/x86/android-x86_64_defconfig /work/config/,config
Then make -o /work/config/.config xconfig
make -j4 -o work/config/.config
Click to expand...
Click to collapse
I must be doing somethign wrong, I did that, using the config file arch/x86/configs/android-x86_64_defconfig
Code:
CC [M] drivers/staging/rtl8723bs/hal/odm_RTL8723B.o
LD [M] drivers/staging/rtl8723bs/r8723bs.o
LD [M] drivers/staging/xgifb/xgifb.o
LD drivers/staging/built-in.o
Makefile:947: recipe for target 'drivers' failed
make: *** [drivers] Error 2
[code]
TerrorToetje said:
No but i will go down to to same road so i can enable my wifi, maybe i find something!
Click to expand...
Click to collapse
Yes, it's because I want to build the wifi myself from this repo:
https://github.com/hadess/rtl8723bs
speculatrix said:
Yes, it's because I want to build the wifi myself from this repo:
https://github.com/hadess/rtl8723bs
Click to expand...
Click to collapse
They write;
For older kernel than 4.3, you might also need this patch applied: https://git.kernel.org/cgit/linux/k.../?id=d31911b9374a76560d2c8ea4aa6ce5781621e81d
Maybe this ?,
My module rtl8188EU was already in the /stage i just enabled it.
TerrorToetje said:
They write;
For older kernel than 4.3, you might also need this patch applied: https://git.kernel.org/cgit/linux/k.../?id=d31911b9374a76560d2c8ea4aa6ce5781621e81d
Maybe this ?,
My module rtl8188EU was already in the /stage i just enabled it.
Click to expand...
Click to collapse
I thought I would start by trying to build the kernel exactly as published, and then start patching it. thanks for the suggestion.
TerrorToetje said:
Why are you using make -j 3 deb-pkg, should it not be ¨make arch=x86_64¨ ?
Click to expand...
Click to collapse
p.s. I build the kernel as a debian package on my debian dev box, which is a VM on qemu/kvm, and then boot the kernel on that dev box to check it works.
https://groups.google.com/forum/m/#!topic/Remix-OS-for-PC/dv3XYXCSYvU
speculatrix said:
https://groups.google.com/forum/m/#!topic/Remix-OS-for-PC/dv3XYXCSYvU
Click to expand...
Click to collapse
Funny thats my topic
TerrorToetje said:
Funny thats my topic
Click to expand...
Click to collapse
I've managed to build a kernel. It doesn't boot on my VM, but I will now "dismantle" the RemixOS usb image, and try copying in the extra kernel modules from my build.
I also need to load in a terminal app and root the remixos image so's I can do useful things when its booted.
Let me know how you got the modules, i'm to be hon-nest i have no clue how to get those modules. How did you found out how they build-ed the USB kernel?
I wan't to have the exact same kernel options as there USB image... and then start to change some things
TerrorToetje said:
Let me know how you got the modules, i'm to be hon-nest i have no clue how to get those modules. How did you found out how they build-ed the USB kernel?
I wan't to have the exact same kernel options as there USB image... and then start to change some things
Click to expand...
Click to collapse
so when I got it to build, I did "make modules_install" and then looked in /lib/modules and found it.
meanwhile, I unzipped RemixOS usb stick image (EFI) and mounted the nested file systems like this
Code:
unzip release_Remix_OS_for_PC_64_B2016020201_Alpha_EFI.zip Remix_OS_for_PC_64_B2016020201_Alpha_EFI.img
mount -o loop,offset=1048576 Remix_OS_for_PC_64_B2016020201_Alpha_EFI.img /mnt/remix
cd /mnt/remix
mkdir /mnt/remix-sfs
mount -o loop system.sfs /mnt/remix-sfs
cd /mnt/remix-sfs
mkdir /mnt/remix-sfs-system
mount -o loop system.img /mnt/remix-sfs-system
speculatrix said:
so when I got it to build, I did "make modules_install" and then looked in /lib/modules and found it.
meanwhile, I unzipped RemixOS usb stick image (EFI) and mounted the nested file systems like this
Code:
unzip release_Remix_OS_for_PC_64_B2016020201_Alpha_EFI.zip Remix_OS_for_PC_64_B2016020201_Alpha_EFI.img
mount -o loop,offset=1048576 Remix_OS_for_PC_64_B2016020201_Alpha_EFI.img /mnt/remix
cd /mnt/remix
mkdir /mnt/remix-sfs
mount -o loop system.sfs /mnt/remix-sfs
cd /mnt/remix-sfs
mkdir /mnt/remix-sfs-system
mount -o loop system.img /mnt/remix-sfs-system
Click to expand...
Click to collapse
Okay i managed the same, but also not booting. at least i can see that here is full gui support now, but again i only get a shell.
speculatrix said:
so when I got it to build, I did "make modules_install" and then looked in /lib/modules and found it.
meanwhile, I unzipped RemixOS usb stick image (EFI) and mounted the nested file systems like this
Code:
unzip release_Remix_OS_for_PC_64_B2016020201_Alpha_EFI.zip Remix_OS_for_PC_64_B2016020201_Alpha_EFI.img
mount -o loop,offset=1048576 Remix_OS_for_PC_64_B2016020201_Alpha_EFI.img /mnt/remix
cd /mnt/remix
mkdir /mnt/remix-sfs
mount -o loop system.sfs /mnt/remix-sfs
cd /mnt/remix-sfs
mkdir /mnt/remix-sfs-system
mount -o loop system.img /mnt/remix-sfs-system
Click to expand...
Click to collapse
Do you know if there is any way to capture the current kernel config from the running android machine?, i tried to see if there was a config in /proc but no..
The thing is to nail this down you can do two things, either dmesg and see whats going wrong or capture a working config and build on top of that one.
TerrorToetje said:
Do you know if there is any way to capture the current kernel config from the running android machine?, i tried to see if there was a config in /proc but no..
The thing is to nail this down you can do two things, either dmesg and see whats going wrong or capture a working config and build on top of that one.
Click to expand...
Click to collapse
Like you, I tried the same... there's nothing in /boot, and the kernel doesn't provide a /proc/config.gz
I tried the "contact us" on the jide website to ask about building the kernel and didn't get a response. I've not seen any jide people respond to discussions on google groups.
It does seem Jide want to act in good faith:
http://liliputing.com/2016/01/jide-releases-remix-os-source-code-to-comply-with-gpl-apache.html
speculatrix said:
Like you, I tried the same... there's nothing in /boot, and the kernel doesn't provide a /proc/config.gz
I tried the "contact us" on the jide website to ask about building the kernel and didn't get a response. I've not seen any jide people respond to discussions on google groups.
It does seem Jide want to act in good faith:
http://liliputing.com/2016/01/jide-releases-remix-os-source-code-to-comply-with-gpl-apache.html
Click to expand...
Click to collapse
Maybe i should write them aswell, would be nice if they enabled the .config option in there Alpha releases
speculatrix said:
Like you, I tried the same... there's nothing in /boot, and the kernel doesn't provide a /proc/config.gz
I tried the "contact us" on the jide website to ask about building the kernel and didn't get a response. I've not seen any jide people respond to discussions on google groups.
It does seem Jide want to act in good faith:
http://liliputing.com/2016/01/jide-releases-remix-os-source-code-to-comply-with-gpl-apache.html
Click to expand...
Click to collapse
Okay, I sended a support ticket aswell did you make any progression in the meantime?
I manged to compile the kernel and make it work!, if you need more details let me know
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Categories

Resources