Themes / Apps / Mods [Windows][PowerShell][Script]psAdBlock - PowerShell AdBlock Script for Windows - Windows 10, 8, 7, XP etc.

Introduction
Dear community
This is my very first XDA: DevDB project. I'm glad to announce my ad-block solution purely based on PowerShell.
I've been (and I still am) using AdAway on my Android phone. It's a great app, and it inspired me to get a similar solution for Windows computers.
Version 0.1 was not public because it was slow as hell. It took about 8 minutes to handle ~200'000 hosts.
With version 1.0, my script got a massive speed improvement. Now its duration has been greatly decreased. I achieved the same amount of hosts in less than 100 seconds now. But of course, these measured values shouldn't mean a lot, as they depend completely on your hardware (and a little bit on your internet connection of course).
Now version 1.6 has an automatic backup & apply routine, check it out!
Click to expand...
Click to collapse
Features
This script does exactly what you think: It grabs various "hosts" sources from the internet, saves them locally, and merges them to one big file. Enjoy an ad-free Windows experience.
Download as many "hosts" files as you want
Merge them automatically into one big "hosts" file
Remove duplicates from the "hosts" file
Remove any comment line starting with # to keep your hosts file as small as possible
Apply a custom whitelist or even custom blacklists
Log the entire process to a log file (placed within the same directory where you saved this script)
Click to expand...
Click to collapse
Downloads & Changelogs
See post 2
Click to expand...
Click to collapse
FAQs
See post 3
Click to expand...
Click to collapse
Disclaimer
Altough this is normally a safe process, I am not responsible for possible damage to your device if anything should fail.
I will not take any responsability for bricked Windows installations, other software defects or even lost data.
Click to expand...
Click to collapse
License/forks
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License(
).
This is an open source project, it's a PowerShell script and you're able to see the source code of course. You're allowed to modify this script as you want, as long as you give credits to me. Adaptations of my work shall be shared as well under the same license. Commercial use is allowed, as long as you don't sell my work.
Click to expand...
Click to collapse
Requirements
There are some requirements to check.
A little bit of PowerShell-knowledge (not necessary of course)
At least Windows 7 (theoretically it should work on any Windows)
At least PowerShell 3.0 (PowerShell 2.0 may work, but is unsupported)
At least 50 MB free space for this script
Administrative privileges - required if you want to use the automatic backup & apply routines, not for the script itself, otherwise you'll need to manually copy the "hosts" file into the Windows directory
Click to expand...
Click to collapse
Instructions for use with administrator privileges (recommended)
Download the archive and unzip it anywhere
Execute the "_Run_Admin.bat" script via double-click, confirm the UAC window by clicking on the yes button and wait for the console to close itself
Reboot your machine and enjoy an ad-free Windows experience
Note: Instead of the batch script you can use the .ps1 file as well (unblock it first, simply right-click the .ps1 file, choose "Properties", then hit the "Unblock" button), start a new PowerShell console as administrator and manually run the script
Click to expand...
Click to collapse
Instructions for use without administrator privileges
Download the archive and unzip it anywhere
Execute the "_Run_User.bat" script via double-click and wait for the console to close itself
Copy the newly created "hosts" file and rename the existing "hosts" file to manually create a backup
Code:
C:/Windows/System32/drivers/etc/hosts
Reboot your machine and enjoy an ad-free Windows experience
Note: Instead of the batch script you can use the .ps1 file as well (unblock it first, simply right-click the .ps1 file, choose "Properties", then hit the "Unblock" button), start a new PowerShell console and manually run the script
Click to expand...
Click to collapse
Instructions to customize psAdBlock
To modify the "hosts" sources, simply edit the file "hostslist.ini"
To allow specific hosts, simply edit the file "whitelist.ini"
To block specific hosts, simply create a new .txt file within the "DL_Cache" folder and add the hosts (one per line) you want to block (e.g. "0.0.0.0 place-any-site-here.com")
Click to expand...
Click to collapse
Credits & thanks to
* Makorus: Creator of this PowerShell script
* Dominik Schuermann: Inspiring me to do this
* Luca Sturlese: Allowing us to use his awesome logging function library
Any questions or suggestions? Did you find any bugs? Thanks for your feedbacks in advance! :good:
Click to expand...
Click to collapse
XDA:DevDB Information
psAdBlock, Tool/Utility for the Windows 8 General
Contributors
Makorus
Source Code: https://github.com/makorus/ps-adblock
Version Information
Status: Stable
Current Stable Version: 1.6.5
Stable Release Date: 2017-07-03
Created 2015-05-09
Last Updated 2018-07-13

News
I'm moving this project to GitHub for many reasons. Future releases will be available through GitHub only.
New download link:
https://github.com/makorus/PS-AdBlock/archive/master.zip
Current release & changelog
Code:
##-------------------------------------------------------------------------------------##
## V1.6.3, 2018-02-03 ##
## - Added logic to handle 'localhost' in whitelist (thanks to antonio-gil) ##
## - Removed script version from filename ##
##-------------------------------------------------------------------------------------##
Notes
Code:
#########################################################################################
## Notes: ##
## - PowerShell 3.0 or newer is recommended to run this script without any errors ##
## - PowerShell 2.0 may work as well, but is unsupported ##
## - If you disable the backup/apply mode you have to manually copy the final ##
## 'hosts'-file to the Windows etc directory (please manually backup the old file: ##
## C:\Windows\System32\drivers\etc ##
## - To apply a custom blacklist, simply create a text file containing your desired ##
## hosts and save it in the download cache folder 'DL_Cache' (run the script once) ##
## - To manually add your custom hosts list, create a new text file called ##
## 'hostslist.ini' and add your hosts sources (one site per line without the www) ##
## - To automatically remove specific sites from the hosts list, create a new text ##
## file called 'whitelist.ini" and add your sites you want to whitelist ##
## - If you experience performance issues like extremely slow Windows startup time, ##
## Try to disable the client DNS Cache service via CMD: ##
## sc config dnscache start= disabled ##
#########################################################################################
Release history & changelogs
Code:
#########################################################################################
## Release history (yyyy-MM-dd): ##
##-------------------------------------------------------------------------------------##
## V0.0.1 - V0.0.9, 2015-05-02 ##
## - Non-public test versions only ##
##-------------------------------------------------------------------------------------##
## V1.0.0, 2015-05-09 ##
## - First public and stable release ##
##-------------------------------------------------------------------------------------##
## V1.1.0, 2015-05-10 ##
## - Added release history to the script ##
## - Merged Log Functions to the main script file (no more two separate files) ##
## - Added XDA:DevDB link ##
## - Added script version to name (easy identification) ##
##-------------------------------------------------------------------------------------##
## V1.2.0, 2015-05-13 ##
## - Fixed issue with old 'New-Item' command in function 'Log-Start': ##
## --> OLD: New-Item -Path $LogPath -Value $LogName -ItemType File ##
## --> NEW: New-Item -Path "$sFullPath" -ItemType File ##
## - Changed the 'Log-Start' invoking command to use $PSScriptRoot: ##
## --> OLD: Log-Start -LogPath ".\" [...] ##
## --> NEW: Log-Start -LogPath "$PSScriptRoot" [...] ##
## - Added #region and #endregion codes to fold the code ##
##-------------------------------------------------------------------------------------##
## V1.3.0, 2015-05-13 ##
## - Completely reworked the 'release history', huge improvement to readability ##
## - The 'Patch Table' uses now '-ireplace' instead '-replace' for better results ##
## - Changed the 'Patch Table' to use regex expressions for my default list ##
## - Added Spotify to 'Patch Table': ##
## --> $DefaultPatchTable.Add('\w+.spotify.com', 'localhost') ##
##-------------------------------------------------------------------------------------##
## V1.4.0, 2015-07-26 ##
## - Reworked whitelist method (check notes for more information) ##
## - Reworked hosts source list (check notes for more information) ##
## - Reworked the 'Patch Table', doesn't require regex expressions anymore ##
##-------------------------------------------------------------------------------------##
## V1.5.0, 2015-08-10 ##
## - The file now checks for the client DNS Cache service and logs a warning if it's ##
## enabled to ensure you don't run into troubles ##
## - Removed the note about the DNS Cache service: It's not recommended to set the ##
## startup type to "demand" (manual), it will cause issues sooner or later ##
## - Starting from now on, I'll create an executable file (to be found in the ZIP) ##
## - I'll also attach a VirusTotal.com scan to every new release ##
## --> Please report any Anti-Virus false positive alarms to me ##
##-------------------------------------------------------------------------------------##
## V1.5.1, 2015-08-11 ##
## - Fixed issue with wrong $PSScriptRoot variable when using the EXE variant ##
## - Changed the 'release history' to allow better versioning (e.g. version 1.5.1) ##
## --> Note: Older versions still contain two numbers only (e.g. version 1.2 etc.) ##
##-------------------------------------------------------------------------------------##
## V1.5.2, 2015-09-13 ##
## - Remove every empty line in the hosts file ##
## - Changed the Log-Write function to use Write-Host instead of Write-Debug, now ##
## the entire log will be shown during the script execution (live) ##
## - Changed replacement method to insert 0.0.0.0 instead of 127.0.0.1 in the final ##
## hosts file which leads to a much better and faster DNS resolution ##
## - Future releases will be delivered with additional hosts files, for example to ##
## block Google ad servers and some Windows 10 hosts to stop this privacy nightmare ##
##-------------------------------------------------------------------------------------##
## V1.5.3, 2015-10-08 ##
## - Fixed ugly encoding issue, new 'hosts' file will be created correctly now, means ##
## no BOM (Byte Order Mark) and no UCS-2 encoding anymore, should fix many issues ##
##-------------------------------------------------------------------------------------##
## V1.5.4, 2015-10-09 ##
## - Fixed duplicate hostname issue, cmdlet Get-Unique allows by default hostnames ##
## with capital letters (Get-Unique is a case sensitive search) ##
## e.g. 'test.com' and 'Test.com' are being handled correctly now ##
## - Reverted warning about DNS cache service, there should be no issue with the DNS ##
## cache service because the 'hosts' file is being encoded as a typical UTF8 file ##
## - Added new debug mode, set $DebugMode to $true to activate it ##
## This skips the download process, useful if you want to test something without ##
## re-downloading the whole host source lists ##
##-------------------------------------------------------------------------------------##
## V1.5.5, 2015-10-10 ##
## - Fixed issue with method ToLower (should work with PowerShell 2.0 now), ToLower ##
## is a method to work with strings only, work around with a ForEach-Object cmdlet ##
## - Added a PowerShell version check, unsupported versions are PowerShell v1 and v2, ##
## if you start this script with an unsupported PowerShell version, you'll find ##
## some hints in the log file to inform you about that ##
##-------------------------------------------------------------------------------------##
## V1.5.6, 2015-10-11 ##
## - Added again regex patterns to patch table, whitelist should work now correctly ##
## - Debug mode now skips the patch process as well ##
##-------------------------------------------------------------------------------------##
## V1.5.7, 2015-10-17 ##
## - Completely replaced previous regex patterns with one more complex pattern to ##
## handle hostnames with subdomains, performance increased significantly ##
##-------------------------------------------------------------------------------------##
## V1.5.8, 2016-01-03 ##
## - Non-public test version only (skipped) ##
##-------------------------------------------------------------------------------------##
## V1.5.9, 2016-01-24 ##
## - Non-public test version only (skipped) ##
##-------------------------------------------------------------------------------------##
## V1.6.0, 2016-02-29 ##
## - Added function to check for admin privileges ##
## - Added routine for automatic apply of 'hosts'-file (admin privileges required) ##
## - Added routine for backup of 'hosts'-file (admin privileges required) ##
## - Added some Skype and YouTube hostnames to the whitelist for proper functionality ##
## - Added new icon for the executable file ##
## - Updated the notes (see below) ##
## - Overall cleanup, added region codes for the main script ##
##-------------------------------------------------------------------------------------##
## V1.6.1, 2016-04-19 ##
## - Fixed wrong script number ##
##-------------------------------------------------------------------------------------##
## V1.6.2, 2017-04-25 ##
## - Added Goo.gl to 'Patch Table' and to the default whitelist.ini: ##
## --> $DefaultPatchTable.Add('\w+.goo.gl', 'localhost') ##
## - Changed the foreach loop to avoid recreating the object System.Net.WebClient ##
## - Added error handling for the download process ##
## - Added routine to correctly check the existence of the original 'hosts'-file ##
## - Removed EXE file because of false positive alarms from many AntiVirus engines ##
## - Added instead two new batch files: '_Run_Admin.bat' and '_Run_User.bat' ##
## - Overall rework, changes many comments and updated some notes ##
##-------------------------------------------------------------------------------------##

