Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all 3614 articles
Browse latest View live

[SCRIPT] Proprietary Lib Cleaner (silence logcat spammers with ease)

$
0
0
Proprietary Lib Cleaner (PLC)
Linux shell script that allows you to silence certain lines from chatty proprietary binaries/libs which makes logcat actually readable, instead of it getting spammed by binaries such as mpdecision or thermal-engine.
Made with intention to be easily extensible for end-user. (would love to see a big database of hexxable strings)





Why I have created it.
I have made this shell script because I have experimented earlier with replacing hex strings in proprietary files, which worked out very well. I have had a lot of hassle trying to make the hex string replace work. But I found this great tool called Swiss File Knife that allows you to make hex replacements by just entering the string. Because of this it was very easy to create a template system so that users can easily add more entries to the database, rather then needing to adjust code of script every time.





The template system works like this:
Every binary/library is placed in the corresponding directory but in a virtual replication, in these files are the lines that need to be hexxed out of the binaries are present. nothing less nothing more.





Example 1:

~/ProprietaryLibCleaner/dbs/system/bin contains mpdecision which is a regular text file with the following strings inside it:

Code:

num online cores: %d reqd : %d available : %d rq_depth:%f
num online cores: %d reqd : %d available : %d rq_depth:%f hotplug_avg_load_dw: %d
UP cpu:%d core_idx:%d Nw:%f Tw:%d total_time_up:%f
DOWN cpu:%d core_idx:%d Ns:%f Ts:%d total_time_down:%f
cpu%d: core_idx: %d uptime: %f downtime %f
cpu%d: core_idx: %d Nw: %f, Tw :%d, Ns: %f, Ts: %d, util_high_and:%d
cpus_up: %d cpus_down: %d thermal_mask: 0x%x

Example2:
~/ProprietaryLibCleaner/dbs/system/lib/hw contains sensors.msm8960.so which is also a regular text file since its a patch, it only has a simple reference inside (but a very annoying one)

Code:

mCompEngine is NULL
These 2 examples are listed in the shell script, when more is added it is automatically appended in the 'database'




Last but not least is the patching process which is done on a 'fail-safe' method, it first checks whether its actually applicable before making any changes, if not it will skip it, so it won't make your files unusable







Instructions for normal usage:
1. Download latest release
2. Unpack somewhere on PC
3. Run script with ./PLC
4. Install ADB + ADB USB Driver if not installed
5. Install Swiss File Knife on Phone if not installed
6. View targets & patches
7. Set target and patch
8. Profit



Downloads:


Latest version: v0.5 -
here or here

Github page: https://github.com/broodplank/ProprietaryLibCleaner

Attached Files
File Type: zip 0.5.zip - [Click for QR Code] (772.8 KB)

[Guide] [MOD] Tweakers Kit...Modified init.d and sysctl system + Flashable Disabler

$
0
0
Warning
If you read this you may go blind and never become erect again.
And there is a possibilty a sattelite will fall from the sky and crush your house


This most likely can be incorparated into any rom on any phone
Feel free to post this anywhere and include it in any rom(Just Give Proper Credit)


I made this about a year ago .Works quite well
it makes tweaking very easy
designed to make tearing apart full tweak scripts apart and testing lines a nd full scripts e easy.
allows you to make up to 7 totally different init.d profiles . the ability to turn on or off any profile.
So now you can develop 7 profiles to boot from and run any profile in realtime
also gives you 2 sysctl.conf to boot from and two more to run in realtime

you need root and busybox

the contents of the foldet ( etc) go in /etc
the contents of ( bin) go in /system/bin the 6 files containing (run) need to be executeable
now you can put install-recovery.sh in /etc to get everything to run at boot
if you have Gametheorys kernel you can use the sysinit i provided in / system/ bin

if you already have either of these used by something else just add the lines from mine to yours


init.d
put scripts in the main folder like normal
there are folders in side
prof1 to prof 6
you can set scripts in those
the foldercalled Scripts is to store unused stuff
also is the initd control where you can use root browser root explorer or any scriptmanager to run the (on,off or run) scripts
Note, i cleaned out all my scripts but decided to leave the main folder with a setup i use the most Remove them or use at your risk

now you have
sysctl.conf through sysctl.conf4 in your /etc folder
load those with sysctl settings
init the init.d/scripts/sysctl are scripts to turn on or off sysct1 and 2 and run 3-4 in tealtime

More (run at will) profiles
init.run folder
load setups in run1 to run6 folders
at anytime use the control panel in init.run to exec any ofrun1 through run6

Note all profile folders have a subfolder labeled (a) those are just like pocket folders to store unused scripts

FLASHABLE DISABLER
This design has something very valuable
each profile has its own (applet) in /system/bin
the install-recovery.sh execs all init.d and prof1 through prof6 applets
but when you use the control panel to turn on or off the profiles you are sinply changing the permissions to each (applet)
So incase you put a bad script in and boots up in a loop or something else
i made a flashable zip of all the bootable (applets) with permissions all at zero
This will render all the bootable profiles un executeable
your new init.d script throws you in a loop flash the
InitdDisableall.zip below and reboot
None of the profiles will execute

So this basically gives you 7 init,d folders . you can choose which ones to boot from
for instance
i load one folder with my settings.one core turned off and cpu set at 810 and a clogged up conservative governor with agressive lmk

say i want to convert movies or play games i boot from an init,d folder i loaded with both cores at full cpu and multitasking lmk and a different governor set for speed

And i added a realtime run feature
this means i can exec any of these folders in realtime without rebooting
Then as an added bonus there is an additional folder that allows you to load your profiles to 6 more folders that you can easily exec in realtime without booting

the sysctl has the same idea
you get 2 sysctl.conf you can load with different settings and choose which one to boot from
plus 2 more sysctl.conf to load that you can run in realtime

The idea is to be able to have many Profiles of settings prefabbed and the ability to exec them quickly

This makes switching from performance and battery saving very easy

It makes testing and designing your profiles very easy as well

Now if you look at Sepero's Bootbuddy
it runs scripts at boot from the ext sd
this is awsome for me, when testing scripts i test some from bootbuddy
i use this for certain things like build.prop or certain kernel tweaks that i am not confident about
if this tweak causes a bootloop i can remove the sd card and bootup without the tweak
after several bootups with no issue, i move the tweak from bootbuddy over to init.d
But if you only want to use bootbuddy and not init.d i added 2 more bootable folders so you can choose from 3 profiles to boot from or turn all off

HOW To Develop your profiles

When i start on a new phone this is my formula
first i find supported govenors
i choose the slowest governor
then make an init.d script to load the governor of choice at boot
Then i clog up the governor,this means i slow it down
I change the settings so it doesnt scale up very fast and scales down instantly
Maybe lengthen the duration between mpdecisions
This is awesome for battery use and further testing

Next I want to start chopping away at the cpu, So I remove all cpu cores but 1
then limit the cpu to a lower scale
I usually start nat around 900 mhz

Example
The lg motion with Gametheory's oc kernel with added governors
i used the Conservative governor setwith
sampling down 1
up threshold 96
down threshold 95 ( or higher)
one core on only running at 918 mhz

So now your phone is much slower,Much better battery life but less responsive
do an antutu benchmark
make sure to look at the Details,each individual score
NOTE if you dont know how to get started
use an app like Kernel tuner
check the settings and selected run at boot with init.d
close kernel tuner it will create an init.d script for you
now go to your init.d folder and make a copy of the script
go back to Kernel Tuner and Disable the run at boot settings. it will remove its scripts
but you have your copy

