Post Reply

One Plus One Toolkit v1.2b + ADB/python library - OSX, Linux, and Windows!

Announcement from eudemonics: a toolkit for the oneplus one that can be used on any OS! JUST UPDATED: AUG 24 2014 v1.2b!
18th August 2014, 12:15 PM   |  #1  
eudemonics's Avatar
OP Senior Member
Thanks Meter: 7
 
103 posts
Join Date:Joined: Jan 2007
Donate to Me
More
i present to you the latest STABLE release from vvn's secret underground laboratory.......

THE HALF-ASSED ONE PLUS ONE TOOLKIT v1.2b!

UPDATED!!! LATEST RELEASE: August 24, 2014

screenshot from HALF-ASSED ONE PLUS ONE TOOLKIT

i'm copying and pasting from the thread i have on the oneplus one forum because i am lazy and i already worked hard enough coding the damn thing read on for changes/updates/fixes, or check out the README file which is also the changelog!

LATEST UPDATE RELEASED (cumulative v1.1 and v1.2b update since oneplus decided to release 33R so damn fast)!

TOOLKIT SOURCE CODE/PYTHON SCRIPT:
http://pastebin.com/y511TjV1 -or- http://notworth.it/opo/opotoolkit.py
PYADB LIBRARY SOURCE CODE:
http://pastebin.com/7VSpinAz -or- http://notworth.it/opo/pyadb.py
README FILE:
http://notworth.it/opo/README


download ZIP file containing scripts and adb/fastboot binaries:
http://notworth.it/opo/1plus1-halfas...lkit_v1.2b.zip
SHA1: eb2ddd5eeddd51cbc863100422ffa84bfb568a8e

same ZIP above PLUS a few useful apps:
http://notworth.it/opo/1plus1-halfas...b-withapps.zip
SHA1: 6528af01ce50e544f5b1c143659f0ef357b0895b


################################################## ################

HALF-ASSED ONEPLUS ONE TOOLKIT v1.2b
BY vvn (eudemonics on xda-developers)

release date: AUGUST 24, 2014

screenshot of toolkit initial logo

################################################## ################

PASTED FROM README FILE:

this is a very half-assed project, as you can guess from the name, and i cannot guarantee fast or frequent updates.

REQUIREMENTS FOR SCRIPT TO WORK:
* opotoolkit.py is the main script. that's the one file you REALLY need.
- get it here: http://pastebin.com/y511TjV1 -or- here: http://notworth.it/opo/opotoolkit.py
* my PYADB library needs to be in the same directory as filename "pyadb.py".
- get it here: http://pastebin.com/7VSpinAz -or- here: http://notworth.it/opo/pyadb.py
* obviously, you'll need python 2.7. download python here: https://www.python.org/downloads/
* you need ADB and FASTBOOT from the android SDK. download the SDK here: https://developer.android.com/sdk/
* finally, you need an OS that supports Python and the android SDK, which I'm afraid narrows it down to:
- Linux (all flavors)
- Mac OSX (exotic jungle cats and beyond)
- Windows (pretty much all releases, or starting from whichever one could support Python.)
i apologize for limiting your options like that.

you can either put the scripts and other files in the same directory as your android SDK,
or set an environmental path variable for your android SDK directory.

################################################## ################

USE AT YOUR OWN RISK. i am not responsible for any damage to your device.

i have tested every function except the unlock bootloader and sync functions.
everything works except the uninstall APK function, but i think i just don't quite understand the adb command.

to report bugs, ask questions, offer suggestions, explain the adb uninstall and sync functions(?!), bitch at me, propose marriage, or send anonymous death threats, email me: vvn (at) eudemonics (dot) org

feel free to share, modify, whatever.
some credit would be nice but it's not a big deal if you don't. donations are super nice.
but buying & sharing my EP would be the most awesome way to show your appreciation. really, it would mean the world to me.

you can stream and buy the EP at: http://dreamcorp.bandcamp.com or any major online music retailer (itunes, google play, amazon, spotify, cdbaby, etc.) - just search for "the dream corporation" and album title "last night on earth"
follow on facebook: http://www.facebook.com/dreamcorporation
and of course, more music on soundcloud: http://www.soundcloud.com/dreamcorp

################################################## ################

screenshot from menu. option #8

CHANGES IN v1.2B (released same day as v1.1):

new SuperSU binary - we are now on v2.02! many thanks to chainfire for the development and maintenance of SuperSU. also updated the TWRP image, which is bacon 2.7.1 or 2.7.1.1 i believe.... it's the one that's about 12mb. the 15mb version was the one that was giving me the problems i complain about below.

also added some more flashing options and made the sideload/install from device/fastboot options a bit more flexible instead of always following the same path.

probably not even noticeable to most people, but for some reason TWRP hasn't been behaving all the time, especially with installing the SuperSU binaries for rooting. so instead of TWRP or stock recovery being the only options, i added ClockworkMod and Philz as options to whatever functions (flash and sideload) that use a custom recovery and were previously only able to use TWRP. i've tested rooting with the towelroot method on my samsung galaxy note 3 and it works perfectly, doesn't even trigger the knox 0x1 bit (as long as firmware is NE6 or earlier) and no reboot required. towelroot will not work for the oneplus one though - i tested the latest superSU (2.02) update on the OPO's latest update (33R) and it flashes successfully through Philz Recovery.