FAQs
How to execute this PowerShell script?
Option 1: Run the script using one of the included batch scripts, either the "_Run_Admin.bat" or the "_Run_User.bat" batch script.
Option 2: Manually run the PowerShell script. But at first, you have to unblock the PowerShell script because it is a script you downloaded from the internet. Once you unzipped the file, do a right click on the PS1 file and open its file properties. Click on the "Unblock" button and you're done. Right click the file and click on "Run with PowerShell".
Click to expand...
Click to collapse
Why do I get an message warning me about an execution policy?
Microsoft implemented this security feature when they published PowerShell. By default, the execution policy is set to "restricted", which means no scripts can be executed directly. You're able to configure the execution policy as you want. There are several execution policies, you can check them out here: Microsoft TechNet, Set-ExecutionPolicy.
I personally recommend to change the execution policy to "unrestricted", this means you can execute scripts you created and even those you downloaded from the internet (though you have to be careful what you download and what you execute).
Click to expand...
Click to collapse
How to uninstall this PowerShell script?
Basically, you just have to navigate to this folder:
C:\Windows\System32\drivers\etc
Delete the new hosts file and restore the original one by renaming "hosts.original" to "hosts" without any extension. After that, simply delete the files you downloaded from this thread.
Click to expand...
Click to collapse
Click to expand...
Click to collapse

Awesome! Can't wait to try this! I've used HostsMan, which is the closest UI-enabled program similar to AdAway for Windows, but it's really tricky to get it to work and it used to break my internet a lot. Had to go in safe mode to restore the original hosts file.

Glad to read that, I hope you like it! Never heard of it, but I just took a look at it. I guess this tool doesn't disable the DNS cache service.
I'm thinking of implementing a check, to verify whether the DNS cache service is enabled or disabled.

Hello everyone
I just uploaded two new versions, V1.2 and V1.3. I also made many other improvements, read the full change log for more information.

Hi everyone!
Sorry for the delay, but I had many things to sort out in my real life. However, I was able to work on V1.4 for you guys.
Now you can work with two text files called "whitelist.ini" and "hostslist.ini" to manage this script - there's no need to edit the PowerShell script file itself. Also, there are many improvements, read the full change log for more information.

thanks for this, it is is exactly what i was looking for, right now im trying to have this run on windows 10, i have a question the created "hosts" file is detected as a trojan virus, im wondering is this a false positive. i have backed up my system and original hosts file just in case. Hope there will be more developers for the Windsows platform so that we can make it a better OS, Ill let you know how it worked out, THNX
Just tried on Windsows 10, definitely not a virus, but i did experience allot lag with it, it blocks some ads in Microsoft Edge, runs

Thanks for this great tool. Works great but can someone make an .exe out of it? It would be more convenient.

godusopp said:
Thanks for this great tool. Works great but can someone make an .exe out of it? It would be more convenient.
Click to expand...
Click to collapse
Hi there, thank you for your reply. I can compile an EXE file out of it, but I expect a lot of false reports from anti-virus applications. I'll upload the EXE file tomorrow.
Kind regards
Makorus

Makorus said:
Hi there, thank you for your reply. I can compile an EXE file out of it, but I expect a lot of false reports from anti-virus applications. I'll upload the EXE file tomorrow.
Kind regards
Makorus
Click to expand...
Click to collapse
Thanks for the great work. I really appreciate it. I'll whitelist if antivirus detect it as false positive

Your script not work