Now for the ease of profiling you need to Batch your tweaks
small and identical for easy swapping and removal
like all vm tweaks in a script only ,net tweaks in a script only
and save the varied settings in a folder
when you are done you will have several folders of batched tweaks
forinstance various Governor tweaks like i posted below
The Ondemand Governor
A init.d script to load the Ondemand governor with stock settings
but it has 4 scripts for ondemand governor with Slower settings and 4 with above stock settings
Do this for every governor you use
The same with cpu max limits

From here on the idea is to chop away at the cpu but keep the score the same or better (when i am done i will run the phone at 594 or 702 but is close to responsive as the 918,and when i run the phone at stock or better phone is fassst)

Running the phone at core only and at lower speeds make its much easier to indentify the results of individual tweaks
Next you need to look at your system
/proc/sys is a good place to start
here are many settings we are gonna start changes to optimize our phone.
fs,kernel,net and vm settings are here
Its nice to know this as many phones have the same files found here but a few may vary

Please Check Attact File For Download
Tweak Pak Is Not Flashable.


I Am Not Responsible For Any Damage To Your Device. Try It At Your Own Risk.

Sorry For My Bad English
Hope You Understand What I Want To Say
Credit To rhino889a

[PAKAGE] [KK+] [GAPPS] [Gplay Only]

$
0
0
Hello, AOSP kk+ users
I searched a lot for this pakage, but i didn't found any one
so, i broght to you a simple, but advanced pakage
it will remove that gapps bloat
then it will install it agin, but only with Google play and it's core apps to work properly.
So, no more bloat,
Just flash it via recovery
Enjoy it!
Download it>>>>>HERE

Regards...

Change Background Image Of Your CWM Recovery - THE EASY WAY

$
0
0
Only For Windows Operating System .. !!!

So It is a post for beginners who want to just look inside the recovery.img and do some modification like changing the default background image to a custom image. So without wasting any time here We Go....

Requirements :

Quote:

  • Recovery.img (Most Important) :p
    Boot/Recovery repack utils for WINDOWS by @michfood
    Any Image editor Like Photoshop Or GIMP .

Procedure :

Quote:

  • Just place the recovery.img in the same folder where You extracted The boot/recovery repack tool.
  • Drag and drop recovery.img on MTK_Unpack and it will split the recovery into its parts.
  • Now browser into recovery > rmdisk > res > images open the images edit them or replace them with your desirable .png's.
  • Now again drag the recovery folder and drop on MTK_pack after Modification.

Voila .!!!!!!!!
You are Done with changing the background of your custom recovery.
*/ Just Flash This Recovery In FastBoot. :D

PLEASE PRESS THANKS INSTEAD OF TYPING :fingers-crossed: THANK YOU FOR UNDERSTANDING :o

[DEV] [GUIDE] [LINUX] Comprehensive Guide to Cross-Compiling

$
0
0
What is a Cross-Compiler?
Quote:

A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. Cross compiler tools are used to generate executables for embedded system or multiple platforms. It is used to compile for a platform upon which it is not feasible to do the compiling, like microcontrollers that don't support an operating system. From wikipedia

How is that connected with an Android?
In order to create a native C/C++ binary for an Android, you must firstly compile the source code. Usually you can't do so on an Android itself due to lack of proper tools and environment, or hardware barriers, especially amount of RAM. This is why you should learn how to cross-compile, to create a binary on your PC, that your ARM-based Android will understand.


Why do I need it?
You need to learn cross-compiling technique if you want to run native C/C++ programs on an Android. Actually, if you've already built your own custom ROM from AOSP sources (i.e. CyanogenMod), then you used cross-compiling tools and methods even without noticing :).
Building an AOSP ROM is fairly easy, there's one command like brunch, which does the job. However, what if you want to compile a custom, not natively included binary? This is the purpose of this tutorial.


What I will learn from this guide?
  • How to properly set C/C++ building environment
  • How to build a native C/C++ application for Android device
  • How to optimize native binaries for my device



Step 1 - The Beginning
You should start from installing any Linux-based OS, I highly suggest trying a Debian-based distro (such as Ubuntu), or even Debian itself, as this tutorial is based on it :).

In general, I highly suggest to compile an AOSP ROM (such as CyanogenMod) for your device firstly. This will help you to get familiar with cross-compiling on Android. I also suggest to compile one or two programs from source for your Linux, but if you're brave enough to learn cross-compiling without doing any of these, you can skip those suggestions :).


Step 2 - Setting up
Firstly you should make sure that you have all required compile tools already.

Quote:

apt-get update && apt-get install checkinstall
This should do the trick and install all required components.
I suggest creating a new folder and navigating to it, just to avoid a mess, but you can organize everything as you wish.

Start from downloading NDK from here.
Quote:

The NDK is a toolset that allows you to implement parts of your app using native-code languages such as C and C++.
Quote:

root@ArchiDroid:~# wget http://dl.google.com/android/ndk/and...x86_64.tar.bz2
root@ArchiDroid:~# tar xvf android-ndk-r9d-linux-x86_64.tar.bz2
root@ArchiDroid:~# mv android-ndk-r9d ndk
Now you should make a standalone toolchain, navigate to root of your ndk (this is important) and then build your toolchain:
Quote:

root@ArchiDroid:~# cd ndk/
root@ArchiDroid:~/ndk# build/tools/make-standalone-toolchain.sh --toolchain=arm-linux-androideabi-4.8 --platform=android-18 --install-dir=/root/ndkTC
Copying prebuilt binaries...
Copying sysroot headers and libraries...
Copying libstdc++ headers and libraries...
Copying files to: /root/ndkTC
Cleaning up...
Done.
You should edit bolded variables to your preferences. Toolchain is the version of GCC you want to use, 4.8 is currently the newest one, in the future it may be 4.9 and so on. Platform is a target API for your programs, this is important only for android-specific commands, such as logging to logcat. When compiling a native Linux program, this won't matter (but it's a good idea to set it properly, just in case). Install dir specifies destination of your toolchain, make sure that it's other than ndk (as you can see I have ndk in /root/ndk and toolchain in /root/ndkTC).

Now you need to download my exclusive cc.sh script from here and make it executable.

Quote:

root@ArchiDroid:~# wget https://dl.dropboxusercontent.com/u/...79/Files/cc.sh
root@ArchiDroid:~# chmod 755 cc.sh
This script is a very handy tool written by me to make your life easier while cross-compiling. Before running it make sure to edit "BASIC" options, especially NDK paths. Apart from that it's a good idea to take a look at DEVICEFLAGS and setting them properly for your device, or clearing for generic build. You don't need to touch other ones unless you want/need them.

Just for a reference, I'll include currently editable options:
 
Quote:

#############
### BASIC ###
#############

# Root of NDK, the one which contains $NDK/ndk-build binary
NDK="/root/ndk"

# Root of NDK toolchain, the one used in --install-dir from $NDK/build/tools/make-standalone-toolchain.sh. Make sure it contains $NDKTC/bin directory with $CROSS_COMPILE binaries
NDKTC="/root/ndkTC"

# Optional, may help NDK in some cases, should be equal to GCC version of the toolchain specified above
export NDK_TOOLCHAIN_VERSION=4.8

