[PROJECT][PORT] Go4Droid v1 | write,run,compile Go Lanuage codes on your phone ! - Android Software/Hacking General [Developers Only]

{
"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"
}
about Go Language
Go, also called golang, is a programming language initially developed at Google in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson.It is a statically-typed language with syntax loosely derived from that of C, adding automatic memory management, type safety, some dynamic-typing capabilities, additional built-in types such as variable-length arrays and key-value maps, and a large standard library. Beyond that broad category, Go is defined by:
-A syntax and environment adopting patterns more common in dynamic languages:
Concise variable declaration and initialization through type inference (x*:= 0 not int x = 0.
-Fast compilation times.
-Remote package management (go get).and online package documentation
-Distinctive approaches to particular problems.
-Built-in concurrency primitives: light-weight processes (goroutines), channels, and the select statement.
-An interface system in place of virtual inheritance, and type embedding instead of non-virtual inheritance.
-A toolchain that, by default, produces statically linked native binaries without external dependencies.
-A desire to keep the language specification simple enough to hold in a programmer's head,in part by omitting features common to similar languages:
no type inheritance
no method or operator overloading
no circular dependencies among packages
no pointer arithmetic
no assertions
no generic programming
about Go4Droid
Although Go is a Google project ,it has not option for building for Android !Also It has there is no way to use it on your Android device and do compiling(instead of cross-compiling) (beacuase it does not building for external host and target).All this reasons made me think about this project and finally I ported a complete set of Go compiler, Go linker, Go Packages and also net support !.
You can easily write go codes , compile them, run them and install them. There are lots of packages which let you write amazing programs.
prequisites
minimum :
- Root privilege
- ARMv7 (vfpv3) SoC.
- Android +1.6 (linux kernel +2.6)
- 80 MB free space in system partition
- CWM/TWRP installed
suggested :
- Root privilege
- ARMv7 (vfpv3) + NEON SoC.
- Android +4.2 (linux kernel +3.4)
-150 MB free space in system partition
- CWM/TWRP installed
installation
- Download zip file.
- Install CWM/TWRP.
- Ready !
usage
This thread is not supposed to be a GoLang tutorial , however I explain main options.
* Do not forget to get root before anything :
Code:
su
1- Use this command to run a .go file (file = helloworld.go):
Code:
go run helloworld.go
2- Use this command to compile a .go file and generate an executable :
Code:
go build helloworld.go
./helloworld
3- Use this command to compile & install a code file:
Code:
go install helloworld.go
helloworld
example
Code:
package main
import "fmt"
func main() {
fmt.Println("Hello, World")
}
download
Go4Droid v1
*intial release
help the project
Every single build takes +30 minutes on my Android device so it would be difficult to manage this project. You can help me by donating me a VPS/Dedicated server then I will be able to update and manage this project faster and better.

reserved

Well done man! I'm trying it now
Will report results soon

I 've spend +10 hours on this project for 0 people using it !

That's great, man. You beat Google to it!
This looks interesting, but without access to the UI or Android APIs, we're pretty limited, right?

raveur said:
That's great, man. You beat Google to it!
This looks interesting, but without access to the UI or Android APIs, we're pretty limited, right?
Click to expand...
Click to collapse
There is no Android JNI support yet (and unfortunately no plan to do it). However it has a great builtin API with net,archive,fs,os,image,... support.

Great project,
Thanks for that.

Still no NDK support for Go?

myfreeweb said:
Still no NDK support for Go?
Click to expand...
Click to collapse
Go has no Android JNI support thus there is no Go support in NDK .

Related

[ROM Huawei Ideos U8150] DroniX 0.2 is out!

DroniX 0.2
{
"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"
}
Caratteristiche:
The DroniX ROM is not like any other ROM for this device.
The aesthetic part is taken care of just to be fluid and functional, there are many installed app defaults to Google but those originals and some interesting Utility.
ChangeLog:
- ADB Rooted
- Rooted phone
- Deodex application and framework
- ZipAlign
- Fix shell adb in a standard GNU/Linux
- Enabled /etc/init.d standard GNU/Linux
- SSH Client
- SCP
- tcpdump
- nmap
- ncat
- sqlite3
- Kernel UnderClock to 61mhz
- Auto configuring CPU to start device
- Set LauncherPro to default Launcher with fix for improve the speed
- Added DSPManager
- IP Webcam (to use the phone as an IP cam )
- mini_httpd (light web Server)
- dropbear (SSH SERVER)
- DroniX Web Manager
Istruzioni:
To install the rom you have to use the recovery modified "UltraJack"and make all the wipe. It 's not necessary to partition the sdcard, indeed you can also install the stuff inside the phone without it.
As you can see other utilities have been added at a low level and I think that many Linux enthusiasts will be happy.
In particular, there is SSH client that can be used to create the tunnel connection to the remote server, who knows what he understands what I'm talking
DroniX Web Manager::
This is a novelty and this application you can pull off a nice utility for remote device management. The application runs on web server I compiled "mini_httpd"and is reachable if you bet the IP of your phone ..
here is a screen:
Another important thing is the underclock. That will allow you to save battery ... If you want advanced configuration of frequency, I recommend you install SetCPU or similar ..
app2SD: As you have noticed this ROM there's nothing for the movement of applications on the SD but if you want you can install the script made ​​by darktremor:
File ZIP: http://www.darktremor.info/files/a2sd/dtapps2sd-2.7.5.3-beta02-signed.zip
GUI: http://goo.gl/2Ohmc
All Repository: ftp://dtuser:[email protected]/
To install is simple, it first installed the ROM, then once installed restart to recovery mode and partitioned using the sd ext2 partition and copied the zip dtapps2sd and flash your device as a normal ROM without wipe.
Be careful if something goes wrong you have to reinstall the entire ROM again!
ROM link:
DroniX Official 0.2
Unfortunately I wanted to publish the experimental version, with a 729mhz REAL overclock, but unfortunately I still can not understand whether it is stable enough to be published.
In all cases the public as soon as possible;-)
If the ROM you like you can make a free donation: DroniX Development...
Traslate with Google..
This thread should be moved to:
Android Software Development
EDIT: looking nice btw
Great.. crosscompiling the net tool, how about aircrack-ng? but i think, will not supported by wifi chipset.
Good work indeed!
Why you don't implements the SD read cache fix?