Hi everyone
I just uploaded version 1.5. Go check it out! :laugh::good:
@Dj_Art Hey there
Hmm, it looks very strange. I guess you've got a Russian Windows 8.1 OS, am I right? Could you try out version 1.5 please?
Can you try placing the PS1 script on your desktop or somewhere else, where you have full access rights? Might be a permission issue as well.
Otherwise please hand out your system information (start -> run -> msinfo32 -> save as NFO file) so I can start debugging your error message.
@godusopp I've uploaded the EXE file as well, check the new ZIP file! :good:
@mrTGF Sorry I missed your post somehow. What Anti-Virus are you using?
The script itself is 100% clean, you can check out the source if you want. But I can't guarantee that the hosts sources I'm using are not compromised or whatever (but to be honest, I don't think so).

I have just tried the new update and it doesnt work for me at all, Microsoft Edge slows down drastically, the only difference in terms of ads, is that they end up loading last, in regards to the false positive i have used AVG Antivirus 2014, the file definitely is not a Trojan. I was wondeing if you can use the same host sources that Adaway on android is using?
Makorus said:
Hi everyone
I just uploaded version 1.5. Go check it out! :laugh::good:
@Dj_Art Hey there
Hmm, it looks very strange. I guess you've got a Russian Windows 8.1 OS, am I right? Could you try out version 1.5 please?
Can you try placing the PS1 script on your desktop or somewhere else, where you have full access rights? Might be a permission issue as well.
Otherwise please hand out your system information (start -> run -> msinfo32 -> save as NFO file) so I can start debugging your error message.
@godusopp I've uploaded the EXE file as well, check the new ZIP file! :good:
@mrTGF Sorry I missed your post somehow. What Anti-Virus are you using?
The script itself is 100% clean, you can check out the source if you want. But I can't guarantee that the hosts sources I'm using are not compromised or whatever (but to be honest, I don't think so).
Click to expand...
Click to collapse
Makorus said:
Hi there, thank you for your reply. I can compile an EXE file out of it, but I expect a lot of false reports from anti-virus applications. I'll upload the EXE file tomorrow.
Kind regards
Makorus
Click to expand...
Click to collapse

mrTGF said:
I have just tried the new update and it doesnt work for me at all, Microsoft Edge slows down drastically, the only difference in terms of ads, is that they end up loading last, in regards to the false positive i have used AVG Antivirus 2014, the file definitely is not a Trojan. I was wondeing if you can use the same host sources that Adaway on android is using?
Click to expand...
Click to collapse
Hi again
That's really strange, but this might be an issue with Windows 10/Microsoft Edge. I haven't tried yet how the hosts file reacts on a Windows 10 device. But I've got a Windows 10 device at home, so I'm gonna try it out as soon as possible and report back.
In the mean time, would you be so kind and post the version 1.5 log file? I think your DNS service might be online and that's why you face these issues.
Also, thanks for the information to your false positive alarm. Maybe you've already seen the VirusTotal.com link in my second post. You'll find TONS of false reports there.
Oh and by the way, actually, I'm using exactly the same hosts sources as the AdAway app on Android does.

Makorus said:
Hi again
That's really strange, but this might be an issue with Windows 10/Microsoft Edge. I haven't tried yet how the hosts file reacts on a Windows 10 device. But I've got a Windows 10 device at home, so I'm gonna try it out as soon as possible and report back.
In the mean time, would you be so kind and post the version 1.5 log file? I think your DNS service might be online and that's why you face these issues.
Also, thanks for the information to your false positive alarm. Maybe you've already seen the VirusTotal.com link in my second post. You'll find TONS of false reports there.
Oh and by the way, actually, I'm using exactly the same hosts sources as the AdAway app on Android does.
Click to expand...
Click to collapse
Thanks for the app. I've already reported it as false positive to bitdefender so hopefully they solve it soon.

Makorus said:
Hi again
That's really strange, but this might be an issue with Windows 10/Microsoft Edge. I haven't tried yet how the hosts file reacts on a Windows 10 device. But I've got a Windows 10 device at home, so I'm gonna try it out as soon as possible and report back.
In the mean time, would you be so kind and post the version 1.5 log file? I think your DNS service might be online and that's why you face these issues.
Also, thanks for the information to your false positive alarm. Maybe you've already seen the VirusTotal.com link in my second post. You'll find TONS of false reports there.
Oh and by the way, actually, I'm using exactly the same hosts sources as the AdAway app on Android does.
Click to expand...
Click to collapse
Hi here is the log file you have asked for, i hope this helps. Also a little update, i went ahead and converted the hosts file to .txt, and had removed the very first empty line, after i put it back, this removed the lag from Microsoft Edge, however the ads still popped up after everything else loaded.

UPDATE: I have done some digging and discovered that the first line of the "hosts" file has to be "127.0.0.1 localhost" for this to work, also I used the host sources in your created hosts file and added more from other websites and made this one, it seems to work for me on windows 10/Microsoft edge, have not yet tried on other platforms.
Instructions:
1. Download the file hosts.txt below
2 Copy hosts.txt in the C:/Windows/system32/drivers/etc
3. Backup your current hosts file (ie. copy and paste it to somewhere safe. (Desktop?)
4. Delete the hosts your original hosts file in the C:/Windows/system32/drivers/etc
5. Rename the hosts.txt to hosts
credit goes to: @Makorus and http://winhelp2002.mvps.org/
UPDATE NOTE: I'm assuming that some of the hosts files from Adaway that Makorus used in his hosts file seem to be android specific, the reason I'm mentioning this is because earlier on in the project I created a file only using those sources the result being that the ads would load after the page itself loaded. However when I also added the hosts from the above website it seemed to have worked perfectly, more testing would need to be done, but it seems to work

Hello everyone
I just released a new build, version 1.5.1.
From now on, I'll use 3 numbers for a better versioning. Creating a version 1.6 for a tiny bug fix from version 1.5 would be a bit too heavy.
@mrTGF to be honest, I'm unable to reproduce your issue on my Windows 10 device, no issues on my Windows 10 device at all. Would you be so kind, download the new version 1.5.1 and give it a try?
I just realized your log file isn't complete. Did you cut the last few lines of the log files on your own? If not, the script has been terminated unexpectedly. Here's an example of a "complete" log file.
Code:
***************************************************************************************************
Started processing at [08/11/2015 22:16:36].
***************************************************************************************************
Running script version 1.5.1.
***************************************************************************************************
Checking for existing hostslist.ini file...
Didn't find existing hostslist.ini file - using default list...
Checking for existing whitelist.ini file...
Didn't find existing whitelist.ini file - using default list...
Checking whether the 'C:\Users\Makorus\Desktop\DL_Cache\' folder exists...
Download cache folder not found. Creating empty download cache folder...
Successfully created the download cache folder!
Starting download process for 'hosts' sources...
Downloading hosts file from: http://hostsfile.org/Downloads/hosts.txt
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\1_source-hosts.txt
Downloading hosts file from: http://someonewhocares.org/hosts/zero/hosts
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\2_source-hosts.txt
Downloading hosts file from: http://winhelp2002.mvps.org/hosts.txt
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\3_source-hosts.txt
Downloading hosts file from: http://adaway.org/hosts.txt
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\4_source-hosts.txt
Downloading hosts file from: http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\5_source-hosts.txt
Downloading hosts file from: http://www.malwaredomainlist.com/hostslist/hosts.txt
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\6_source-hosts.txt
Finished download process!
Merging all hosts files into one big file, ignoring comment lines and duplicates, sorting and trimming lines...
Applying patch table...
Applying patch for '\t'...
Applying patch for ' {2,}'...
Applying patch for '0.0.0.0'...
Applying patch for 'hostsfile.org'...
Applying patch for 'someonewhocares.org'...
Applying patch for 'winhelp2002.mvps.org'...
Applying patch for 'adaway.org'...
Applying patch for 'pgl.yoyo.org'...
Applying patch for 'malwaredomainlist.com'...
Applying patch for 'bit.ly'...
Applying patch for 'spotify.com'...
Successfully finished apply process!
Creating new 'hosts' file, ready to be used...
Successfully created the 'hosts' file!
DNS Cache service is already disabled. It's safe to apply your new hosts file now!
Finished the PowerShell AdBlock script!
Elapsed time: 19.7985844 seconds
***************************************************************************************************
Finished processing at [08/11/2015 22:16:55].
***************************************************************************************************

I did not make any changes to the file, that is exact output I received from the process, If you look at my last post you will notice that I resolved the issue by formatting the hosts file differently and adding more sources.
Makorus said:
Hello everyone
I just released a new build, version 1.5.1.
From now on, I'll use 3 numbers for a better versioning. Creating a version 1.6 for a tiny bug fix from version 1.5 would be a bit too heavy.
@mrTGF to be honest, I'm unable to reproduce your issue on my Windows 10 device, no issues on my Windows 10 device at all. Would you be so kind, download the new version 1.5.1 and give it a try?
I just realized your log file isn't complete. Did you cut the last few lines of the log files on your own? If not, the script has been terminated unexpectedly. Here's an example of a "complete" log file.
Code:
***************************************************************************************************
Started processing at [08/11/2015 22:16:36].
***************************************************************************************************
Running script version 1.5.1.
***************************************************************************************************
Checking for existing hostslist.ini file...
Didn't find existing hostslist.ini file - using default list...
Checking for existing whitelist.ini file...
Didn't find existing whitelist.ini file - using default list...
Checking whether the 'C:\Users\Makorus\Desktop\DL_Cache\' folder exists...
Download cache folder not found. Creating empty download cache folder...
Successfully created the download cache folder!
Starting download process for 'hosts' sources...
Downloading hosts file from: http://hostsfile.org/Downloads/hosts.txt
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\1_source-hosts.txt
Downloading hosts file from: http://someonewhocares.org/hosts/zero/hosts
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\2_source-hosts.txt
Downloading hosts file from: http://winhelp2002.mvps.org/hosts.txt
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\3_source-hosts.txt
Downloading hosts file from: http://adaway.org/hosts.txt
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\4_source-hosts.txt
Downloading hosts file from: http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\5_source-hosts.txt
Downloading hosts file from: http://www.malwaredomainlist.com/hostslist/hosts.txt
Downloading hosts file to: C:\Users\Makorus\Desktop\DL_Cache\6_source-hosts.txt
Finished download process!
Merging all hosts files into one big file, ignoring comment lines and duplicates, sorting and trimming lines...
Applying patch table...
Applying patch for '\t'...
Applying patch for ' {2,}'...
Applying patch for '0.0.0.0'...
Applying patch for 'hostsfile.org'...
Applying patch for 'someonewhocares.org'...
Applying patch for 'winhelp2002.mvps.org'...
Applying patch for 'adaway.org'...
Applying patch for 'pgl.yoyo.org'...
Applying patch for 'malwaredomainlist.com'...
Applying patch for 'bit.ly'...
Applying patch for 'spotify.com'...
Successfully finished apply process!
Creating new 'hosts' file, ready to be used...
Successfully created the 'hosts' file!
DNS Cache service is already disabled. It's safe to apply your new hosts file now!
Finished the PowerShell AdBlock script!
Elapsed time: 19.7985844 seconds
***************************************************************************************************
Finished processing at [08/11/2015 22:16:55].
***************************************************************************************************
Click to expand...
Click to collapse

Related

Build.prop Worktool for Windows (v1.7 - July 26 2011)

Script is standalone : you can download latest version without upgrading from previous version
v1.6 > Big update on 3G+ tweak addon, more powerful and much faster
Build.prop Worktool - A powerful but safe build.prop manager/editor
Hi !
Okay guys, since I know how powerful the build.prop can be, I love to play with it.
But I was bored to edit using Root Explorer, or using ADB command-line...
So... Let me present you my outrageously complicated (internally) script to manage your build.prop right from your computer, with ease, fun and safety !
GENERAL :
For any Windows NT kernel (Developped under Windows 7 x64... so should work everywhere )
Portable and ready to use - No installation required, all files included (ADB with drivers also)
Lightweight (<3Mb unzipped, because of ADB very big lol)
Tested on XPERA x10i but should work on ANY Android powered device (if your ROM uses a build.prop located into /system/)
KEY FEATURES :
Easy open/edit your build.prop in your default text editor
Backup creation/management
Save backup on your computer and/or on your device
Safe (Automatic backup generator - Manages up to 2 backup files, exhaustive log file)
Automatic permissions management
Add-on capability : possible to add automated installation scripts to tweak your build.prop
List of present add-ons : 3G+ enhancement tweak
Very clean : deletes all temporary files, auto start/stop ADB server and kills the process when useless
Convenient : direct access to this thread, easy to use
v1.6+ : (beta) Build.prop XPlorer, to check with ease your build.prop
I based the main script on my 3G+ enhancement script, available on the official thread.
** As usual... Use at your own risk **
Test, comment, criticize, if you find anything, just drop a comment or PM
FAQ
FAQ​- Supported devices
It is first developped for Sony Ericsson XPERIA x10, but it should work on any Android device with these requirements :
* Rooted
* File system is mounted Read/Write.
* Build.prop is located into /system/ and named "build.prop"
Sony Ericsson XPERIA x10 : fully working
Samsung Galaxy S2 : half working (file system is read-only...)
- How it's working ?
The script works generally in this way :
It downloads from your device your build.prop and creates two temporary backups.
Then, it opens one of the temporary backup into notepad, to let you edit all you want.
Once file closed/saved, the file is reconfigured automatically, then sent back to your device.
The script allows you next to keep, on wish, the remaining backup and to reboot your device.
- Is this safe ?
The script makes a backup of your build.prop every time you try to access it. There's also human-friendly log file to help you identify problems with ease.
There is also NO automatic upload to your device : the script will always ask you before if you want to upload the new build.prop to your device. Even if you upload it, backup is stored and can even be stored safely on your device for future use.
- Is this all automatic ?
Yes. The script makes backups by itself, reboot your device for you (if you wish), and of course change permissions. But don't worry : it will ask your approval for any important process
- The 3G tweak makes my connection unstable !
The Manager is based on my 3G+ enhancement script, using "Full Mode". In the original script, there is also a "Lite Mode" for some networks (like AT&T) I included in v1.3.
To make your network stable, the script will disable the two lines below :
ro.ril.enable.dtm=1 (will be turned to 0)
ro.ril.enable.a53=1 (will be turned to 0)
To get full details about the 3G+ tweak, check the thread :
http://forum.xda-developers.com/showthread.php?t=951765
Why is there "so many" different batch files ?
It's easier for me to improve/maintain the batch by splitting it into different functions. There's a main script, and subroutines called when needed.
Of course, all the subroutines, including addons, are programmed to be run only from main script. You can run any subroutine separately, but it will mostly crash and create useless files not being deleted. Always run the main script, and do no try to run separately subroutine - not dangerous, but 100% useless/buggy.
- It's not working.
* Make sure your device is :
** ROOTED,
** Full external access to system (su command) [if not, will drop errors like "Operations not permitted" or "file system is mounted read only")
** USB Debugging is enabled,
** Connected using USB and all USB drivers are installed/working.
* You might need administrative privileges in Windows to fully run the program.
* If you're running your device from recovery, you may need to mount /system/ folder before running the script (Partition tools > Mount /system).
- It's still not working.
* Drop a message in the official thread.
* If you get errors about file system Read only, try to run your device in Recovery mode, and fix permissions.
- Will the script create lots of files/make a big drive footprint ?
I hate programs creating lots of temp files. So, the script was developped to create files AND to clean/remove them all once everything is done. Even if it crashes without removing files, you just need to restart the script - it will clean all previous temporary files.
If ADB is run, it WILL be fully closed once everything is done. Server will be killed, then ADB process (named adb.exe) will be killed. Your system will be as clean as it was before running the script.
The script is of course fully portable : there's no installation needed. You can put the script where you want, but you just need to keep all script files/folders in the same folder.
In a future release, I'll add something to purge the log file.
- Which OS is supported ?
It's developped in Windows 7 x64. You should be able to fully run it on any 2000+ Windows NT OS.
As it is NT script, it will work only on Windows computer. It will also not work properly on pure DOS (it's using NT commands and Windows-related commands not included in older Windows NT systems, like NT4).
Report if you tested it on other Microsoft OS (NT 4, Windows 95, 98 or 2000, Dos 6.22...)
- I wanna contribute.
Just right click the .cmd/bat files, edit them with Notepad or anything you want
You can also send me a message (thread or PM) if you notice some piece of code I can improve with other commands (I don't know DOS commands enough )
v1.0 (11/5/2011) = initial release
v1.1 (13/5/2011) = removed BFC tags, updated error 2 (ADB get-state, to help you identify problem), removed 3G tweak returns error 3 if not present (addon = not necessary), added template.bat to create add-ons, improved launcher.bat (add-on primitive detection), added add-on installation detector (displays backup/reboot options only when add-on was installed), corrected folder "\" bug
v1.2 (13 may formely 14/5/2011) = added automated deleter/file checker for 3G+ tweak. Still early stage but looks to work. Automated batch thanks to http://www.dostips.com
v1.3 (16/5/2011) = added 3G+ enhancement lite mode (for networks like AT&T) and removed 1 step on auto deletion, fixed bug of false error when trying to download from device a build.prop.bak not existing, added management options to Backup (send local backup to device, delete backup on device), solved backup internal error
v1.4 (29/5/2011) = fixed window console size, enhanced menus, faster script closing, log file generator, several bugs fixed, enhanced help (readme in Notepad, direct open XDA thread in Firefox), added adb.exe process killer
v1.5 (6/6/2011) = added console title, fixed some menu bugs, updated Readme, weblinks now open in the default user browser, build.prop will now open in default notepad editor, improved interface, fixed unexpected exit bug, added contact me using default email (still experimental)
v1.6 (15/6/2011) = improved ADB process killing, deeply improved 3G tweak script with sed and no more TXT file, readme opens in your default editor, improved interface, updated template, unified common subroutines into BAKengine.bat, user-friendly explorer of build.prop (not great for now), deleted Substengine (deprecated), "0" in menues now refers to Go Back/Exit, improved missing engines detection, added general temp/log file purger/deleter ** To celebrate The Legend of Zelda series 25th Anniversary, my script is now tagged "Powered by Hyrule DOS"
DETAILLED 3G Addon update :
- detects presence of previous installation and files
- Sed command : fastest detection and subtitute of lines
- Optimized for fastest operation and fully clean build.prop file
- Several stuff...
External SED support thanks to GNU Utilities for win32 @ http://unxutils.sourceforge.net/
v1.7 (26/7/2011) = fixed no deletion of TEMP folder/files, fixed ADB command not found, new entries for XPlorer
Known bugs :
* (Main) Will not detect if build.prop.bak and build.prop.old are the same (not very important, I'll improve this later)
* Report anything you find
Developper/Advanced user addendum
(Write in progress)
Backup management
The script creates up to two backups, localed in main directory :
- build.prop.bak
- build.prop.old
Build.prop.old is generated if the script detects there's an existing build.prop.bak, to avoid accidental loss of it.
Build.prop.old is the final backup, and WILL BE DELETED if detected. The script manages backups like this :
1. If an existing build.prop.bak is present...
>> Script will detect for build.prop.old presence - if it exists, it will be deleted,
>> the build.prop.bak will be renamed to build.prop.old.
2. If there is no build.prop.bak detected...
>> Script will generate a build.prop.bak.
ADB Error detection
Error 2 (device not connected) works using a trick - it's not really related to device state.
In fact, the script will attempt to connect your device to download your build.prop. Once it is done - or not - the script checks if a local build.prop file was created. If it's not present, it means ADB encountered an error - about 90% because device is not connected - and will display error 2.
Keep in mind then there is small chance that your error does NOT come of device not connected : administrative privileges missing (don't allow the script to create the file), drivers buggy, ...)
Hi,
I cant use your WorkTool V1.6
It says ADB cmd not found.
v1.7 out, sorry for delay, I prepared it few days ago then I forgot to upload ^^
Really good work
Perceval from Hyrule said:
FAQ​- Supported devices
It is first developped for Sony Ericsson XPERIA x10, but it should work on any Android device with these requirements :
* Rooted
* File system is mounted Read/Write.
* Build.prop is located into /system/ and named "build.prop"
Sony Ericsson XPERIA x10 : fully working
Samsung Galaxy S2 : half working (file system is read-only...)
- How it's working ?
The script works generally in this way :
It downloads from your device your build.prop and creates two temporary backups.
Then, it opens one of the temporary backup into notepad, to let you edit all you want.
Once file closed/saved, the file is reconfigured automatically, then sent back to your device.
The script allows you next to keep, on wish, the remaining backup and to reboot your device.
- Is this safe ?
The script makes a backup of your build.prop every time you try to access it. There's also human-friendly log file to help you identify problems with ease.
There is also NO automatic upload to your device : the script will always ask you before if you want to upload the new build.prop to your device. Even if you upload it, backup is stored and can even be stored safely on your device for future use.
- Is this all automatic ?
Yes. The script makes backups by itself, reboot your device for you (if you wish), and of course change permissions. But don't worry : it will ask your approval for any important process
- The 3G tweak makes my connection unstable !
The Manager is based on my 3G+ enhancement script, using "Full Mode". In the original script, there is also a "Lite Mode" for some networks (like AT&T) I included in v1.3.
To make your network stable, the script will disable the two lines below :
ro.ril.enable.dtm=1 (will be turned to 0)
ro.ril.enable.a53=1 (will be turned to 0)
To get full details about the 3G+ tweak, check the thread :
http://forum.xda-developers.com/showthread.php?t=951765
Why is there "so many" different batch files ?
It's easier for me to improve/maintain the batch by splitting it into different functions. There's a main script, and subroutines called when needed.
Of course, all the subroutines, including addons, are programmed to be run only from main script. You can run any subroutine separately, but it will mostly crash and create useless files not being deleted. Always run the main script, and do no try to run separately subroutine - not dangerous, but 100% useless/buggy.
- It's not working.
* Make sure your device is :
** ROOTED,
** Full external access to system (su command) [if not, will drop errors like "Operations not permitted" or "file system is mounted read only")
** USB Debugging is enabled,
** Connected using USB and all USB drivers are installed/working.
* You might need administrative privileges in Windows to fully run the program.
* If you're running your device from recovery, you may need to mount /system/ folder before running the script (Partition tools > Mount /system).
- It's still not working.
* Drop a message in the official thread.
* If you get errors about file system Read only, try to run your device in Recovery mode, and fix permissions.
- Will the script create lots of files/make a big drive footprint ?
I hate programs creating lots of temp files. So, the script was developped to create files AND to clean/remove them all once everything is done. Even if it crashes without removing files, you just need to restart the script - it will clean all previous temporary files.
If ADB is run, it WILL be fully closed once everything is done. Server will be killed, then ADB process (named adb.exe) will be killed. Your system will be as clean as it was before running the script.
The script is of course fully portable : there's no installation needed. You can put the script where you want, but you just need to keep all script files/folders in the same folder.
In a future release, I'll add something to purge the log file.
- Which OS is supported ?
It's developped in Windows 7 x64. You should be able to fully run it on any 2000+ Windows NT OS.
As it is NT script, it will work only on Windows computer. It will also not work properly on pure DOS (it's using NT commands and Windows-related commands not included in older Windows NT systems, like NT4).
Report if you tested it on other Microsoft OS (NT 4, Windows 95, 98 or 2000, Dos 6.22...)
- I wanna contribute.
Just right click the .cmd/bat files, edit them with Notepad or anything you want
You can also send me a message (thread or PM) if you notice some piece of code I can improve with other commands (I don't know DOS commands enough )
v1.0 (11/5/2011) = initial release
v1.1 (13/5/2011) = removed BFC tags, updated error 2 (ADB get-state, to help you identify problem), removed 3G tweak returns error 3 if not present (addon = not necessary), added template.bat to create add-ons, improved launcher.bat (add-on primitive detection), added add-on installation detector (displays backup/reboot options only when add-on was installed), corrected folder "\" bug
v1.2 (13 may formely 14/5/2011) = added automated deleter/file checker for 3G+ tweak. Still early stage but looks to work. Automated batch thanks to http://www.dostips.com
v1.3 (16/5/2011) = added 3G+ enhancement lite mode (for networks like AT&T) and removed 1 step on auto deletion, fixed bug of false error when trying to download from device a build.prop.bak not existing, added management options to Backup (send local backup to device, delete backup on device), solved backup internal error
v1.4 (29/5/2011) = fixed window console size, enhanced menus, faster script closing, log file generator, several bugs fixed, enhanced help (readme in Notepad, direct open XDA thread in Firefox), added adb.exe process killer
v1.5 (6/6/2011) = added console title, fixed some menu bugs, updated Readme, weblinks now open in the default user browser, build.prop will now open in default notepad editor, improved interface, fixed unexpected exit bug, added contact me using default email (still experimental)
v1.6 (15/6/2011) = improved ADB process killing, deeply improved 3G tweak script with sed and no more TXT file, readme opens in your default editor, improved interface, updated template, unified common subroutines into BAKengine.bat, user-friendly explorer of build.prop (not great for now), deleted Substengine (deprecated), "0" in menues now refers to Go Back/Exit, improved missing engines detection, added general temp/log file purger/deleter ** To celebrate The Legend of Zelda series 25th Anniversary, my script is now tagged "Powered by Hyrule DOS"
DETAILLED 3G Addon update :
- detects presence of previous installation and files
- Sed command : fastest detection and subtitute of lines
- Optimized for fastest operation and fully clean build.prop file
- Several stuff...
External SED support thanks to GNU Utilities for win32 @ http://unxutils.sourceforge.net/
v1.7 (26/7/2011) = fixed no deletion of TEMP folder/files, fixed ADB command not found, new entries for XPlorer
Known bugs :
* (Main) Will not detect if build.prop.bak and build.prop.old are the same (not very important, I'll improve this later)
* Report anything you find
Click to expand...
Click to collapse
Hey mate...
lovely piece of work..!
saved me hours at my work...
thanks a lot works flawlessly on
sony xperia tipo dual with cm 10
Ur da bomb
As you probably already know, you are DA BOMB, BABY!
I just [snicker] used your tool to save my rather idiotic...er, 'brain' from suffering through a dumb, hard night re-flashing SlimKat 4.4.2 back onto my LG Optimus G e970 just to fix something I should've never done to begin with (change screen density to make it easier to read, of course, but without really knowing what I was doing)...
aherm...well, anyway, here I sit at a pre-midnight hour thanking you profusely, sir, because, as I said at the start...
UR DA BOMB!!!
Here's hoping you get bored a lot more often...it's a keeper, fer sure.:victory:
Good work dude... Nice toolkit, loved it very much... I am integrating your tool into my new upcoming toolkit. Dont worry i am not gonna steal it, will just use it. Will surely give you proper credits for that
Does this work with the stock recovery without root?
My device: Xperia XA2
thanks for this useful helper. i know how to modify build.prop - thats not the reason why i came here. what i don't know is the meaning of all this different entries in build.prop for example ro.expect.recovery_id - which there was a catalog with information about included in a build.prop Tweak GUI
sorry but the program cant detect/ acces build.prop
my device is rooted, has debugging on and is connected via USB
plz help

[SCRIPTSET v2.6][02/28/2012] Build native GNU/Linux applications: the easy way

New: SANE (USB Scanner backend and drivers) - OTG equipped device needed to work for this - YES, Scanner Access Now possible and Easy with your phone
This can (in combination with tesseract-ocr) be very useful to recognize text from scanned images.
For pictures see also http://forum.xda-developers.com/showpost.php?p=23046120&postcount=187
Update 01/30/2012: Now with a small android app (ScriptStarter) to start services and other shell scripts easily from the GUI. See bottom of the post.
WHAT'S POSSIBLE WITH THIS SCRIPT:
With this bash script your are able to build relatively easy from source a lot of native software (over 90 at the moment) from the GNU/Linux community for your Android phone and you will have
the good experience with free software.
All these tools and programs are not "apps for the GUI" for Android but native running command line tools "under the surface" of your Android GUI like the kernel and other services.
Don't ask me if it makes any sense to install program xy (like MySQL) on a phone. This is your decision. It's possible, so try it and see what you can do with it.
Note: I tested most of the compiled software on a Samsung Galaxy S2 (my phone). I cannot test it on a variety of phones because I have no mobile phone shop...
Currently buildable with this scripts (abstract, see the full list in package_selection.conf):
PHP 5.3.10 (with almost all extensions and XCache)
MySQL 5.5.19 (if you want a full database server on your phone...)
lighttpd 1.4.30
OpenSSH 5.9p1
OpenSSL 1.0.0f
Samba 3.6.3
cURL 7.23.1
bash 4.2
BusyBox 1.19.3
ImageMagick 6.7.4-10
OpenVPN 2.2.2
Python 2.7.2
Node.js 0.6.7
git 1.7.9
Wget 1.13.4
Rsync 3.0.9
TCPDUMP 4.2.0
Midnight Commander 4.8.1
Pure-FTPd 1.0.35
screen 4.0.3
iptables 1.4.10 (without bionic bug "getnetbyaddr()" and with iptables-save/restore!)
BIND 9.8.1-P1
Lua 5.2.0
Ruby 1.9.3-p0
usbutils 004
MTDUtils latest git
GCC 4.6.2 (c, c++)
GNU Coreutils 8.14, Binutils 2.22, Findutils 4.4.2, Inetutils 1.8
QEMU 0.15.1
SANE 1.0.22
tesseract-ocr 3.01
...
a lot of libraries, development tools and other useful programs
...
FEATURES:
automatic download and untar the cross-compilers (if not already done) for cross compiling
automatic download and untar the source packages (if not already done), that you have selected
solve dependences and reserves additional needed packages
apply patches to the sources if necessary
build them, "install" them in a folder for later "ready to transfer" to your phone and stripes the binaries and libraries to reduce the filesize if selected
autogenerate a tar file and adb push the file to device if selected
allows you to use well-known software like PHP, MySQL, OpenSSL, OpenSSH, OpenVPN, bash and lighttpd on your phone (see the full list in file package_selection.conf, see attachement)
scripting and development on your phone
no limits with BusyBox (without want to be derogative, BusyBox is a wonderful tool), full featured tools like Coreutils, Binutils etc.
build scripts are expandable with other or newer packages you eventual want to have
QUESTIONS AND ANSWERS:
Q: Do I need native GNU/Linux programs and what is that?
A: If you do not know what native Linux applications are, then stop here - you don't need them.
Q: What can I do with these tools?
A: Many things. As a developer you can use the libraries to include them in Android GUI apps, as user you can start for example a webserver on your phone and write some HTML or PHP pages
just for fun or replace BusyBox with full featured tools (or only some commands).
Some tools are also very useful to find network errors, check the network traffic and many more.
Q: What do I need?
A: A Linux installation (VM or real), some Linux knowledge and a little bit time to read all instructions carefully. A rooted Android device with enouth free memory (ext2/3/4 formatted)
See README for details.
Q: Costs?
A: Nothing. The scripts are Open Source (GPL v3), the packages are GPL licensed or under a similar license. The cross-compilers are Open Source or free to use for non-profit purposes.
But I would be pleased if I get a donation and/or a press on the "Thanks button", if the scripts are useful for you. It was a long and hard work...
Note: The attachement scriptset-x.yy.zip is double packed (inside .bz2), because I want preserve the right settings of the scripts.
STEPS:
Selected the desired packages in the config file
Adjust the compiler settings for your phone
Run the build script to download and compile the software
Copy the generated TAR files to your phone or let "adb" this do for you and unpack them in the prepared sysroot folder
For more information please read the instructions in "README"
Please let me also know if you have any problems or if you have questions or further suggestions.
Thanks go to the Open Source community and a lot of people/webpages with hints about cross-compiling software.
Thanks
smitna
CHANGELOG:
01/14/2012 First public release v0.9
01/14/2012 Update: Removed unneeded big patch for ncurses
01/15/2012 Release of v1.0
Update: Fixed build of gcc. Note: the header files are not copied automatically with the script.
If you want to compile on your phone, set TAR_HEADERS=1 in configuraton.conf
Typos: some translations corrected in build.sh
01/16/2012 Release of v1.1
Update: Removed building of fsck from util-linux-ng, it's in e2fsprogs
Update: ISC Cron / vixie cron: set correct paths in pathnames.h before compiling
Enhancement: More detailed explanation of device specific compiler settings with list of possible values
Update: Removed dependence e2fsprogs libs from e2fsprogs
01/17/2012 Release of v1.2
Update: Build of zip, zipcloak, zipnote, zipsplit, unzip, unzipsfx and funzip now possible without errors
01/17/2012 Release of v1.3
Update: Added Node.js
Typos: some translations and language errors corrected in build.sh and README (sorry, I'm not a native English speaker...)
01/18/2012 Release of v1.4
Fixed TMP_PATH in PHP extension XCache (mmap.c) to prevent startup warning
Fixed BusyBox problems with static build against glibc ("__getpagesize" segfault with ping, traceroute and other networking parts)
and added some BusyBox patches.
BusyBox is now dynamic linked, so don't replace the system BusyBox with this build, because of missing mount/paths to libraries at phone startup
01/20/2012 Release of v1.5
Update: Cleanup in scripts and separation of configuration and code. Now it's only necessary to edit configuration.conf and package_selection.conf
Update: Added gzip
Update: Added experimental adb push to device if the device is connected and permissions are ok
Update: Check for installed programs. Script now exists on check failure to minimize errors while compiling.
01/21/2012 Release of v1.6
Bugfix: MySQL build could fail if gen_lex_hash could not generate the file sql/lex_hash.h in pass 2
Update: adb push should now work, check for connected device (and possible multiple devices) and check for right permissions to use the device
Enhancement: Even more explanation of device specific compiler flags and some hints to find the right settings.
01/21/2012 Release of v1.7
Enhancement: To eliminate sure a failing MySQL build, with every new run the source folder will be removed before completely
Enhancement: file version is now strictly checked (the host version must be the same as the cross version)
Some minor changes and filechecks (e.g. autoconf)
01/23/2012 Release of v1.8
Bugfix: Python has SQLite dependencies and SQLite must be ready before Python configure/make
Bugfix: In certain circumstances the optimizer settings get lost
Bugfix: Removed --enable-multibyte from bash, no chance to use it with NDK
01/24/2012 Release of v1.9
Update: Added ngIRCd (Please read the comment for this server, because of running as root)
Update: Sorted the links and package names in the config a little bit...
01/26/2012 Release of v2.0
Bugfix: OpenSSH wants to touch /var/empty while compiling, should be fixed --with-privsep-path now set (thanks to member dateno1 for his reports of such warnings/errors)
Bugfix: Removed a wrong CFLAG -I path from NDK config (only useful for me, really useless for others...)
Enhancement: Example for a user db for Pure-FTPd virtual user database in README (please use virtual users, it's the best and easiest solution)
Update: OpenSSH build need ssh-keygen for the generation of the default keys, added this info to README and the package selection
Bugfix: Not really a bugfix, but some installers don't set the right permissions of libraries in the sysroot folder, so set them global in the final task
Bugfix: Removed --with-lastlog=$TARGET_SYSROOT/var/log/lastlog from OpenSSH and added --with-lastlog=no, I don't know why this is not working and throws a warning, but we can live without it...
Enhancement: Added option to choose the sysroot variant from the CodeSourcery libs: v5TE (default), v4T (old), thumb2 (v7, fastest if supported by the phone)
Enhancement: Added option to tar the headers for development on the device with CodeSourcery (hint: always set rpath in LDFLAGS to make use of the CodeSourcery libs)
01/26/2012 Release of v2.1
Update: Added getcap/setcap and libraries from wishlist, needs libtoolize. Note: This is in a testing stage, kernel and filesystem support needed!
01/30/2012 Added a ScriptStarter app
09/02/2012 Release of v2.2
Update: Local compilation of static "tic" from ncurses for buildhost, if ncurses installation is missing
Enhancement: "downloading only" mode without compiling the packages (and force download)
Enhancement: some parameters for starting the script with additional functions (show with ./build.sh help)
Enhancement: more logging and outputs
Enhancement: language specs, all outputs can be changed to other languages in build.sh
Update: Added dosfstools
Update: Added Ruby
Update: Added example configs and starter scripts for Samba and OpenSSH
Update: Use of http-URLs if possible and update of some broken external links since last release
Bugfix: util-linux-ng needs gettext, added dependence
Bugfix: Added parameter to Samba to solve user/group settings and socket_wrapper support to set path vars at runtime
Update: Changed PHP version to 5.3.10, Samba to 3.6.3 and git to 1.7.9
02/11/2012 internal Release v2.3
Bugfix: openVPN patch for /dev/tun and links to ip/netstat/ifconfig/route, see hints for symlinks
02/16/2012 internal Release v2.4
02/25/2012 Release of v2.5
Update: Added LAME
Update: Added experimental CUPS
Update: Changed PNG version to 1.5.9
Update: Added Net-SNMP
Update: Added Netpbm
Update: Added PNG 1.2.47 for Netpbm and phpSANE
Update: Added LibTIFF
Update: Added SANE (USB Scanner backend and drivers) - OTG equipped device needed to work for this - YES, Scanner Access Now possible and Easy with your phone
Update: Split patches for bash (4.1 and 4.2) for better and easier (automatic) inclusion of original patches
02/28/2012 Release of v2.6
Update: Added Cuneiform OCR
Update: Added tesseract-ocr (see hints for more details howto use it)
ScriptStarter
02/03/2012 Added a small ScriptStarter for the GUI. With this app, written with JQuery, PhoneGap and Java (wrapper to execute the shell scripts) it's possible to start for example the lighttpd web server, Pure-FTPd or MySQL from within the Android GUI without a terminal and read the output. If a script needs root access, there is a checkbox to allow this. For this to work, copy the script sush in the script folder. All scripts ending with .sh can be started (please choose after the first start your script folder on the device to add the scripts to the selection, normally your [SYSROOT]/sbin folder).
Three buttons (start, stop and status) are predefined for start-stop-status scripts, there is also a parameter input field for more start values.
Free GPL v3 source code also included (Eclipse project). Please don't expect too much eye-candy. The GUI could be much better, but my CSS skills are very limited...
I added a few example scripts in the zip file, for example a battery stats reader. Before starting these scripts, have a look in the source code to be sure that they are compatible with your device.
Update 0.97 02/03/2012: Now the stderr is also printed in the output window
Update 0.99 02/10/2012: Replaced scrolling api with a much better solution (jScrollPane) for the output window. Not the real Android scroll feeling, but it's usable.
Thanks! I would hit the Thanks button, but I am on my mobile atm.
Sent from MIUI powered phone
Someone tried it? Problems?
Please, I need your feedback...
Sounds interesting, I'll try once I get back home and share feedback here
now i try to all packages for test
i will test on cortex a8 (motolora xt720)
TARGET_MARCH="armv7-a" (not work on armv7 )
TARGET_MTUNE="cortex-a8"
TARGET_MFPU="neon"
TARGET_MFLOAT="softfp"
it make dynamic binarys but i don't want dymanic type (because it difficult to divide one thing and maybe not work on android's libs)
how can i make static type?
ps : oh...it has so many comile error (even can't read or count all)
dateno1 said:
i will test on cortex a8 (motolora xt720)
TARGET_MARCH="armv7-a" (not work on armv7 )
TARGET_MTUNE="cortex-a8"
TARGET_MFPU="neon"
TARGET_MFLOAT="softfp"
it make dynamic binarys but i don't want dymanic type (because it difficult to divide one thing and maybe not work on android's libs)
Click to expand...
Click to collapse
I hope I understand your question. Why not dynamic?
Yes, you have to set the parameters for your mobile phone. For TARGET_MARCH try "armv7", for TARGET_MFLOAT "softfp" and for TARGET_MFPU "vfp" but check this last setting carefully for this phone.
It's very hard to build a full static binary (and sometimes nearly impossible) and it's also hard to build against bionic (with NDK). I had no good experience with it . A lot of compiler runs wasn't sucessful. Edit: I also had for example massive problems with openssl. I couldn't find a way to build it with NDK or static and then build other programs like cURL with openssl support.
Static binaries are also too big and not necessary. For this we have a sysroot environment to be independent from bionic and without the restrictions. The compiled libs and binaries are linked to the CodeSourcery glibc and have set the custom "rpath" for the dynamic loader. That's no problem I think.
that's simple
if someone want to make some binary for all version of android (even same cpu) it will not work well (defend on basic lib(ex : libc) is ok but complex things will not work)
i know make static type binary is very difficult but it valable
dateno1 said:
that's simple
if someone want to make some binary for all version of android (even same cpu) it will not work well (defend on basic lib(ex : libc) is ok but complex things will not work)
i know make static type binary is very difficult but it valable
Click to expand...
Click to collapse
You are right, if you want to build a "portable" binary, you have to set very safe settings, like TARGET_MARCH="armv5", the full list is in the "README". But it's not my main target to offer a solution that is easy portable to other phones, instead you can build the software with optimizations for your phone to "get the best" for it
smitna said:
You are right, if you want to build a "portable" binary, you have to set very safe settings, like TARGET_MARCH="armv5", the full list is in the "README". But it's not my main target to offer a solution that is easy portable to other phones, instead you can build the software with optimizations for your phone to "get the best" for it
Click to expand...
Click to collapse
just i want to add some more function on the phone
thanks for patch files
I want to try this, to install some apps(most interested fro mc), but I don' t wanna change my sd card.
Can I use phone' s /data partition as mysysroot directory? I have 1.5GB space available on data partition, it is 2GB all.
And If yes, I must create the dir: /data/mysyroot? And where to create this dir on pc? On root directory of my linux system?
dancer_69 said:
I want to try this, to install some apps(most interested fro mc), but I don' t wanna change my sd card.
Can I use phone' s /data partition as mysysroot directory? I have 1.5GB space available on data partition, it is 2GB all.
And If yes, I must create the dir: /data/mysyroot? And where to create this dir on pc? On root directory of my linux system?
Click to expand...
Click to collapse
You can use the /data partition. Just create a new folder, for example /data/sysroot. On your PC you have to create the same temporary with full user rights. This is not your working dir for building. Create a new dir in /home/user and unpack the files there. In settings insert the /data/sysroot as TARGET_SYSROOT and change the other settings for your phone and choose mc=yes. Then start the ./build.sh
Thanks for your quick answer.
Just to make clear because my english understanding is not in a high level
I must create the /data/sysroot dir under "/"(root directory) on linux pc with superuser rights?
dancer_69 said:
Thanks for your quick answer.
Just to make clear because my english understanding is not in a high level
I must create the /data/sysroot dir under "/"(root directory) on linux pc with superuser rights?
Click to expand...
Click to collapse
Yes, that is right. But this is the only step you need to do as root or better with root rights. After this work as usual as user.
oh it can't make mysql
package selection : mysql only
target directory (prefix) : /sddata/mysql (on sdext on my system)
armv7-a
cortex-a8
neon
softfp
then run ./build.sh 2> error.txt
it is my error messages
http://pastebin.com/g7Yi4bGz
sorry you can see this link only today (my mistake)
this setting can make some binary and lib run on my phone but fail to make gcc or mysql (when i try gcc it just fail to making gcc only (other things were made) )
dateno1 said:
package selection : mysql only
target directory (prefix) : /sddata/mysql (on sdext on my system)
armv7-a
cortex-a8
neon
softfp
then run ./build.sh 2> error.txt
it is my error messages
http://pastebin.com/g7Yi4bGz
sorry you can see this link only today (my mistake)
this setting can make some binary and lib run on my phone but fail to make gcc or mysql (when i try gcc it just fail to making gcc only (other things were made) )
Click to expand...
Click to collapse
Please notice first, that you should not run this script as root!!
Then there is something wrong with the build of the first needed packages:
ZLIB=yes
OPENSSL=yes
CURL=yes
GETTEXT=yes
LIBXML2=yes
READLINE=yes
NCURSES=yes
- The script cannot find the readline sources. Do you have a subfolder readline-6.2 in folder sources in your builddir? Same for the other source folders. The script first downloads the packages to folder packages, extract the tars in folder sources, repeated for all selections.
(look at line 67 in your log: ./build.sh: 1402: cd: Python-2.7.2: No such file or directory)
- You have no "xz", install it first and make sure, that the other necessary packages are installed. MySQL and gcc are "two pass" compilations and this builds generating temporary binaries, runable on your linux pc. So you need all for a successful compilation of such binaries like gcc, make, python etc. on your linux machine. If you are using Ubuntu, then install the "meta-package" build-essential, look in the README.
Do you have the other unpacking tools like gunzip etc. Please install also "bison"
You should do following steps:
1. First select only the necessary packages (see above), all others to no.
2. If zlib, python, readline an the others are cross-compiled (without errors) and the libraries are in ./sysroot/lib, then deselect them (=no) and select mysql=yes and start a second run with ./build.sh
smitna said:
Please notice first, that you should not run this script as root!!
Then there is something wrong with the build of the first needed packages:
ZLIB=yes
OPENSSL=yes
CURL=yes
GETTEXT=yes
LIBXML2=yes
READLINE=yes
NCURSES=yes
- The script cannot find the readline sources. Do you have a subfolder readline-6.2 in folder sources in your builddir? Same for the other source folders. The script first downloads the packages to folder packages, extract the tars in folder sources, repeated for all selections.
(look at line 67 in your log: ./build.sh: 1402: cd: Python-2.7.2: No such file or directory)
- You have no "xz", install it first and make sure, that the other necessary packages are installed. MySQL and gcc are "two pass" compilations and this builds generating temporary binaries, runable on your linux pc. So you need all for a successful compilation of such binaries like gcc, make, python etc. on your linux machine. If you are using Ubuntu, then install the "meta-package" build-essential, look in the README.
Do you have the other unpacking tools like gunzip etc. Please install also "bison"
You should do following steps:
1. First select only the necessary packages (see above), all others to no.
2. If zlib, python, readline an the others are cross-compiled (without errors) and the libraries are in ./sysroot/lib, then deselect them (=no) and select mysql=yes and start a second run with ./build.sh
Click to expand...
Click to collapse
i'm not edit necessary part
ZLIB=yes
OPENSSL=yes
CURL=yes
GETTEXT=yes
LIBXML2=yes
READLINE=yes
NCURSES=yes
i just edit mysql=no => mysql=yes
ok try to install packages and run as not root
dateno1 said:
i'm not edit necessary part
ZLIB=yes
OPENSSL=yes
CURL=yes
GETTEXT=yes
LIBXML2=yes
READLINE=yes
NCURSES=yes
i just edit mysql=no => mysql=yes
ok try to install packages and run as not root
Click to expand...
Click to collapse
Good luck!
If you can wait a little bit:
In a short time I release a new version with better error and program checks and some small bug fixes. With this version it's not longer necessary to edit the build.sh, it's now all in only two separated configuration files (configuration and package selection).
hmm...fail to compile mysql again
with this error
note: the mangling of 'va_list' has changed in GCC 4.4
full error log on http://pastebin.com/jd1Pw9Xw
dateno1 said:
with this error
note: the mangling of 'va_list' has changed in GCC 4.4
full error log on http://pastebin.com/jd1Pw9Xw
Click to expand...
Click to collapse
Hello dateno1,
first: you have *NOT* changed to a user account as promised
The va_list is only a note, not an error, no problem (but ask the MySQL devs why they haven't adapted the code to gcc 4.6.1).
Your Python cross binaries and libraries are not ok (from you broken first build?). Please start from a "fresh state" (delete the folder sources/Python-2.7.2 and sysroot) or start from a total clean state.
Please use the latest 1.5 version of the script because of the xargs warnings at the end
Delete the complete sysroot folder, there are some folders not in place (data and docs). There is a script remove_all_files.sh
Start this script in your buildroot with ./remove_all_files.sh to remove all files and symlinks in subfolder sysroot.
Edit: delete the sysroot folder complete, there are some other missing folders from your first build!
Start again with ./build.sh and activated packages (the "ALWAYS NEEDED" one and MySQL)
smitna said:
Hello dateno1,
first: you have *NOT* changed to a user account as promised
The va_list is only a note, not an error, no problem (but ask the MySQL devs why they haven't adapted the code to gcc 4.6.1).
Your Python cross binaries and libraries are not ok (from you broken first build?). Please start from a "fresh state" (delete the folder sources/Python-2.7.2 and sysroot) or start from a total clean state.
Please use the latest 1.5 version of the script because of the xargs warnings at the end
Delete the complete sysroot folder, there are some folders not in place (data and docs). There is a script remove_all_files.sh
Start this script in your buildroot with ./remove_all_files.sh to remove all files and symlinks in subfolder sysroot.
Edit: delete the sysroot folder complete, there are some other missing folders from your first build!
Start again with ./build.sh and activated packages (the "ALWAYS NEEDED" one and MySQL)
Click to expand...
Click to collapse
make new account (compile.compile) and use su -c "./build.sh" compile
i think it work (compiled file's owner is changed to compile.compile)
now i delete almost files and folders (exclude android-ndk, readline-6.2, toolchains) and retrying...oh failed (attach new log (full) )
'를 위해 할 일이 없습니다' mean 'no job for~'
'오류' mean 'error'

[TOOL][SCRIPT] ADB Sync Tool - PowerShell Script

This is the first time I have posted any of my work, so hopefully I have it in a suitable place.
This script is to sync directories from an Android device to a windows machine. This is a one way sync, and will only copy the files which have been changed on the device. Thus making the whole process much quicker.
This script has been tested by myself using a SGS3, however I cannot guarantee this script will work as expected for any other device as I haven't had it tested.
Please report any issues to me, with as much information regarding the problem as possible as this will give me the best chance of fixing the issue. Same goes for any feature requests or improvements. I wrote this for own needs, but felt might be useful for other windows users out there.
ADB must be on the windows PATH. See link -> http://www.computerhope.com/issues/ch000549.htm
PowerShell's Execution Policy should be set to RemoteSigned. See link -> http://technet.microsoft.com/en-us/library/ee176961.aspx
This script takes a CSV file and should be called in the following manor using a powershell console
Syntax: .\adbsync.ps1 dirs.csv
Where dirs.csv is a csv file with two columns. The first row contains
the headers "source" and "target". Each following row contain the paths.
example csv file (file also included in the zip)...
Code:
source,target
/storage/extSdCard/TitaniumBackup,.\Sync\storage\extSdCard\TitaniumBackup
/storage/extSdCard/clockworkmod,.\Sync\storage\extSdCard\clockworkmod
This will sync the TitaniumBackup directory on the external sdcard
to a folder called Sync keeping the same structure as on the device.
You only need to specify the top level folders as this script will recurse the folder structure.
WARNING: This script will remove files from the target directory without prompt
if the files in that directory don't exist on the source directory.
Nothing will be removed from the source directory.
This script is provided as-is, no warrenty is provided or implied. The author is NOT responsible for any damages or data loss that may occur through the use of this script. Always test, test, test.
This script is free to use for both personal and business use, however, it may not be sold or included as part of a package that is for sale.
CREDITS:
xenomachina's python based adbsync. This was the inspiration behind this script
https://github.com/xenomachina/adbsync/blob/master/adbsync.py
VERSION HISTORY:
1.0 - 08.01.2013 - Initial release
Hit the Thanks button if you found this useful

[Toolkit][Windows&Linux(Wine)] Already Setup Adb/Fastboot Environment and Installer

[Toolkit][Windows&Linux(Wine)] Already Setup Adb/Fastboot Environment and Installer
First, I take donations.
Second, see the 2nd post about Windows XP compatibilty.(XP requires that the tool be used on a usb drive or a partition that does not contain the current running operating system)
(For the other OSs it works fine on the drive with the running OS) (For Linux see the last post)
Third, XP users that don't have a removable drive available can use the XP-ONLY version on the local drive.
Fourth, read EVERYTHING here on the first and last post.
Fifth, adbClient is a download, unzip, connect to phone package that requires nearly no setup at all allowing you to use the android debugging bridge.
If you want to install adb and fastboot use the "instadb" command.(If you get an access denied error, you must have the administrator password and check your typing)
ANSWERS TO YOUR PROBLEMS:
If you want to update but continue to keep automagically using your work folder: you must copy the Work folder into the folder above the updated bin folder.
Like so: extract the new package. copy the old work folder into the new extracted folder. your work folder should sit right beside the launchadbclient script and the updated bin folder.
This tool can be moved anywhere alongside the work folder
HOW TO USE:
To launch the script extract the zip and run LaunchadbClient by double clicking on it.
Type "xt" without quotes to see a menu for commands.
Check out some package management by typing apk.
To install adb and fastboot to the system without fiddling with environment variables use the instadb command.
DRIVERS:
Visit this link first to enable usb debugging:
To utilize the Google usb driver extract its zip and right click the android_winusb.inf file and hit the install option.
If Google's drivers dont work or you have no drivers or adb doesn't mention any connected devices at the top of the window then you need to visit your manufacturers website for your phone's driver.
Here is the pdanet all purpose adb driver that is pretty much fail proof. if you have any issues with it uninstall it and try another one from below.
If all three of those driver suggestions are not applicable then read the "OTHER DRIVERS" category:
OTHER DRIVERS: The Universal Naked Driver is a good one. Or you can follow this exceptional tutorial for all purpose adb driver installation (I am not responsible for any issues with the tutorial, I just found it.)
I recommend Adb Konnect from the play store if drivers are a problem.
Sometimes your usb cable is keeping you from using adb, so try changing cables.(this actually just happened to me with my samsung usb cable and i ended up using my nexus 7 one instead)
DESCRIBE THE TOOL:
This tool is here to make my life(and your life) with adb easier.
It's the windows command line on steroids.
It is made for being put on a flash drive and being used on different computers.
Especially if you are using someone else's computer but want to keep an environment with your tools and files in it where you could just load it up from a flash drive.
It uses shortcuts for tools including and can autoroot etcetera among other features. This tool is free to use and distribute\modify with my name attached. It contains a presetup adb and fastboot environemnt and has extra binaries\scripts for working with the windows command line and android easier.
Overall it makes interfacing with android over adb much more interesting.
GETTING THE TOOL AND INFO:
1.9.5-XP_ONLY is for the Windows XP desktop only.
Version 3.2.9 is the latest stable release, Use this version please. Thanks for your interest.
If you want to take a snapshot of the latest development go here.
ANNOUNCEMENTS: I now have a donate button if you want to see more development.
I don't support 2.2 or 1.9.5 anymore. Only 3.x.
KNOWN ISSUES: tar might not work.
apklist won't auto exit because of the more pipe. just use control-c for now to unfreeze it
Some of the scripted adb commands stall.
EXTRA INFO:
The only thing that I own in the zip is the scripts. The copyright notice and license for android sdk and included files is included as Notice.txt and Noticeforadb.txt in the LicenseForAdbEtc.zip
With this tool their is no need to install adb or fastboot on your computer just run the script.
If you get an antivirus warning its because of the Zergrush, Psneuter, Framaroot, and ExynosAbuse root exploits.(And the Hstart binary sometimes)
I am not malicious anyway.(You can read my code easily)
You can copy the folder wherever you want. (I made sure it works)
Just don't have anything named bin in the same directory as the launch script.
EXTRA EXTRA INFO:
This tool is meant to be an extension to the command prompt and will pass anything that it doesn't understand over to the command interpreter.
It works in Wine. Extra launching needed. (See last post)
This is a tool for beginners and advanced users however beginners need to learn adb's commands before using this tool.
It will root 2.x and up(Support added for newer android versions). I suggest installing Supersu also.
Tool works on all windows versions: Wndows XP and above.
You are no longer encouraged to use the XP only zips for Windows XP.
For XP: If you use the tool on the local drive it throws errors however if you use it on a usb drive then it works fine
If you need to use it on a local drive then you can use the old win xp only version.
Windows 8 and 8.1 run the tool perfect.
Use the exit command to exit the tool.(It auto kills the adb server)
Links to third party tools used or included:
Recommended download: ApkMultiTool. Another recommended download: Mediatek flashtool
Framaroot
Exynosabuse
strace
Android Sdk
Stahlworks Binaries : Open source
Win32 Busybox Binary(pclouds) REPLACED WITH Tigress busybox
Freac Not in Slim builds.
Stericson Busybox Android Binary
Sqlite3 android
Supersu
Hstart for use with startup sound
This info applies to testing, finals, and anything else.
FUTURE CHANGES:
Code:
add start settings app and browser app command using am start
add intent disabler (Disable an app's MAIN so that it can be hidden from drawer and be unstartable "locked" )
add the ability to make img of a specified size and store it in /data and even loop mount it to sdcard
add the ability to live image the system and data partitions.
remember to make the user specify the filesystem for sdcard image
I need to backport all bug fixes and improvements to 1.9.5_XP-ONLY
use vbscripts to automate key sends (control-c) Not done due to batch sucking.
add su -c sh to start up root shell on device for use with things like strace. Not done due to batch sucking.
add if blank adb devices say you must connect with either cnt or plugging your device in. (But still show the output)
add variable for work folder
Migrate all custom data text files(hist,clr) to config folder in Work\ but keep defaults in regular bin folder.
add adbkiller script to the desktop by question on first startup.(Store info text file in userbin) (User variable then desktop)
clean output on adbp and adbps plus
change all du -smc to du -sm for single push/pull
add ability to do several pushes and pulls with du -smc in one operation
add parameters to adbp and adbps
add if not defined to destination and source file in adb and adbps to allow for hitting enter to quit in the middle of setting up a push or pull
cleanup and organize xt
include some sort of nano for windows binary for command line editing
include a compact notepad++
Remove extra binaries such as zip and unzip to point to busybox linkers (Skim through code to change "zip" to "busybox zip" or "sfk zip")
Pass all inputted commands to a script that can parse arguments before they are sent to they're respesctive scripts or binaries. (Mostly to catch /? and run it without call)
Remember to update adbClient Launcher to point to new folder.
Add first time greeting, explaining commonplace commands and the various folders using java.
add batch snake from [URL="http://www.dostips.com/forum/viewtopic.php?t=4741&mobile=on"]here[/URL] [URL="http://www.dostips.com/forum/viewtopic.php?t=4741&mobile=on"]and here[/URL] for fun
learn some design tips from batch snake.
add adb closer background script for when someone closes adbclient with the windows close button.
add ability to root adbps and adbp or just enable insecure adb debugging
setpass not using admin privileges, add call capability to use instadb privilege elevation code as an elevation module for the rest of my code)
search for commands
CHANGELOG:
This changlog is deprecated for the commits page on my github: https://github.com/lgrootnoob/adbClient_EnvironmentandTool/commits/master
Code:
With 1.3.1 adb/fastboot has been updated from platform-tools to rev. 19(Previously rev. 18.0.1)
Split 1.3.1 into xp only and vista up packages
Add a work command that will send you back to the work folder no matter where you are.
See third post.
Removed a couple of the zips in the post to make the download list easier.
Made license a separate download.
Add unroot function.
Implement extracter with a windows tar exe for extracting images from a tgz.
Make adb/fastboot installer for system. (%WINDIR%\system32) (To install the binaries just type instadb and follow the prompts)
(Installing adb and fastboot to the system makes adb or fastboot dependent applications operate without the need to setup complicated environment variables.)
(Before you would have had to make the environment variable point to the folder conanaining the binaries then you would have to check to make sure its setup properly. this will eliminate that issue)
Add the launch script into the package and update instructions. (JUST added launcher to make starting it easier.)
Issues with my implementations of certain processes inside the script.
Fixed updater typo.
Added sfk binary from stahlworks.(VERY useful tool [URL="http://stahlworks.com/products.html"]http://stahlworks.com/products.html[/URL])
Added zip and unzip binary from stahlworks
Added latest usb driver from google.
Add the launch script into the package and update instructions.
add win32 busybox and remove gnuwin32 tar command.
Apk install from file. And apk uninstall and apk installed lister. pm argument sender. apk command for menu
Version change in updater code. but server on mandatory downtime for a week.
Fixed problem with missing dlls in system32 install for adb and fastboot
^Fixed bugfix in 1.8 Whackamole:)
use nul to detect dirs
everything that is passed to cmd is called.(In 1.8.2+)
Added ls links to busybox and can use params like ls -l
Made links to busybox with batch files and parameters.
Added md5sum binary.
Make attempt at auto pushd popd implementation. To use this feature just cd to wherever then type back to go back.
New XP local drive version. (Remember that XP can run any version from a removable drive or drive that isnt the partition with the running OS on it.)
FIXED - Output cleanup and implementation of code rendering inner shortcuts unuseful)
add extra bin for user binaries in Work\userbin
added addpath command to append the current folder to the temporary path
Fix another bugfix.
testing version released so the version number on my server will not be updated until I have personally evaluated these builds for a couple of days.
implement pushd popd into my code
add windows tools from knife into adbclient.
made repo command.
added bin2hex binary
added deveject binary
move %clrsnd% %clrval% above the doneloop subroutine so busybox's ls command can properly highlight file names.
only use %clrsnd% %clrval% when needed (pretty much the same as I have done with adb devices and fastboot devices)
added zipalign binary
update updating system to live (ON)
add repo style p2p apt-get system called Gridlock(Thought of the name myself) (not p2p yet :( )
moved extended menu out of code and into a file to help clean up stuff.
add bash link for busybox
fixed up repo script address(dynamic)
added mkfloppy
fixed bug in apk installer code.
removed cmdmenusel and trashed the idea of using it for the preffered java dependency setup.
fixed small bug
changed exit for future dynamic handling of shutdown disk operations.
cat command takes over the beginning of the next echo so it has an echo. in its code.
Deprecated every addpath script and moving to modular addpath userspace script.
Also fixed varname bug in addpath script that made it worthless
Commented my info in.
fixed unrooting issue.
piped apklist to more.
Comment code/subroutines etc. and use whitespace to make it easier to read.(Half done, it needs more work)
everything below is for unreleased 2.3 version.
Strace helper
added goo.im opener
added audio converter freac (Freac has source code available freely on their webpage)
Remove just a couple lines from the inital output to make it fit the command prompt screen.
strace installer (chmod 777 adb push and su -c sh) for work with strace.
add data /T to top of script
added frontend for deveject binary because it is too complicated
make cnt a command that will take params so you can type cnt 192.168.1.81
^if no params are given it will ask for ip address
added send command to strace in testing
merged strace bug fixes into testing
fixed another path bug in testing
code now becoming very modular with me using scripted functions as commands in other scripts.
lgctnp always out to work dir now
fixed 'regression' in hist (Accidental reference to deprecated function broke it) (ALSO: fixed in clr)
project no subroutine/if statements: instead of using if statements on the users input on the main loop I will use batch files in my path that have the name of the user's command.
^This eliminates "" crashing.
add hash check for transmitted file. (Needs md5sum binary for android.) (Make it a question)
add busybox installer
add quick fixes menu for things like accidentally deleted launcher, etc.
fixed issue with busybox android binary got deleted.
added: 'mode con:cols=100 lines=50' for big console
fixed up lgctnp and dmsgnp code
add dmesg
quick patch for scroll height (It will be tweaked more in the future.)
[B]3.1.5 will be a temporary bug fix and binary addition in preparation for.......[/B]
make cd freac* point to full path instead
add startup Splash screen for christmas holiday
added Framaroot to rooter
added exynosabuse to rooter
adbsl is accidentally pointing to old doneloop subroutine and needs to be pointed to EOF
move from old pclouds busybox binary to [URL="http://intgat.tigress.co.uk/rmy/busybox/index.html"]tigress win32 busybox[/URL]
update android sdk dependent stuff (platform tools have been updated to 19.0.1)
update su and supersu
change call adbclient to call start adbclient so the intital launcher is exitable
java detector added
[B]3.2 Released![/B]
fix old subroutine pointers in devej
add startup sound
[B]3.2.1 Released![/B]
added screenshots to OP
patch instadb with set "installmaybe="
add size check for pulling/pulled or pushing/pushed files on adbp and adbps like the md5sum checker.'
update busybox/adb/fastboot/freac/anything else/check and update apk versions.
add question to adbp and adbps for redoing the push/pull operation if the user notices the hashes don't match
[B]3.2.4 Slim Released![/B]
change release naming scheme from final to only use final name for final release in 3.2.x, 3.3.x etc.
fix adbp to do you to "Redo pull operation?" instead of "Redo push operation?"
cleanup root.bat output organizing exploits by android version.
change subroutine pointer in ex from doneloop to :EOF
[B]3.2.5 Slim_ Maintenance Released![/B]
Google's usb driver updated to revision 9.
link every busybox applet
store busybox whoami value in variable and then put it into $~: set /p command
pointed launcher directly to bin folder name
updated binary and application dependencies
[I]Made some progress in porting a new xp desktop version: the path names need to have quotes around them.[/I]
[B]3.2.6 Slim Released![/B]
[I]INFO: adbClient is somewhat usable in Wine.[/I]
Framaroot and sfk updated.
Tigress busybox updated.
Fixed qfx mounting issue.
android busybox binary updated
updated supersu apk and su, [B]NOTE:[/B] It is ton of work to support 4.3 rooting but I will do it soon in 3.2.8 I will have to bundle cydiaimpactor somehow.
[B]3.2.7 Slim Released![/B]
2.2 removed(cached locally, so it will be unavailable. leaving the remnants of 1.9.5 even though xp is not supported by microsoft anymore)
[B]3.2.8 Released![/B]
GITHUB REPO: [url]https://github.com/lgrootnoob/adbClient_EnvironmentandTool[/url]
updated to usb driver v10
[B]3.2.9 Released![/B]
Bump:
Bump, any dev can use this tool to have their rom users debug the roms that they make easily if they like.
I have done enough testing to know that this works in Wine on Linux pretty good now.
However, special launch instructions are needed.
cd to the adbclient bin folder(Currently bin-3.2.6-Slim) and use the command:
Code:
WINEDEBUG=-all wine cmd /c adbclient.bat
- all on one line.
Adbclient should be started and you can connect to your phone wirelessly with cnt *.*.*.* (Insert ip address to the left).
Happy Linuxing.
EDIT: Bash port coming soon to a Linux computer near you.
Latest use of this tool as a library/environment for making a rooting package for phones.
http://forum.xda-developers.com/showthread.php?t=2738977
The changelog here will now go unmaintained in deprecation for a github repo: https://github.com/lgrootnoob/adbClient_EnvironmentandTool
3.2.9 released.
Lgrootnoob said:
I have done enough testing to know that this works in Wine on Linux pretty good now.
However, special launch instructions are needed.
cd to the adbclient bin folder(Currently bin-3.2.6-Slim) and use the command:
Code:
WINEDEBUG=-all wine cmd /c adbclient.bat
- all on one line.
Adbclient should be started and you can connect to your phone wirelessly with cnt *.*.*.* (Insert ip address to the left).
Happy Linuxing.
EDIT: Bash port coming soon to a Linux computer near you.
Click to expand...
Click to collapse
I don't like bash. :/
pcwizzy37 said:
I don't like bash. :/
Click to expand...
Click to collapse
bash is necessary for using some build systems to compile android source code. If the OP wishes to donate his time and efforts , I'm sure that an easy installer will be useful to someone. I believe that this tool deserves more response than it has received.
Sent from my LGL15G using Tapatalk
ibub said:
bash is necessary for using some build systems to compile android source code. If the OP wishes to donate his time and efforts , I'm sure that an easy installer will be useful to someone. I believe that this tool deserves more response than it has received.
Sent from my LGL15G using Tapatalk
Click to expand...
Click to collapse
I have no idea why I said that back then. I have been dailying Linux for years now and BASH is what I primarily use, also it's wierd because at that time was when I was migrating to Linux.

[TOOL] [Windows] Batch APK Zipalign Tool v 2.0 (23/05/2022)

What's ziplign ?
Read,Android Developers site.https://developer.android.com/studio/command-line/zipalign
zipalign is an archive alignment tool that provides important optimization to Android application (APK) files. The purpose is to ensure that all uncompressed data starts with a particular alignment relative to the start of the file. Specifically, it causes all uncompressed data within the APK, such as images or raw files, to be aligned on 4-byte boundaries. This allows all portions to be accessed directly with mmap() even if they contain binary data with alignment restrictions. The benefit is a reduction in the amount of RAM consumed when running the application.
This tool should always be used to align your APK file before distributing it to end-users. The Android build tools can handle this for you. Android Studio automatically aligns your APK.
Click to expand...
Click to collapse
Why this tool is needed ?
There are a lot of APK modifications on XDA, most of which are done through APKTOOL (Thanks @iBotPeaches for this great tool)
But after apktool compilation, apks needs to be zipalign manually -> which is missing from some these Modded/Distributed Apks found in the forum.
So, I decided to go ahead and make simple tool for this task.
This tool will help end-users/devs in such cases.
How to Use ?
It's One-Click tool, As simple as it gets !
Download & Extract Zip file from attachment.
Put All apks in "Input" folder
Do not leave "SPACES" in file name of APKs For example, Use "AppName_v1.apk" instead of "AppName v171.apk"
Double Click the Batch file (.bat)
You can find zipaliged APKs in "Output" folder after it's done.
That's It !!
PS : (Devs only) Use this tool **AFTER** signing APKs
Users don't need to worry about this because APKs you have/download are already signed.
FAQs
# How to know whether APKs are zipaligned or not after using this tool ?
Check file size of APK Before & After (In Input & Output folders). You will see the differnce in file size on bytes level So, you need to open full property of file via right click.
If file size if exactly the same, means APK was already zipaligned
# How to know whether APKs i have are already zipaligned or not ?
As of now there's no method to my knowledge. So, you need to go through above process.
In general, APKs directly from PlayStore (you backup/apkmirror) are zipaligned so you don't need to zipalign them unless there's some modifications performed on it.
Change log
v1.0 Release 2017
Initial Release
Latest available zipalign binary
v2.0 Release 2022
Based on Android SDK Build-Tools 30.1.0 and should be compatible with latest Android versions (A9-A12+)
Tried this. Nothing in the output folder
Serpentinefire76 said:
Tried this. Nothing in the output folder
Click to expand...
Click to collapse
I'm not actively maintaining this tool due to personal commitments. Theoretically it should still work even with older binaries but if you are looking for specific support I suggest search for other/newer threads.
jineshpatel30 said:
I'm not actively maintaining this tool due to personal commitments. Theoretically it should still work even with older binaries but if you are looking for specific support I suggest search for other/newer threads.
Click to expand...
Click to collapse
I tried it again. It works like a charm. Awesome. Thank you!
Update after a long time.​
v2 is based on Android SDK Build-Tools 30.1.0 and should be compatible with latest Android versions (A9-A12+)
Happy Modding!
i get this error a mod apk
Code:
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed collecting certificates for /data/app/vmdl262490375.tmp/base.apk: Failed to collect certificates from /data/app/vmdl262490375.tmp/base.apk: META-INF/APKEASYT.SF indicates /data/app/vmdl262490375.tmp/base.apk is signed using APK Signature Scheme v2, but no such signature was found. Signature stripped?]
Command file current zipalign.bat:
for %%X in (.\Input\*.apk) do (
echo Zipaligning - %%~nX.apk
.\Tools\zipalign -cv 4 %%X
.\Tools\zipalign -fv 4 %%X .\Output\%%~nX.apk
)
Maybe it should be reversed like this:
for %%X in (.\Input\*.apk) do (
echo Zipaligning - %%~nX.apk
rem To align infile.apk and save it as outfile.apk
.\Tools\zipalign -fv 4 %%X .\Output\%%~nX.apk
rem check alignment outfile.apk only after having zipalign (does not modify file)
.\Tools\zipalign -cv 4 %%X
)

Categories

Resources