# This flag turns on ADVANCED section below, you should use "0" if you want easy compiling for generic targets, or "1" if you want to get best optimized results for specific targets
# In general it's strongly suggested to leave it turned on, but if you're using makefiles, which already specify optimization level and everything else, then of course you may want to turn it off
ADVANCED="1"

################
### ADVANCED ###
################

# Device CFLAGS, these should be taken from TARGET_GLOBAL_CFLAGS property of BoardCommonConfig.mk of your device, eventually leave them empty for generic non-device-optimized build
# Please notice that -march flag comes from TARGET_ARCH_VARIANT
DEVICECFLAGS="-march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp"

# This specifies optimization level used during compilation. Usually it's a good idea to keep it on "-O2" for best results, but you may want to experiment with "-Os", "-O3" or "-Ofast"
OLEVEL="-O2"

# This specifies extra optimization flags, which are not selected by any of optimization levels chosen above
# Please notice that they're pretty EXPERIMENTAL, and if you get any compilation errors, the first step is experimenting with them or disabling them completely, you may also want to try different O level
OPTICFLAGS="-s -flto=8 -ffunction-sections -fdata-sections -fvisibility=hidden -funswitch-loops -frename-registers -frerun-cse-after-loop -fomit-frame-pointer -fgcse-after-reload -fgcse-sm -fgcse-las -fweb -ftracer -fstrict-aliasing"

# This specifies extra linker optimizations. Same as above, in case of problems this is second step for finding out the culprit
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--relax -Wl,--sort-common -Wl,--gc-sections"

# This specifies additional sections to strip, for extra savings on size
STRIPFLAGS="-s -R .note -R .comment -R .gnu.version -R .gnu.version_r"

# Additional definitions, which may help some binaries to work with android
DEFFLAGS="-DNDEBUG -D__ANDROID__"

##############
### EXPERT ###
##############

# This specifies host (target) for makefiles. In some rare scenarios you may also try "--host=arm-linux-androideabi"
# In general you shouldn't change that, as you're compiling binaries for low-level ARM-EABI and not Android itself
CONFIGANDROID="--host=arm-linux-eabi"

# This specifies the CROSS_COMPILE variable, again, in some rare scenarios you may also try "arm-eabi-"
# But beware, NDK doesn't even offer anything apart from arm-linux-androideabi one, however custom toolchains such as Linaro offer arm-eabi as well
CROSS_COMPILE="arm-linux-androideabi-"

# This specifies if we should also override our native toolchain in the PATH in addition to overriding makefile commands such as CC
# You should NOT enable it, unless your makefile calls "gcc" instead of "$CC" and you want to point "gcc" (and similar) to NDKTC
# However, in such case, you should either fix makefile yourself or not use it at all
# You've been warned, this is not a good idea
TCOVERRIDE="0"

# Workaround for some broken compilers with malloc problems (undefined reference to rpl_malloc and similar errors during compiling), don't uncomment unless you need it
#export ac_cv_func_malloc_0_nonnull=yes


As you can notice, my magic script already contains bunch of optimizations, especially device-based optimizations, which are the most important. Now it's the time to run our script, but in current shell and not a new one.

Quote:

root@ArchiDroid:~# source cc.sh
Done setting your environment

CFLAGS: -O2 -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp -s -flto=8 -ffunction-sections -fdata-sections -fvisibility=hidden -funswitch-loops -frename-registers -frerun-cse-after-loop -fomit-frame-pointer -fgcse-after-reload -fgcse-sm -fgcse-las -fweb -ftracer -fstrict-aliasing -DNDEBUG -D__ANDROID__
LDFLAGS: -Wl,-O1 -Wl,--as-needed -Wl,--relax -Wl,--sort-common -Wl,--gc-sections
CC points to arm-linux-androideabi-gcc and this points to /root/ndkTC/bin/arm-linux-androideabi-gcc

Use "$CC" command for calling gcc and "$CCC" command for calling our optimized CC
Use "$CXX" command for calling g++ and "$CCXX" for calling our optimized CXX
Use "$STRIP" command for calling strip and "$SSTRIP" command for calling our optimized STRIP

Example: "$CCC myprogram.c -o mybinary && $SSTRIP mybinary "

When using makefiles with configure options, always use "./configure $CONFIGANDROID" instead of using "./configure" itself
Please notice that makefiles may, or may not, borrow our CFLAGS and LFLAGS, so I suggest to double-check them and eventually append them to makefile itself
Pro tip: Makefiles with configure options always borrow CC, CFLAGS and LDFLAGS, so if you're using ./configure, probably you don't need to do anything else
Command "source cc.sh" executes cc.sh and "shares" the environment, which means that any exports will be exported to our current shell, and this is what we want. It acts the same as AOSP's ". build/envsetup.sh", so you can also use . instead of source.
As you can see above, my script should let you know if it properly set everything, especially if $CC points to our ndkTC. It also set a generic "$CCC" and "$CCXX" commands, which are optimized versions of standard $CC. $CC points to our cross-compiler, $CCC points to our cross-compiler and also includes our optimization flags.
Quote:

root@ArchiDroid:~# echo $CC
arm-linux-androideabi-gcc
root@ArchiDroid:~# echo $CCC
arm-linux-androideabi-gcc -O2 -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp -s -flto=8 -ffunction-sections -fdata-sections -fvisibility=hidden -funswitch-loops -frename-registers -frerun-cse-after-loop -fomit-frame-pointer -fgcse-after-reload -fgcse-sm -fgcse-las -fweb -ftracer -fstrict-aliasing -DNDEBUG -D__ANDROID__ -Wl,-O1 -Wl,--as-needed -Wl,--relax -Wl,--sort-common -Wl,--gc-sections

Step 3 - Cross-Compiling
Now we'll compile our first program for Android!

Create a new file hello.c, and put inside:
Code:

#include <stdio.h>
int main (void)
{
  puts ("Hello World!");
  return 0;
}

Now you compile and strip it:
Quote:

root@ArchiDroid:~# $CCC hello.c -o hello && $SSTRIP hello
Remember that $CCC and $SSTRIP command will only work if you source'd cc.sh script explained above. $CCC command compiles source code to a binary with already optimized flags (device flags, optimization level, optimization flags, linker flags), while $SSTRIP command strips "bloat" from output binary, such as comments and notices. The purpose is to make a binary smaller and faster.

You can check if your binary has been compiled properly through readelf command.
Quote:

root@ArchiDroid:~# readelf -A hello
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "ARM v7"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3
Tag_Advanced_SIMD_arch: NEONv1
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_optimization_goals: Aggressive Speed
Tag_CPU_unaligned_access: v6
Tag_DIV_use: Not allowed
As you can see, I've compiled a binary optimized for ARM v7, with THUMB-2 instructions and NEON support. How nice! Is it because of device-specific flags? Let's check what happens if we use $CC instead of $CCC:
Quote:

root@ArchiDroid:~# readelf -A hello2
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "5TE"
Tag_CPU_arch: v5TE
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_FP_arch: VFPv2
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_enum_size: int
Tag_ABI_optimization_goals: Aggressive Speed
Tag_DIV_use: Not allowed
As you can see, if you do not specify flags, you'll lose major portion of optimizations. Of course binary will work properly, hence it has been cross-compiled for ARM, but we can always make it smaller and faster! :)


Step 4 - Testing
A favourite part of everything, tests! :)