[HOWTO] Setup Linux shell on Windows | Allows Windows to run Linux commands!

Want to do something like this on your Windows OS?
{
"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"
}
Fear not, in this tutorial, you will learn on how to install a linux shell on your Windows OS!
To install a linux shell on Windows, there's a few solutions solutions that I usually prefer:
Msysgit
Cygwin
Powershell
In this tutorial, Msysgit is the program that will be installed as apart from giving you a linux shell, it gives you access to do git related things(clone a repo, fork repo) which is a very good plus
So, here's it, we'll install a linux shell on our Windows OS and have fun with it later on
Msysgit Installation:
1. Click here and download the latest version of msysgit(The latest version of the time of writing is 1.8.0 http://code.google.com/p/msysgit/downloads/detail?name=Git-1.8.0-preview20121022.exe&can=2&q=)
2. Open the installer and you will see something similar to this and click Next to continue
3. After that, you will be shown the gpl license as per shown below and click Next to continue
4. You will be prompted the location to install msysgit at. Click Next to continue
5. You will be prompted for additional settings, click Next to continue.
6. You will be prompted for the startup menu, click Next to continue.
7. You will be prompted for the path environment, select Use Git Bash only and click Next to continue.
8. You will be prompted for the line ending adjustment. Select Checkout as-is, commit Unix-style line endings and click Next to continue.
9. The installer will install the required files.
10. The installation has finished! Untick ReleaseNotes.rtf and click Finish to end the installation.
How to use:
1. Right click on an empty space at your desktop and click Git Bash.
2. Type your linux "hackish" commands!
The command that is used in the first screen shot is ls -la(directory listing with the file permissions of each file).
There's a lot of commands that you can play with, like echo, cat, uname, which, grep, sed, and many many more!
NOTE #1: For the best compatibility, cygwin would be preferred as it has a very complete set of linux commands built-in but Msysgit is less hassle to setup and it allows you to mingle around with Git once the setup is done which is a very good thing
NOTE #2: Msysgit is not preferred as a shell to create anything advanced like roms or kernels as the features that are available at mysysgit is rather limited(but it is enough for most users like us ).
There will be more tutorials which are related to Git and Linux will be made in the future, so read up fast and stay tuned for more contents! :fingers-crossed:

[APP] AROMA Installer

{
"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 World's First ANDROID Touch And Customizable ROM Installer
When you install Linux, Windows, Mac or applications on the PC
You can always customize your installation as you want.
WHY CAN'T WE DO THE SAME INSTALLING AN ANDROID ROM?
BECAUSE NOW
AROMA Installer
GIVES YOU THIS POSSIBILITY!​
BackgroundAndroid has an advanced system for installing the OS and updates, unlike other mobile OS's that distribute the contents of the OS in static ROM image(s), Android distributes the OS and updates in a plain .zip file that contains all of the packages, files, and the updater for processing the installation.
The updater splits in 2 types, the binary (update-binary) and script (updater-script), while the binary is an executable file, and the script was a configuration script that tells the binary executable what to do.
But this advanced technology never expanded into its highest potential ability. The update-binary was simply the linux executable wrote in C that runs in root mode, and can do anything to your system; including accessing the Display FrameBuffer, accessing keys and the touch screen, set vibrate, run programs, parse files, load png(s) and .zip's, and read and write to the filesystem.
The old update-binary only supported a few functions that can controlled only by the updater-script to instal the files. It didn't have a single function that allowed the installer to interact with the user. There is a program called "yesno" that shows a "Yes" or "No" interface, but it wasn't enough to create a more customizable updater.
Now with AROMA Installer update-binary, all of this limitation is gone, and this advanced technology is expanded to the highest level of its pontential.​Read More at amarullz.com [+]​
What is AROMA Installer"AROMA" was taken from Bahasa Indonesia (Indonesian Language) and it means "Scent", but it is also an abbreviation of "AMARULLZ ANDROID ROM MANIFESTATION". It is an advanced update-binary for Android that contains many features like Wizard Installation, Touch User Interface (AROMA UI), Customizable Packages, System Inspecting, Themeable, and User Interactive. All release versions will have "flower" codenames, for example, the 1st version is codenamed "Anggrek", which mean "Orchid".​
How AROMA Installer WorksHow can it work in recovery mode, and how can it so smooth when it scrolls? It works because I hired Chuck Norris to force the recovery to run the installer, and the phone is too afraid to show any lag .
No, seriously, when the user selects the .zip file to install it, the recovery will extract the update-binary and run it with a few arguments. All processes are handled by the update-binary, and the recovery will only show the information passed by update-binary via a custom pipe. The great thing is that the update-binary can do anything if we can code it in C/C++, but not all people can easily play with C/C++. Its also not very effective or fun to compile it every time we need to change the process. That's why the custom script is used in AROMA Installer, it is simply edify scripting that is used as the normal updater-script, but with expanded functions available.
It wasn't a simple thing to archive something like this, because the update-binary is simply the "linux executable" that doesn't even support dynamic links of libraries, basic drawing functions like drawrect, drawline, and I don't think it OpenGL can be included in it's binary. It runs on it's own. Even User Interface was wrote from scratch to manipulate directly into the display framebuffer, user input was read directly from the raw kernel input device, png and .zip was read with a static link library, and the configuration was parsed in it's own program. It is the result of one full month of developing, but you can learn it instantly, without any need to know how to manage memory usage and pointers.
The AROMA Installer will read, parse, and run the script commands to show it's UI, calculate partition sizes, create, read, and write temporary prop files, set & get variables, do simple integer comparisons and math sequences, do the if else or inline if conditions, configure the UI color scheme, configure rom information, and much more.
Because it was very complicated and needed a lot of time to develope, did I earn some reason to get donations?.​Donate To Me [+]​
Flowchart How It Works
​
more at amarullz.com [+]​​
XDA:DevDB Information
AROMA Installer, a App for the No Device
Contributors
amarullz
Version Information
Status: Beta
Current Stable Version: 2.56
Stable Release Date: 2012-10-04
Current Beta Version: 2.70 BETA-6
Beta Release Date: 2013-06-24
Created 2013-08-17
Last Updated 2013-08-17
Dear sir,
I am from Viet Nam: Dev Team VN.
At Viet Nam, We always use your AROMA for ROM.
AROMA's very perfect.
Millions of thank you. (Sorry, I am limited to 8 thanks per day so I can not thank to this thread)
Last time, I remember when we use 40a2sd script for SDCard_to_internal
we were very happy.
- Finally -
Thank you so much, I do not know what to say in addition of thanks
"Cảm ơn các bạn" This is a sentence of Vietnamese.
If you need anything from us, we are ready
“The Friendship” is one of the most beautiful affections of mankind.
“The Friendship”of Indonesia’s team and VietNam’s team in particular and all countries in the world in general.

[TOOL][WINDOWS] HAT- Hybrid APK Tool - Bringing New Era of Modding!

INTRODUCTION
{
"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"
}
What is HAT?​Well, HAT is short-form of Hybrid APK Tool. HAT makes decompiling/recompiling of all apk files easy as 1 2 3, HAT supports both apk's and jar files and is very easy to work with. HAT provides all features necessary for any modder/user.
Why use HAT?​Honestly, that's up to you. There are many tools out there but mostly fail at critical times but HAT can be a good bet.
FEATURES​
● Fast and light (Only 11 mb).
● High success rate while decompiling/recompiling.
● Special method of decompiling/recompiling jar files! Never seen before this method will never fail and you can easily edit any jar file (deodexed jar). HAT uses special method for the process.
● Avoid bootloops while editing framework-res.apk especially for SONY devices. HAT uses special method that avoids bootloops.
● Real time logging. Generate logs for every action.
● Choose your own version of apktool. Currently HAT comes with two versions of apktool (the folder is hidden due so to avoid any unwanted deletion of the folder, kindly enable the show hidden files option). To use your own version of apktool keep your apktool in "tools/apktool" folder
● Normal method of decompiling and recompiling of jar also present giving two methods to simultaneously work at jar files/
● Clear the junk files if too populated
HOW TO USE​
Simple just download the file and extract it in core C: drive. It should be C:HAT or it won't work
DOWNLOAD​
Here is the download link for the tool - DOWNLOAD HERE
FAQ
Q) I open HAT.exe and it shows a black screen and closes. Why?
Ans) Two possible reasons a) You have not extracted it in C: drive
b) You have space in your username eg Tech N You instead of TechNYou
Solution
a) Extract it in C and execute
b) Make a new account with no space in between
Q) I see errors related to java, what are they?
A) To work with apk's and jar's you must have JAVA installed on your machine. Install JAVA then proceed also if you have java installed make sure it has been defined in system path
Q) I have java still I face errors, why?
A) Reason is java not defined in system. Open cmd and type "java" and "javac" (without quotes) and press enter if you get error(s) like :"java" or "javac" is not an external or internal command define java in your PC. Search google on how to.
If you get some response on trying both commands it's an issue with tool. Please report here.
Q) Do I need anything else than java?
A) No you don't need anything else than java. Recommended latest version java
CREDITS​
@iBotPeaches for apktool
@JesusFreke for smali/baksmali
@Ticklefish for his awesome Tickle my android! Best tool so far!
@BDFreak for his AdvancedAPKTool
Me for creating this tool
XDA:DevDB Information
HAT - Hybrid APK Tool for Windows, Tool/Utility for all devices (see above for details)
Contributors
Tech N You, Tech N You
Version Information
Status: Stable
Current Stable Version: v1
Stable Release Date: 2015-03-31
Created 2015-03-30
Last Updated 2015-03-30
CHANGELOG​● v1 Initial Release​
Reserved.
Mirror needed for this awesome tool also.
Download link for H.A.T not working! Please post working one. Thanks
babydouggie said:
Download link for H.A.T not working! Please post working one. Thanks
Click to expand...
Click to collapse
babydouggie is correct and the Link is still not working anyone got a working link please ?
download link not working !!!

