Change ALTERNATE patches from JAR2.patch to JAR.patch2

This is for a reason, we are going to use the FILE*.patch regex in the switch
to smali patches.
Beginning of Autopatcher 3.0 implementation

Not working. Still lots of bugs. patch_matcher function has not been added yet.
The INCREMENTAL needs to be moved out of PATCH_QUEUE (due to use of --dry-run.)

But this does work insofar as it takes the *smali patches and uses them.

Big changes coming, so commit seemed prudent.
Closer

Some bugs ironed...now it fails upon looing for "patch_matcher" which is
written, but not imported or tested yet.
Still not working

And ugly as sin...but this is getting closer. There are some further shakeups
en route.
I think this is the exhaustive function working...

still tons of breakpoint junk and print statement garbage. Bugs still exist.

But this looks close to functional.
This appears to be working.

Lots and LOTS of cleanup to be done. But if you manually try to force AOSP
patches on a CM rom, it will patch successfully, including PROVISONAL use,
although ALTERNATE patches are untested. I also would like to support legacy
*jar patches, among other TODOs.
Change from cp "matched_patches" to adding them to array

This now shows us exactly where each patch comes from, important in debugging.
Revert "Remove CDMA and GSMServiceStateTracker patches"

This reverts commit 66207c170451c8b49ca4ab3deaf3c148c61b8326.
Close to working as expected

But some unsolved boot looping in some situations (running AOSP patches on a
CM rom, for instance. Since this is exactly what we are trying to solve
that is a problem. Experiments are commencing to see if preloaded.classes are
to blame.
Needs some debugging..but I think everything works here

I was able to patch a CM rom even when passing in PA on the command-line.
Needs bunches of cleanup. Bunches doen't do it justice.
Cleanup progress-- clean context_editor
Cleanup again...cleaned up Patch_matcher and some more
Adding unused /common/cm_ContextImpl$45 and aosp_ContextImpl$41 patches

These were created for a different, and now unused, method. But I want to keep
them around in case I need them. The format of their name will stop them from
being picked up by any of our find statements or regex.
Modify 'split_patch_opd.py' to tae command-line arguments

Easy enough...it defaults to OpenPDroid params, but you can list the files
you want to split on the command line, useful if you are just adding patches
to the "reservoir". So:

./split_patch_opd.py
	Looks for all the OpenPDroid patches and splits them if ALL are present
./split_patch_opd.py services telephony-common2
	Just splits those two files

I also added a shebang to make the call more familiar for those new to python.
Add new hidden folder, the ".reservoir"

I agonized over this, I really did. It doesn't quite fit our domain-model.
But I couldn't think of anything easier, considering that we know ApG is in
its final form and must be worked around.

This model may change, but the reservoir is going to take the place of the
ALTERNATE patches which are now deprecated. Basically, I intend to offer support
for any open-source rom. If the Autopatcher fails to patch, then the user just
needs to ask the ROM developer for a link to his manifest and post their log.

Then, I or Urinophoria can build the module (so if services fails to patch, just
build the services with 'make services', takes maybe 15 minutes). The smali
patch we need to add can then be split out using the split_patch_opd.py and
tossed here into the 'reservoir'.

Other options include just adding them under .aosp, so if it is...BubbleVenom
ROM, then .aosp-bubblevenom might be fine. But I intend the reservoir to be
a place to stash needed smali patches that don't fit anywhere else. If you
need/want to add a file to the reservoir, you can simply add a new date. None
of the params inside the reservoir matter (too much). For now, we only have
patches/openpdroid/4.2/.reservoir/pa/20130703, but the 'pa' portion is just
for our information. As long as the patch keeps the name format (auto-generated
by split_patch_opd.py), it can be found by the new model.
Further cleanup, including the rest of the garbage smali files
Cleanup continues...some logging attended to.

Almost to push so the fellas can take a peek.
Cleanup and Logging completed for testing

Error messages and test messages need to be updated, and the traces of
ALTERNATE patch needs to be removed. But seems to work like we would want!
Merge branch 'master' of https://github.com/mateor/auto-patcher into 3.0
Split the latest patches

This is done by running 'ap_scripts/run_split_and_move.sh'. This goes through
all OPD directories and splits all the patches, as well as removes any patches
that we don't need.

The newly installed 'reservoir' directories will need to be split by hand,
the run_split_and_move script only works for directories with all the OpD
JAR.patches ( services, framework, core, Mms.apk, telephony-common)