Quote:

root@ADB:~/shared# adb shell
root@m0:/ # sysrw
root@m0:/ # exit
root@ADB:~/shared# adb push hello /system/bin/hello
95 KB/s (5124 bytes in 0.052s)
root@ADB:~/shared# adb shell
root@m0:/ # chmod 755 /system/bin/hello
root@m0:/ # chown root:system /system/bin/hello
root@m0:/ # exit
In above example I pushed my binary straight to /system/bin directory, which is in the Android's PATH. If you don't have rooted device that's not a problem, you can use /data/local directory or /storage/sdcard0. You can also upload your binary anywhere you want and download it as any other file, then run from /storage/sdcard0/Download, this way doesn't require even working ADB :). Just don't forget about setting proper permissions afterwards!

Now let's try to run it! :)
 


If your binary is not in the PATH, you should write full path to your binary of course. As I pushed my binary to /system/bin, I don't need to do so.
If everything finished successfully and you got your very first Hello World response as above, congratulations. You've just compiled and ran your first native C/C++ program on Android device.


What to do next?

In theory, you can now compile anything you want. Here are some apps that I'm using in my ArchiDroid ROM:
These are only a few examples. You can compile anything you want, or even write your own native applications. Good luck!

Android Forensic Project

$
0
0
Let me start this off by saying I'm sorry for posting this thread in this side forum which is designed for developers, I only done this so the thread can be recognized and hopefully I can get some expert advice.

I am a 2nd year Forensic Computing student (UK resident/university) and I've been looking into a final year project which involves some form of forensic analysis of a computing system. Ever since I bought my HTC One and I rooted it, I've become quite interest in android as a whole. As of late, my HTC became carrier blocked (I bought it on contract from an eBay seller and they blocked it and won't respond back) so in essence I have a glorified media player but still a powerful device.
I want to make my final year project (Which accounts for roughly 40% of degree) a forensic analysis of a rooted android phone.
I'm posting here (In the midst of developers) because I wish to attain advice and knowledge and some form of help (I'm not asking for anyone to do it for me, neither am I attempting to cheat) so I can produce a great project and a impressive dissertation.

Thank You (I'm sorry moderators but in normal forums, I don't know if this would have become recognized)

(Guide)How to port Ics lockscreen to Gb for Micromax a57 / A54/ Samsung galaxy y

$
0
0
I am Suraj

again with New guide

How to port ICs lockscreen TO GB

Tested On micromax a57 a54 Both are qualcom so cant say about samsung and other Mediatech or mtk device

THis is full explained Guide dont bore :p

So let start

We have to Follow 5 step for gettings ics lockscreen

first step here start

download this zip firststep.zip

1.copy res folder to your framework-res folder

2.
Open ids.xml under res/values foler and add these in last above

Code:

<item type="id" name="rl_multiWaveView">false</item>
    <item type="id" name="digital_clock">false</item>
    <item type="id" name="dateShow">false</item>
    <item type="id" name="iv_drop">false</item>
    <item type="id" name="ib_greenorange">false</item>
    <item type="id" name="rl_click_after">false</item>
    <item type="id" name="ib_photo">false</item>
    <item type="id" name="ib_greenorange_gone">false</item>
    <item type="id" name="ib_phone">false</item>
    <item type="id" name="tv_phone_unread">false</item>
    <item type="id" name="ib_sms">false</item>
    <item type="id" name="tv_sms_unread">false</item>
    <item type="id" name="ib_home">false</item>
    <item type="id" name="tv_remind">false</item>
    <item type="id" name="rl_multiWaveViewforsimulateics">false</item>
    <item type="id" name="iv_wave">false</item>
    <item type="id" name="iv_wave1">false</item>
    <item type="id" name="iv_wave2">false</item>
    <item type="id" name="iv_circle">false</item>


3.. compile the framework-res.apk

4.Now decompile your
framework-res.apk

Now open your public.xml
Leave it alone Now first step complete
:fingers-crossed:

TIME TO DO SECOND SEC0ND STEP

HERE WE START

dOWNLAOD THIS zIP.(SECOND STEP.ZIP)

thats our smalli editing part

1.Now decompile your android.policy.jar ( I GIVEN TOOL INSIDE)

NOW copy all smalli to your decompiled android.policy .jar folder one by one

Now open all files related to com\android\internal\policy\impl mine files

Search " 0x10" Copy the whole id .

Open my provided public.xml

Search for that id in my public.xml

Copy the text of that id.

Like if my Public id is "0x101000e"

but in you pubilc.xml it start from
"0x0101000e" means you have to add 0 before 1

its a boring part naa but its too much neccesarry too soo better you Do it carefully slow slow dont do fast other it will create reason for bootloop:cool:

NOW OUR 2ND PART IS COMPLETE nOW TIME TO START 3 PART

SO HERE WE START


DOWNLOAD THIS ZIP (THIRD PART.ZIP)

thats our Main and difficult part

in your android.policy.jar decompiled folder
search for LockPatternKeyguardView.smalli
open it ..
then search for

Quote:

.field private mScreenOn:Z
then below it add
Quote:

.field private mStartForIntent:Landroid/content/Intent;
then search for
Quote:

.method createLockScreen()Landroid/view/View;
then after

Quote:

.prologue
add this

Quote:

.prologue
.line 660
const-string v3, "true"

const-string v2, "ro.origin.lockscreen"

.line 711
const-string v0, "ro.origin.lockscreen"

const-string v0, "true"

invoke-static {v2, v3}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

const-string v1, "false"

invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_24

.line 712
new-instance v0, Lcom/android/internal/policy/impl/GreenOrange_LockScreen;

iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;

iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;

iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;

invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/GreenOrange_LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V

.line 726
:goto_23
return-object v0

.line 718
:cond_24
const-string v0, "ro.origin.lockscreen"

const-string v0, "true"

invoke-static {v2, v3}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

const-string v1, "simulateICS"

invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_44

.line 719
new-instance v0, Lcom/android/internal/policy/impl/SimulateICS_LockScreen;

iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;

iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;

iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;

invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/SimulateICS_LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V

goto :goto_23

:cond_44
then search for

Quote:

.method static synthetic access$100(Lcom/android/internal/policy/impl/LockPatternKeyguardView;)Z
.registers 2
.parameter "x0"

.prologue
.line 65
iget-boolean v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mIsVerifyUnlockOnly:Z

return v0
.end method
then add this code under

Quote:

.method static synthetic access$1000(Lcom/android/internal/policy/impl/LockPatternKeyguardView;)Landroid/content/Intent;
.registers 2
.parameter "x0"

.prologue
.line 65
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mStartForIntent:Landroid/content/Intent;

return-object v0
.end method

.method static synthetic access$1002(Lcom/android/internal/policy/impl/LockPatternKeyguardView;Landroid/content/Intent;)Landroid/content/Intent;
.registers 2
.parameter "x0"
.parameter "x1"

.prologue
.line 65
iput-object p1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mStartForIntent:Landroid/content/Intent;

return-object p1
.end method
Now our third step is completed
---------------------------------------------------------------------------------

Now our forth step here start

1. go to com\android\internal\policy\impl ( your decompiled android.policy.jar)


search for LockPatternKeyguardView$1.smalli

Now open it

then search for
Quote:

.method public goToUnlockScreen()V
then you will see this method
Quote:

.method public goToUnlockScreen()V
.registers 3