[GUIDE][KERNEL][MOD] Patching out CONFIG_MODULE_SIG_FORCE on stock kernels

This is a guide for advanced users to remove the effect of CONFIG_MODULE_SIG_FORCE on stock kernels. This can be used to load custom modules you built or in building TWRP where you want to use a stock kernel and leverage the vendor partition to make the image smaller and still have it work on different variants.
The prerequisite here is a raw kernel image. Modern AARCH64 devices generally just gzip the kernel, but other compression formats can be used as well as decompression code prepended to the compressed kernel which will have to be cut out and stitched back in once the modifications are made.
If you don't already have Ghidra installed, go ahead and install it as it will be the analysis tool used here.
The first step is to launch Ghidra and create new project, then drag your kernel binary into the active project.
{
"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"
}
If the processor architecture is not filled in, it's probably missing the header, and you'll have to choose it from the list. If the file is unknown, you'll need to try different options until the disassembly looks correct. Then you can double-click the project file to open in Ghidra. Click analyze and let it process the binary until the hourglass at the bottom right disappears.
Our primary method for obtaining information and locating our target code is though strings.
Select Search - > For strings... and have it search the entire binary
Since Linux is open source, we start by finding which exact version we are dealing with. Filtering the strings dialog for "linux" yields the version string, in this case Linux version 4.19.95-perf.
Our target is to disable the effects of the CONFIG_MODULE_SIG_FORCE, so we need to find references of it in the kernel source tree. After reading through the code, we find our target function module_sig_check in module.c
https://elixir.bootlin.com/linux/v4.19.95/source/kernel/module.c#L2789
There are no strings referenced in this function, so we have to track/backtrack through called/calling functions to find one that is near the function we are looking for. In the called function mod_verify_sig we find a good candidate "%s: Module is not signed with expected PKCS#7 message"
module_signing.c - kernel/module_signing.c - Linux source code (v4.19.95) - Bootlin
Elixir Cross Referencer - Explore source code in your browser - Particularly useful for the Linux kernel and other low-level projects in C/C++ (bootloaders, C libraries...)
elixir.bootlin.com
Double-clicking in the strings dialog takes us to were that string is stored and also gives us an XREF that we can double-click to get to the code referencing it
If we scroll up to the start of the function we have landed in, we get another XREF(bottom of the highlighted section) that will land us right in the middle of module_sig_check
We have now landed in a very large function, much larger than module_sig_check. This is a result of compiler optimization. The compiler has merged several functions together and much of the code has been optimized out making it harder to follow.
My approach to patching this is to find the beginning of the first IF statement and have the code there jump directly to "info->sig_ok = true". The disassembly is directly linked to the decompiler, so you can click and select code in either window to see the corresponding code on the other side.
Our first target
Code:
if (flags == 0 &&
info->len > markerlen &&
memcmp(mod + info->len - markerlen, MODULE_SIG_STRING, markerlen) == 0) {
looks like this decompiled(partial):
Code:
if ((param_3 == 0) && ((char *)0x1c < param_1[3])) {
Highlighting the decompiled code, we find the first instruction to be here:
Code:
001224f0 96 01 00 35 cbnz w22,LAB_00122520
Doing the same for our second target
Code:
info->sig_ok = true;
which looks like this in the decompilation:
Code:
*(undefined *)((longlong)param_1 + 0x54) = 1;
leads us the corresponding instruction:
Code:
00122574 68 52 01 39 strb w8,[x19, #0x54]
But our true landing point is actually one instruction above it:
Code:
00122570 e8 03 00 32 mov w8,#0x1
This instruction sets the w8 register to 1 which is in turn used to set info->sig_ok. Skipping this would cause it to be set to whatever is on w8 at the time, which could be anything.
With both targets, we can start patching. Right-click the cbnz instruction at 001224f0 and select Patch Instruction. Once it's done processing, we set the first field to "b" for the branch instruction and the second to "0x00122570" for branch target followed by enter. Now we end up with
Code:
001224f0 20 00 00 14 b LAB_00122570
and the decompilation will reflect the change in code flow after giving it time to update.
Finally we can go to Export Program..., set the format to Binary and press OK to save the modified binary.

Categories

Resources