developing and running the script primarily on a Macbook Pro OSX 10.8 with Python 2.7.x, though sometimes i work on it in a Linux Debian environment. i have no clue how this script will run in Python 3, i could try it and find out, but i just don't care.

also new - check out the sweet ASCII art i added (even in oneplus' signature colors)! since it's the first thing you see when you run the script, you probably can't miss it. added because, obviously, it's an absolute REQUIREMENT that every terminal application (at least, the ones that matter) include some uber leet ASCII. like, the functionality doesn't even matter. handling exceptions doesn't matter (i don't do much of that here, by the way). all that matters is whether or not you have ASCII art, and how uberleet it is. otherwise, nobody will give a **** about you or your app. (at least, that's what i was told. mommy????)

in a future release there will be more functionality for other phones. i plan to add a script for deodexing, and maybe if i am not too tired i'll create a stock ROM with root already injected into it.

my github repository is still being a jerk and won't let me commit anything. sorry. keep checking my pastebin until then to get the latest updates:

http://pastebin.com/u/eudemonics

there might be some errors. i don't know. i thought i fixed the ones i came across. i really need sleep.

################################################## ################

CHANGES IN v1.1:

- most files in script can be downloaded directly from script by demand to proper location, making it an easier install and a more seamless user experience
- added support and files for latest updates: XNPH33R released 8/22/2014, and XNPH30O updates #1 and #2
- can now flash entire factory stock ROMs - full XNPH30O and XNPH25R stock images - or flash your own custom ROM
- updated PYADB library to return STDOUT response instead of just a '0' success or error if not 0.
- reboot functions should behave a bit more sanely now that the piped STDOUT response can be used as qualifiers
- added more details and instructions in certain procedures, especially those having to do with booting into recovery.
- several root options available now: superSU is recommended for OnePlus One. TowelRoot is recommended for Android firmware releases earlier than June 2014. I also included a "superuser" zip file which is also supposed to be for rooting, but unless you are well acquainted with what it does, which devices it supports, and what to do with it, I would advise you not to try flashing it.
- i shuffled a lot of items around, it's very likely that there may be some syntax errors floating around. Please report any errors you come across to me at vvn (at) eudemonics (dot) org. thanks!!

~*~

NOTES FROM RELEASE v1.0:

MORE UNIVERSAL FEATURES TO SUPPORT ALL ANDROID DEVICES!

added a bunch of features to the pyadb python library, as well as including them in the toolkit. if there are any features you'd like to see in the toolkit, whether for the oneplus one or for android devices in general, please let me know and if it's possible, i'll add it! wiping and flashing options work now - you can choose the specific partitions you want to wipe, or flash everything back at once. i have also added the towelroot option, which should work on quite a few android devices as long as they are running firmware released before june 2014. also included a few APK's in the package that aren't available from the google play store, so you can install 'em if you want. tested most functions on my macbook pro (running OSX mountain lion) and they all seem to be working, except the uninstall APK function, but it's not a problem with the code, it's my failure to grasp what the <package> parameters should be. also, the latest OTA updates (30O) aren't installing from the fastboot update method, so i've added other options to install them such as ADB sideload and through custom recovery. i haven't tested the sync, wipe, restore, or unlock bootloader functions yet. they should all be working though, except maybe the sync (as i don't completely understand the ADB command myself. i just know the sync command alone without any args syncs your device's /system and /data directories).

one thing that may or may not work sometimes is running the reboot function from the toolkit while you're in recovery mode. i'm not sure if it's even possible to send a command from the computer to make it reboot while in recovery mode, though it shows up under "adb devices" as device type "recovery". i've added to the dialogue of the script directions to carry out certain functions from the device, such as rebooting from recovery back into android. also, the latest OTA updates (30O) *might* not install from the fastboot update method, so i've added both the ADB sideload method as well as installing updates from a custom recovery.

USE AT YOUR OWN RISK. i'm not responsible for anything that might happen to your device as a result of using the toolkit. if you use the correct files in the package and follow the toolkit directions onscreen, your device should be just fine. i assume if you have the technical know-how to install python, the android SDK, and run the script, then you've got a pretty good idea of what you're doing already. if you need help, send me a message. the best way to reach me, to get the quickest response, is probably on facebook, as i do not log onto xda-developers or my email accounts regularly:
http://www.facebook.com/dreamcorporation

requirements: python 2.7, android SDK, opotoolkit.py, pyadb.py

you can either supply the files referenced in the script, or download them from my site. links are in the opotoolkit.py source code pastebin link.

opotoolkit.py source code: http://pastebin.com/ciAj8NJy | download: http://notworth.it/opo/opotoolkit.py
pyadb.py source code: http://pastebin.com/g2Z08JN1 | download: http://notworth.it/opo/pyadb.py

for your convenience, i put together a ZIP file with most of the files you need - scripts, superSU, recovery images, apps, adb/fastboot binaries, etc. all that's missing are the stock images referenced in option #8.
download package here: http://notworth.it/opo/android-1plus...toolkit_v1.zip

there are also a couple large ZIP files available if you want to use the flash stock images functions in option #8 - links are in the source code for opotoolkit.py. or you can just download the XNPH25R stock firmware file from the official cyanogenmod page and unzip the contents into a subdirectory called "XNPH25R" of the script location, and the OTA updates for XNPH30R can be placed into another subdirectory of the script location called "XNPH30O". i will eventually add the functionality to download all the files directly from the toolkit itself, to make it easier for you guys so you don't have to scramble all over the place downloading and collecting files.

any APK's you'd like to install from the toolkit to the phone should go into the /apps subdirectory (already included in the ZIP package file along with a few apps). i have created the github repository for the project, but github is still refusing to acknowledge its existence on the web. once i get it sorted out i'll add a git link. keep checking this space as well as the pastebin links for any updates!


################################################## ################

installation:

download and install python 2.7: https://www.python.org/downloads/
download and install android SDK: https://developer.android.com/sdk/
download toolkit package: http://notworth.it/opo/android-1plus...toolkit_v1.zip
-or-
download the python scripts/copy + paste source code from pastebin links into a text editor:
opotoolkit.py source - http://pastebin.com/ciAj8NJy | download: http://notworth.it/opo/opotoolkit.py
pyadb.py source - http://pastebin.com/g2Z08JN1 | download: http://notworth.it/opo/pyadb.py

extract files from the ZIP package or save the *.py scripts to a new directory, "opotoolkit" or whatever you want to name it.

it should work with the adb and fastboot binaries provided in the ZIP, but if not, you should install the android SDK. i recommend even MORE that you create an environmental path variable to the android SDK so you can run the commands from any directory.

setting up an environmental path variable (optional - recommended):

if you're on windows you can go to my pastebin, find the only powershell script on there, and steal/adapt the code to create your own environment path variable. but it's much easier to configure in system properties - i'm not on windows right now so these may not be exact instructions, but you should be able to right click on "my computer", select "properties", go to the "environment" tab in system settings, and add the environment path there. linux and OSX users just need to add the android SDK directory to their ~/.bash_profile or ~/.bashsrc or wherever environment paths are defined. if you still don't understand environmental path variables or symbolic links, i highly recommend google (or startpage.com, the private version).

if you don't want to go to the trouble of creating the environmental path variables, and you want to use the android SDK on your computer, then just extract all the files from the ZIP into your android SDK directory.

################################################## ################

how to run the toolkit:

plug phone to computer via USB, turn on android debugging.

open command prompt or terminal window to scripts directory. start toolkit by entering:
"python opotoolkit.py"

if everything is installed and in the right places, you should see a menu like the attached screenshot. if for some reason you get a permission denied error, try launching the command prompt or terminal as administrator or superuser.

i'll continue working on it and adding more when i can so keep checking this space. everything's open source; use, share, steal whatever you want from the code. some credit would be nice, though.

you can use the pyadb.py library to incorporate adb/fastboot commands into your own python projects. i'll be adding more features to that, but for now most of the common features are covered.

here's the github link - it still won't acknowledge my repository exists, and if i try to create it again locally it gives me a fatal error. so it's not letting me add or commit any files, since it says the repository doesn't exist - though trying to create the repository gives me the warning that it already exists. [?!@#$@#] let's just say github and i are not exactly BFF's.

project github home whenever it decides to start working: https://github.com/eudemonics/1plus1toolkit

i've been working to expand this so it can be used with all android devices, though it'll require people to supply their own device files to use with it! just because the toolkit can flash device firmware DOES NOT MEAN that the included files meant for the oneplus one will work on a NON oneplus one device! hopefully that's not something i needed to emphasize. if there is enough positive feedback and support i'll create a GUI since people like to click things more than type into a terminal window

my half-assed oneplus one toolkit was featured on cyberwarzone!
http://cyberwarzone.com/android-toolkit-python-2-7/

not gonna bug you for donations - all my code is open source - if you'd like to donate, please do so by purchasing my EP. hey, you might even like the music, too:
buy it here: http://dreamcorp.bandcamp.com
or search for it on itunes, google play, amazon, spotify, last.fm, cdbaby, and so on.

there are also links in the description for my video:
https://www.youtube.com/watch?v=2i-F4jiKtGg

################################################## ################

special thanks to chainfire for superSU, cyanogenmod for CM11S, geohot for the towelroot exploit, oneplus for manufacturing such an excellent and affordable product, and everyone here on xda-developers for growing and developing the android community into the vital and creative force it is today!

XDA:DevDB Information
Half-Assed One Plus One Toolkit v1 in Python/ADB-python library - ALL OS' SUPPORTED!, Tool/Utility for the ONEPLUS ONE

Contributors
eudemonics

Version Information
Status: Stable
Current Stable Version: 1.2b STABLE
Stable Release Date: 2014-08-24
Current Beta Version: 1.2.3 BETA BLOCKERS
Beta Release Date: 2014-08-22

Created 2014-08-18
Last Updated 2014-08-25
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in ONE General by ThreadRank