to
#calls: Lcom/android/internal/policy/impl/LockPatternKeyguardView;->updateScreen(Lcom/android/internal/policy/impl/LockPatternKeyguardView$Mode;)V
invoke-static {v0, v1}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->access$200(Lcom/android/internal/policy/impl/LockPatternKeyguardView;Lcom/android/internal/policy/impl/LockPatternKeyguardView$Mode;)V

goto :goto_8
.end method



so delete this full method

and add this
Quote:

.method public goToUnlockScreen()V
.registers 6

.prologue
const/4 v2, 0x1

const-string v4, "true"

const-string v3, "ro.origin.lockscreen"

.line 248
invoke-virtual {p0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->isSecure()Z

move-result v0

if-nez v0, :cond_3d

.line 249
const-string v0, "ro.origin.lockscreen"

const-string v0, "true"

invoke-static {v3, v4}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

const-string v1, "false"

invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_1f

.line 250
invoke-virtual {p0, v2}, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->keyguardDone(Z)V

.line 259
:goto_1e
return-void

.line 251
:cond_1f
const-string v0, "ro.origin.lockscreen"

const-string v0, "true"

invoke-static {v3, v4}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

const-string v1, "simulateICS"

invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_33

.line 252
invoke-virtual {p0, v2}, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->keyguardDone(Z)V

goto :goto_1e

.line 254
:cond_33
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

invoke-virtual {v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->getCallback()Lcom/android/internal/policy/impl/KeyguardViewCallback;

move-result-object v0

invoke-interface {v0, v2}, Lcom/android/internal/policy/impl/KeyguardViewCallback;->keyguardDone(Z)V

goto :goto_1e

.line 257
:cond_3d
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

sget-object v1, Lcom/android/internal/policy/impl/LockPatternKeyguardView$Mode;->UnlockScreen:Lcom/android/internal/policy/impl/LockPatternKeyguardView$Mode;

#calls: Lcom/android/internal/policy/impl/LockPatternKeyguardView;->updateScreen(Lcom/android/internal/policy/impl/LockPatternKeyguardView$Mode;)V
invoke-static {v0, v1}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->access$200(Lcom/android/internal/policy/impl/LockPatternKeyguardView;Lcom/android/internal/policy/impl/LockPatternKeyguardView$Mode;)V

goto :goto_1e
.end method

Now search for

Quote:

.method public isSecure()Z

then above it add this

Quote:

.method public isGotoUnlockscreen(Landroid/content/Intent;)V
.registers 3
.parameter "intent"

.prologue
.line 398
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

#setter for: Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mStartForIntent:Landroid/content/Intent;
invoke-static {v0, p1}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->access$1002(Lcom/android/internal/policy/impl/LockPatternKeyguardView;Landroid/content/Intent;)Landroid/content/Intent;

.line 399
return-void
.end method
================================================== ================================================== ====

Now search for
Quote:

.method public keyguardDone(Z)V
replace full method with

Quote:

.method public keyguardDone(Z)V
.registers 6
.parameter "authenticated"

.prologue
const-string v3, "true"

const-string v2, "ro.origin.lockscreen"

.line 334
const-string v0, "ro.origin.lockscreen"

const-string v0, "true"

invoke-static {v2, v3}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

const-string v1, "false"

invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_3c

.line 335
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

invoke-virtual {v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->getCallback()Lcom/android/internal/policy/impl/KeyguardViewCallback;

move-result-object v0

invoke-interface {v0, p1}, Lcom/android/internal/policy/impl/KeyguardViewCallback;->keyguardDone(Z)V

.line 336
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

#getter for: Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mStartForIntent:Landroid/content/Intent;
invoke-static {v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->access$1000(Lcom/android/internal/policy/impl/LockPatternKeyguardView;)Landroid/content/Intent;

move-result-object v0

if-eqz v0, :cond_3b

.line 337
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;

const-string v1, "mStartForIntent"

invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

.line 338
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

invoke-virtual {v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->getContext()Landroid/content/Context;

move-result-object v0

iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

#getter for: Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mStartForIntent:Landroid/content/Intent;
invoke-static {v1}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->access$1000(Lcom/android/internal/policy/impl/LockPatternKeyguardView;)Landroid/content/Intent;

move-result-object v1

invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

.line 349
:cond_3b
:goto_3b
return-void

.line 340
:cond_3c
const-string v0, "ro.origin.lockscreen"

const-string v0, "true"

invoke-static {v2, v3}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

const-string v1, "simulateICS"

invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_6d

.line 341
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

invoke-virtual {v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->getCallback()Lcom/android/internal/policy/impl/KeyguardViewCallback;

move-result-object v0

invoke-interface {v0, p1}, Lcom/android/internal/policy/impl/KeyguardViewCallback;->keyguardDone(Z)V

.line 342
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

#getter for: Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mStartForIntent:Landroid/content/Intent;
invoke-static {v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->access$1000(Lcom/android/internal/policy/impl/LockPatternKeyguardView;)Landroid/content/Intent;

move-result-object v0

if-eqz v0, :cond_3b

.line 343
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

invoke-virtual {v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->getContext()Landroid/content/Context;

move-result-object v0

iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

#getter for: Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mStartForIntent:Landroid/content/Intent;
invoke-static {v1}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->access$1000(Lcom/android/internal/policy/impl/LockPatternKeyguardView;)Landroid/content/Intent;

move-result-object v1

invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

goto :goto_3b

.line 346
:cond_6d
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$1;->this$0:Lcom/android/internal/policy/impl/LockPatternKeyguardView;

invoke-virtual {v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->getCallback()Lcom/android/internal/policy/impl/KeyguardViewCallback;

move-result-object v0

invoke-interface {v0, p1}, Lcom/android/internal/policy/impl/KeyguardViewCallback;->keyguardDone(Z)V

goto :goto_3b
.end method
--------------------------------------------------------------------------------------------------------------------------------------

Now save this Smalli


Now search for this

KeyguardScreenCallback.smalli

then search for

Quote:

.method public abstract goToUnlockScreen()V
.end method
then add this below this code

Quote:

.method public abstract isGotoUnlockscreen(Landroid/content/Intent;)V
.end method
Here our fourth step is completed


Now here we start our 5th step

downlaod this Zip (5th step)


Now open zip copy this fonts to your system/fonts (necceassry step other wise you will face bootloop)


Now open you build.prop


then search for


Quote:

# ADDITIONAL_BUILD_PROPERTIES
then above it add

Quote:

#add wanglu 20120811 start
#do not greenorging lockscreen
ro.origin.lockscreen=simulateICS
#add wanglu 20120811 end
I provided this flashable zip you can use it for your Flashing lockscreen (FLASHABLE.ZIP)




Note:

1 .if you are using my work so plz give me credit . because i spend many night and days for getting success.

and

If you are porting this guide To another thread inform me first . then i will create a seprate guide for your device.
by giving you credit and tester


[Guide]CWM for Locked Bootloaders[Most LG and other Devices]

$
0
0
I have a LG Optimus L5 II at this point in time there is now way to unlock my bootloader.
after some research I noticed that other devices can get CWM on there phones with locked bootloader. but I did not find any tutorials explaining how to do this. so I decided to write this tutorial to help everybody in the same situation.

Disclaimer

Code:

* Your warranty is now void.
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about changes made using this guide
* before using it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.

Thanks To

thanks to everyone who made a 2nd init script.
@artas182x
http://forum.xda-developers.com/show....php?t=2099238
@pedrodh
http://forum.xda-developers.com/show....php?t=1032212
@IGGYVIP
for inspiration and the push
Optima Team
For being a awsome team

First Step

understanding how it works.

basically when your phone boots it starts it begins to load the system.
when the system loads it starts t read a series of files. we intercept the files and tell it to stop loading and launch cwm from a tar file.
because you phone is loading it has already passed the check to see if the system is secure(IE checks that its not loading a custom software).
this process is called 2nd init.

Step 2

getting your phone to load a script at startup.

so now we have to get a script to load on startup. there are numerous ways of doing this. the most universal way is to use init.d.
because your bootloader is locked you most likely dont have init.d support.

to give support we need to change the install recovery file located

Code:

/system/etc/install-recovery.sh
this file is present on most devices. when your phone loads this file we will tell it to execute all files in /system/etc/ini.d

attached is a init.d installed that you can download so you dont have to manualy change anything yourself.

Step 3

Making sure script are loading on startup.

in the previous step I included a init.d script called datetest.
after completing step 2 restart your phone.
using root explorer go to

Code:

/data/local/tmp/
there should be a file called

Code:

init.d_log_test.txt
if you open that file you should have the date and time that the script was run.


Step 4

Installing the custom script.

Now that we have init.d support all we need to do is install the script
once again I have included a recovery installer.
this will put the unsecureboot in the init.d folder as well as create a folder in your system directory called bootstrap with all required files

Step 5

Getting the key

when the script is executed it will run the key check to identify what key is being pressed. in my case the vol + key is 115
if the correct key is being pressed it will launch the recovery.

to identify the correct key
use root explorer and navigate to

Code:

/system/bootstrap
open the file get key and select open as script
press execute and press the key you want to use to launch the recovery.
you need to do this at the same time

it will then return the key being pressed

if it returns -1 then it is not identifying the key try a different key.

Step 6

Modding the script

open the init.d script 001unsecureboot

find this line

Code:

  if $BB [ "$key" = 115 ]; then
replace the key with the key you got from the previous post

Step 7

Modding the Recovery

I have never ported a recovery before so i am not sure what needs to be changed in the recovery.tar

I was lucky enough for the recovery to work out of the box. with a few minor adjustments to the recovery.fstab.

but if you are familiar with cwm I am sure you will be able to understand.

Step 8

Rebooting to Recovery

there are two ways of doing this.

ether reboot and keep pressing the key that you selected

or you can run the app provided.

Step 9

Enjoy

now you should have CWM on your phone with a locked bootloader.

If not please leave me a comment. I will try my best to identify the problem.

Attached Files
File Type: zip cwm.zip - [Click for QR Code] (4.47 MB)
File Type: zip init.zip - [Click for QR Code] (1.15 MB)

[Dragonsphere Team][4.0-4.4.2] SwapDragonX (Boost your android to the limit!!!)

$
0
0

FEATURES
This script is based on a couple of scripts Victod with performance improvements and enhancements RAM Dual Swap and FSTRIM
ADVANCED FEATURES
-Dual Swap system and cache (383992KB swap (383MB SWAP)
-Improve the performance of your cell
-On FSTRIM in DATA / SYSTEM / CACHE (To learn more is FSTRIM visit this link) (Link)
-Improved loading the ext4 partitions


REQUIREMENTS
-Kernel with swap (recommended kernels chil and CeXtel)
-Kernel/ROM with Init.d (recommended kernels chil and CeXtel)

INSTRUCTIONS
1º copy the script to the sd or internal
2º wipe cache
3º Flash the zip
4º reboot and enjoy the script

CHANGELOGS
V1:Inicial

TESTED DEVICES
-Huawei ascend G510/Y300 WITH 4.1/4.4.2

DOWNLOADS
https://mega.co.nz/#!cY5DmAiJ!573DXl...4bg-PU4AeTChww

THANKS TO
-DragonSphere
-Vakun
-asis_92
-Victod

[GUIDE] How to upload repo with commit history

$
0
0
In the time I’ve spend dealing with open source projects and just being around fellow developers, I’ve found that there are a few things that should not happen but continue on happening.

Why does this happen?

Maybe a case of laziness, maybe they are trying to hide something….who knows but one thing that is sure is that it should not happen.

What I’m speaking of is people uploading repos without commit history. It bugs the living hell out of me. It does because sometimes I’m trying to learn how to do something and without commit history, is kind of difficult to do so. I mean, some brag that they’re 100 percent open source but I don’t think you can claim that without commit history in place.

Also, you can’t complain if you’re not willing to provide a solution to the problem….right?

Ok, well I will go ahead and provide a simple step by step way of uploading a repo with commit history as well as provide screenshots for those that learn by seeing.

So let’s say you want to upload a repo to your github but you don’t want to fork it for one reason or another.

I personally like to upload repos instead of forking them ONLY because I had a case back during Android 4.1.2 where I forked AOKP’s frameworks_base repo and some how it got corrupted and github claim that there was nothing they could do because it was a fork.

This made me mad and ever since I upload repos with commit history instead of just fork them on github.

Anyways, let’s start……

Find that repo and copy the HTTPS clone URL


Open up a terminal then type in "git clone + the https URL"


Press Enter and let it do it's thing


Now head over to github and create a repo, this is important


Now type in the name of the repo (whatever you want) and hit "Create repository"


You will be prompted with a screen like below, the bottom part is what we'll be using


Open up a terminal and navigate to the repo you git cloned above


Ok so when you fork a repo, you usually have a .git folder and with that it has a origin. Where it came from and what is used to know where to push to if you typed in something like git push origin or whatever. With that said, you have now git clone this repo and are wanting to upload it but yet keep commit history. So you need to type in the following command to remove the origin and have it pointing to your newly created repo

Keep in line with the step above, type in "git remote rm origin"


With all repos, you have branches. Branches are generally used to create snapshots of your work but sometimes used to work on other things while keeping the main goal in place and not having to create another repo. For example, if I had a repo that is used for KitKat 4.4.2 but Google decides to push 4.5 or 5.0 or whatever and I want to keep the work I did on 4.4.2, I would simply create another branch and use it for 4.5 or 5.0 or whatever.

With that said, you need to create a branch to start things off since this will a new repo....at least for you it is.

Type in "git branch master" and you'll find sometimes it exists, sometimes it doesn't. If it does then that's good......don't freak out! Just means you don't need to do this step :)


Ok after this you will need to go back to your github repo you created not so long ago and find the two lines I highlighted/had arrows pointing to and copy/paste them into terminal



Make sure you type in your Github username/password when prompted and the end result should look like this




ENJOY and hopefully this will help someone that doesn't exactly want to hide their kanging tracks but just doesn't know how to upload a repo with commit history!

[COMPLETED][BOUNTY] Script to enable/disable Glove Mode [$20][AWARDED ALREADY]

$
0
0
Hello,

I'd like to offer a $20 "promise" bounty to someone who can come up with two scripts for me.
One script to 'Enable Glove Mode' and another to "Disable Glove Mode'.
I'll use Tasker to do the switching between two modes if possible.
This is for AOSP ROM's and here is the GitHub commit:

chenxiaolong/
https://github.com/chenxiaolong/CM_h...9f3382d7e6a237

I got the idea from broodplank1337's thread here. But while his app is able to turn on Glove Mode in CM11, it doesn't give me any Tasker functionality for automation that I need.
http://forum.xda-developers.com/show...php?p=52142538

Bounty is dependent on this working for TMO Galaxy Note 3 in latest build of CyanogenMOD 11.

Thanks!
-Eddie

[MOD]PMP™ Xtreme Purity MOD For SGP GT-S5300

$
0
0
Here I Present you The PMP most Fastest and Smoothest Performance based Mod For galaxy pocket ..

#CREDITS
Mohitash sir (mohitash@xda)
Samsung For pocket
Google For android
And me :)
If i missed anyone please PM me i will add and sorry if i made any mistakes and please dont spam my thread ..

#MOD Features

*.Performance Improvered
*.Lightweight scripts
*.Scripts maintained for the perfect result
*.framework and service tweaks (GT-S5300)
*.libncurses.so, libsqlite.so andlibsqlite_jni.so tweaks
*.Better Battery backup
*.Better Graphics
*.Kernel Tweaks
*.And Many More...
*.New PMP™ Script

#REQUIREMENTS

*.Rooted Device
*.Busybox Installed
*.init.d Support
*.CWM Recovery

#INSTRUCTIONS

*.Make Backup First
*.Wipe cache and dalvik cache
*.Install MOD with CWM Recovery
*.Reboot
*.Again go to recovery, wipe cache and dalvik cache then reboot

#ORIGINAL THREAD :
http://forum.xda-developers.com/show....php?t=2487141

#DOWNLOADS :
http://www.mediafire.com/?zc71999m19gbv7v

We are not responsible for any damage of your phone so dont Blame us guys ..

THANKS FOR THE DEV AND YOU .. :)

[Help][Bash][build.prop]Developers only!

$
0
0
Hello everyone, i just wanted help with my Bash script!
I usually flash nightlies and when ever i flash them, i lose my tweaks :(
So i decided creating a bash script for myself,
Here's how it is....

Code:

#!/system/bin/sh

## personal file
tweaks=/sdcard/tweaks

build=/system/build.prop

## loop trough $tweak

sed -r '/(#.*|^ *$)/d;/.*=.*/!d;$a' $tweak | while read line
do
        ## get entry from $tweak
        entry=$(echo $line | sed "s/=.*//")

        ## if variable already present in $build
        if cat $build | grep -q $entry
        then
                ## override value in $build if different
                if ! cat $build | grep -q $(cat $tweak | grep $entry)
                then
                        sed -i "s/^${entry}=.*$/${line}/g" $build
                fi
        else
                echo $line >> $build
        fi
done

Everything works but i wanted to keep this process running (For testing purposes),
I mean after my tweaks/values get replaced, i want the same thing to happen with other values!

Eg:- /sdcard/tweak= Contains line= ro.build.model=Nexus 5,
Same file contains ro.build.model=Xperia Z,
now what i want my script to do is, First replace my phone model with Nexus 5 and after some time change it with Xperia Z without starting/stopping any other script!

But i aint too good at this!
So i require a helping hand!

I hope you get my point.

[PORT] [RECOVERY] Carlive Touch Recovery For Xolo

$
0
0
Hey Guys,

Presenting you first custom recovery recovery other than CWM for MTK 6572 device XOLO A600.
It Would not be possible to port it without carlive Sir.
Head over to his profile and press thanks for his guide to port it for Mtk device.


FEATURES
  • Quote:

  • Fully touch based like TWRP
  • Based on CWM Version 6.0.4.4.
  • With Aroma File Manager Support.
  • Based on latest CTR build by carliv sir.
  • Rainbow color scheme and stock blue color scheme.
  • Slide left to go back & Slide right to go in.
  • Much more,use and explore.


BUGS
You tell me.

DOWNLOAD

LINK

Guys,I have done this for you all.So,I can expect Thanks from you all.


PRESS THANKS IF I HELPED YOU INSTEAD OF TYPING :) THANK YOU FOR UNDERSTANDING :)

[UPDATE WITH VIDEO] [GUIDE] How To Fix Error In Status 6 And Status 7


[MOD][v1.00][2014/04/26]XMD Optimizer || Optimize Your Phone With Ease

$
0
0


Introduction

Quote:

XMD Optimizer Is A Program Designed To Optimize Your Android Device With Ease. It Provides User Friendly Interface For ALL. It Optimizes Your Android's RAM Which Results To Lagfree UI And More. You Must Follow Carefully All Instructions For XMD To Avoid Device Bricking.
Notice

Code:

Copyright (c) 2014 RenzkiPH @ xda-developers
XMD Optimizer         
   
XMD Optimizer is a free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see .
 
Gmail: renzki29@gmail.com

Credits/Special Thanks To

-- @zeppelinrox -- For V6 SuperCharger And Some Codes/Snippets That Im Using In This Project
-- @andiroxu -- For Project Xtreme
-- @Exit_Only -- For Operation Killjoy
-- Yoda @ Unix And Linux Forums -- For C Code That I've Learn From Him
-- @LENAROX -- For Some Help At The PAST
-- @pikachu01 -- For ThunderBolt!
-- @Buda1996 -- SPL Team
-- @jai554 -- SPL Team
-- All Staffs And Moderators Of XDA -- For XDA Forums
-- All Users/Developers All Over This Forum And Other Forums For Devs

Features

-- App Optimizations Through ZipAlign(Thanks Darky And wesgarner)
-- Performance Optimizations
-- Kernel Tuning Through Sysctl
-- GPU/GRAPHICS Enhancements For Smooth Touchscreen
-- Optimizations Of Database Files Within The System Through SQlite
-- Permission Fix For App To Avoid Disappearance
-- User-Friendly UI
-- Many More Coming Soon

Minimum Requirements

-- A RAM Capacity 256 HP+
-- Android Operating System Version 4.0.3 ICS And Above
-- Custom ROM/Aos, Linux Kernel, CWM/Touch Recovery
-- BusyBox Stable Version
-- sqlite3 And zipalign Binary(Use Installer From Downloads To Install)
-- Init.D Support
-- Root Authentication/Access
-- Flashing Experience

Users Instruction

Quote:

-- Beginners Install --

1. Download The Latest Version From Downloads
2. Move The Version You Have Downloaded To /sdcard
3. Reboot To CWM/Touch Recovery Mode
4. Backup Your Current ROM Using CWM/Touch Recovery Mode
5. Find The Latest Version You Have Downloaded From Downloads On /sdcard
6. Flash The Downloaded Version
7. Reboot

-- Advanced Install --

1. Uninstall All Optimizations Package(Tweaks, Mods, Scripts) Then Proceed To No. 2
2. Download The Latest Version From Downloads
3. Move The Version You Have Downloaded To /sdcard
4. Charge Your Device Upto 100% Then Unplug
5. Reboot To CWM/Touch Recovery Mode
6. Backup Your Current ROM Using CWM/Touch Recovery Mode
7. Find The Latest Version You Have Downloaded From Downloads On /sdcard
8. Flash The Downloaded Version
9. Wipe Battery Stats(If Exist)
10. Wipe Dalvik-Cache
11. Reboot

-- Uninstall --

1. Open Terminal Emulator From App Drawer
2 Type The Following Typos:
Code:

su
xmd -u

3. All Done

-- Usage --

Note: "||" Is Separator

First Of All Type "su" Before Running XMD.

Code:

xmd -x || Execute XMD Optimizer
xmd -r || Reboot/Revert Changes By XMD Optimizer
xmd -u || Uninstall XMD Optimizer
xmd -v || Print Version Details
xmd -h || Print Command Help
xmd -f || Clear DNS Cache

To Enable XMD Optimizer At Boot,

1. Navigate To /etc/XMD
2. Open XMD.config Using Root Explorer
3. Changed "xmd_optimizer=0" to "xmd_optimizer=1"
4. Save It Then Close
5. Delete The "XMD.config.bak"
6. Close Root Explorer And All Done

To Disable XMD Optimizer At Boot,

1. Navigate To /etc/XMD
2. Open XMD.config Using Root Explorer
3. Changed "xmd_optimizer=1" to "xmd_optimizer=0"
4. Save It Then Close
5. Delete The "XMD.config.bak"
6. Close Root Explorer And All Done

I Hope You've Follow The Instructions Properly.
Downloads

XMD Optimizer v1.00 Fixed

Source | Soon

Changelog

Quote:

XMD Optimizer v1.00 // 2014/04/26
Code:

-Initial Release

Remarks

Quote:

2014-04-26

To All Devs And Users, You're Allowed/Permitted To Use This At Your Projects But Dont Forget To Insert Proper Credits.
Im Not A Thanks Hunger Like Others But If You Want To Thank Me For This, Consider To Press Thanks Button Or Rate The Thread To 5 Star. Thanks For Using XMD Optimizer. Please Leave A Feedback.

Low on Internal Storage disk space? A quick solution!

$
0
0
You've probably encountered this problem more than once, and just wanted for that damn warning never to appear again! Here's how!

1. Navigate to /data/log/ using Root Browser, or a similar file manager
2. Find and delete ALL files that end with .log and are over 1MB in size
3. You can also delete the dump files that are more than 1MB to free up extra space
4. Enjoy your larger storage space!

If you want more space, or this just didn't help you, you can go to see what applications take the most of your *data* space by going to the Settings menu. When you have found the applications which data take the most of your storage space, just go to /data/data/ and search for the application. Then, delete the "log" folder or just some files that are useless in your opinion. If this helped you, remember to click the "Thanks" button!

Sent from my GT-S5690v2 using xda app-developers app

Android ls and df parsing

$
0
0
Hey all together,

after a lot of searching and using Google for days with no really good results i created now my own reg-ex functions to parse some Android shell outputs. So i only want to share my functions coz i dun found something like that.

If u create a Android File-Explorer or something else like this u'll have to get the ls and df output in some situations, if u use C# like me this will be great for u. ;)

here are my functions:

(command) ls -l
(command) busybox ls -aFl

Code:

^(?<TYPE>(-|b|c|d|l|s|p){1})(?<PERM>(-|r|w|x|s|t){9})\s{1,}(?<INCLUDES>([0-9]){1,}\s{1,})?(?<OWNER>(.*?))\s{1,}(?<GROUP>(.*?))\s{1,}(?<ID>([0-9]){1,},\s{1,})?(?<SIZE>([0-9]){1,}\s{1,})?(?<DATE>(.*?))\s{1,}(?<TIME>([0-9]{2}.[0-9]{2}|[0-9]{4}))\s{1}(?<NAME>(.*?))(\s{1}->\s{1}(?<SYMLINK>(.*?)))?(?<SUBTYPE>(\*|/){1})?$
u can use it like

Code:

GroupCollection groups = Regex.Match("the ls -l or busybox -aFl output line by line", @"^(?<TYPE>(-|b|c|d|l|s|p){1})(?<PERM>(-|r|w|x|s|t){9})\s{1,}(?<INCLUDES>([0-9]){1,}\s{1,})?(?<OWNER>(.*?))\s{1,}(?<GROUP>(.*?))\s{1,}(?<ID>([0-9]){1,},\s{1,})?(?<SIZE>([0-9]){1,}\s{1,})?(?<DATE>(.*?))\s{1,}(?<TIME>([0-9]{2}.[0-9]{2}|[0-9]{4}))\s{1}(?<NAME>(.*?))(\s{1}->\s{1}(?<SYMLINK>(.*?)))?(?<SUBTYPE>(\*|/){1})?$").Groups;
            string Type = groups["TYPE"].Value;
            string SubType = groups["SUBTYPE"].Value;
            string Perms = groups["PERM"].Value;
            string Owner = groups["OWNER"].Value;
            string Group = groups["GROUP"].Value;
            string Id = groups["ID"].Value;
            string Size = groups["SIZE"].Value;
            string Date = String.Join(" ", groups["DATE"].Value, groups["TIME"].Value);
            string Name = groups["NAME"].Value;
            string[] extTmp = Name.Split('.');
            string FileExtension = extTmp[extTmp.Length - 1];
            string SymPath = groups["SYMLINK"].Value;


(command) df
(command) busybox df -Pakh

Code:

^(df:\s{1,})?(?<NAME>(.*?))(:\s{1,}(.*?))?(\s{1,}(?<SIZE>([0-9]{1,}[a-zA-Z\.]?){1,}))?(\s{1,}(?<USED>([0-9]{1,}[a-zA-Z\.]?){1,}))?(\s{1,}(?<FREE>([0-9]{1,}[a-zA-Z\.]?){1,}))?(\s{1,}(?<BLOCKSIZE>([0-9]){1,}))?(\s{1,}(?<USE>([0-9]{1,})%))?(\s{1,}(?<PATH>(.*?)))?$
u can use it like

Code:

GroupCollection groups = Regex.Match("the df or df -Pakh output line by line", @"^(df:\s{1,})?(?<NAME>(.*?))(:\s{1,}(.*?))?(\s{1,}(?<SIZE>([0-9]{1,}[a-zA-Z\.]?){1,}))?(\s{1,}(?<USED>([0-9]{1,}[a-zA-Z\.]?){1,}))?(\s{1,}(?<FREE>([0-9]{1,}[a-zA-Z\.]?){1,}))?(\s{1,}(?<BLOCKSIZE>([0-9]){1,}))?(\s{1,}(?<USE>([0-9]{1,})%))?(\s{1,}(?<PATH>(.*?)))?$").Groups;
            string Name = groups["NAME"].Value;
            string Size = groups["SIZE"].Value;
            string Used = groups["USED"].Value;
            string Free = groups["FREE"].Value;
            string BlockSize = groups["BLOCKSIZE"].Value;
            string Use = groups["USE"].Value;
            string Path = groups["PATH"].Value;


Hope this helps someone ;)

Regards,
k1ll3r8e

automatically start a service when joining a open/free wifi

$
0
0
im not sure if there is a app that does this
but i want to automatically start a service/app (VPN) when joining a open/free wifi
if not, then how would i best do this?
thank you

[Q] Why can't alter the su binary to have system access only instead of root

$
0
0
Hi,

Imagine a scenario where you have just system access on android , and you want to continually have it, so you use the su binary, with the correct permission and the setuid flag on, and the owner being system, you do:
Code:

chown 1000:1000 su2
chown 06755 su2

you have the ability to change the owner to system as you do when rooting, and you also set the appropriate permission as you do when rooting,

06775 being the permission code to all have execution permission, and the setuid flag on.

But when dealing with system permission that doesn't work. it only works with root.

I know it's a weird question, but if any could answer it, id be glad .... thanks
Viewing all 3614 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>