[PDroid] ICS/JB port of PDroid framework

How well does PDroid framework work on ICS ?

  • fully (100%)

    Votes: 60 37.7%
  • well

    Votes: 31 19.5%
  • fine

    Votes: 24 15.1%
  • barely

    Votes: 13 8.2%
  • hardly

    Votes: 6 3.8%
  • not at all (0%)

    Votes: 25 15.7%

  • Total voters
    159
Search This thread

pastime1971

Senior Member
Apr 25, 2011
1,893
1,076
Plesanton, CA
For JB 4.2.1, see "OpenPDroid" thread by FFU5y

This is to port PDroid 1.32 source code to ICS and JB (4.1.2) in AOSP, CM, AOKP.

:) PDroid is the privacy protection framework (see svyat's PDroid thread). All the credit goes to svyat. I am just porting his source code to ICS.

:) I am using CM9/CM10 on LGE P990, and that is my platform of "development". All the credit goes to CM team.

Source code patch : http://code.google.com/p/pdroid/
Download : PDroid app on the market, https://play.google.com/store/apps/details?id=com.privacy.pdroid
Download : PDroid app (there is a direct download link at svyat's PDroid thread)

# Jellybean (JB can't find the app from market any more. use the direct link above)
Download : PDroid source code patch v1.32 for JB AOSP 4.1.1, http://www.mediafire.com/?cxe43zko42io4d6 (needs to split framework.jar into two files)
Download : PDroid source code patch v1.32 for CM10 (4.1.1), http://www.mediafire.com/?5ox50wyse49p32s
Download : PDroid source code patch v1.32 for CM10 (4.1.2), http://www.mediafire.com/?48bzsiufn74q7yo

# Icecream sandwich
Download : PDroid source code patch v1.32 for ICS AOSP 4.0.4, http://www.mediafire.com/?sjh8dmwcfbkeix8
Download : PDroid source code patch v1.32 for CM9.0, http://www.mediafire.com/?ikw8qxsvkmiglh2

# Gingerbread
Download : PDroid source code patch v1.32 for CM7.2 , http://www.mediafire.com/?ddfz9b3eihm4i9h

How to compile (simple) : it may potentially break git/repo
cd ~/android
repo sync -j16
patch -p1 < ~/build.diff
patch -p1 < ~/libcore.diff
patch -p1 < ~/frameworks.diff

. build/envsetup.sh
brunch <DEVICE_TARGET>
if your rom doesn't support brunch, then do lunch <DEVICE_TARGET> and then make otapackage
for building modules only you can do make framework core services

How to compile (under git)
# removing previous compile
cd ~/android; rm -rf out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/privacy/ out/host/common/obj/JAVA_LIBRARIES/layoutlib_intermediates/classes/android/privacy/
#[OR] cd ~/android; make clobber
# removing previous patch
cd ~/android/build; git checkout . ; git clean -df
cd ~/android/libcore; git checkout . ; git clean -df
cd ~/android/frameworks/base; git checkout . ; git clean -df
cd ~/android; repo abandon pdroid; repo sync -j16
# applying pdroid patch
cd ~/android/build; git checkout -b pdroid; patch -p2 < ~/build.diff;
cd ~/android/libcore; git checkout -b pdroid; patch -p2 < ~/libcore.diff
cd ~/android/frameworks/base; git checkout -b pdroid; patch -p3 < ~/frameworks.diff
cd ~/android; . build/envsetup.sh; brunch <DEVICE_TARGET>

see http://xdaforums.com/showpost.php?p=31525268&postcount=662 for 65536 method limit in framework.jar

Current status:
it should compile normally. ( @hide added )
logcat shows some errors and exceptions. (possibly due to database api change)
this is a work in progress, and therefore it needs more thorough testing ... your contribution is greatly appreciated.
2012.04.06. updated to 1.32
2012.04.08. @hide added to PhoneStateListener public methods to fix AOSP 4.0.4 compile error
2012.05.07. CM9 patch updated to fix the error due to recent change in ActivityManager

Binary smali patch:
now we have a working smali patcher, see post #4.

Screenshots
picture.php
picture.php
picture.php
 
Last edited:

pastime1971

Senior Member
Apr 25, 2011
1,893
1,076
Plesanton, CA
Development notes

dev note (suggestion/criticism welcomed)

ICS changed framework, substantially in frameworks/base/core/java/android/app/ContextImpl.java, in terms of how service is registered and how to access static outer context.
i added getStaticOuterContext() to address this issue. (any comment on it ?)

JB changed framework again, splitted frameworks/base/services/java/com/android/server/am/BroadcastQueue.java off frameworks/base/services/java/com/android/server/am/ActivityManagerService.java
again, added mContext to store context in BroadcastQueue.java
 
Last edited:

pastime1971

Senior Member
Apr 25, 2011
1,893
1,076
Plesanton, CA
CyanogenMod 9

the purpose of this kang is to test PDroid on ICS, not to provide another ICS rom for LG P990.

PDroid/CM9/P990 (2012.06.26.) : http://www.mediafire.com/?3o736y3qy2v81y8

known issues of PDroid
google map can still find your location by its own network location service.
(v1.32 fixes issues of alarm, yandex map, etc.)

known issues of CM9
web browser crashes upon rotation (flash libs.zip for a dirty hack fix)
no hardware acceleration support
no camcorder support
mobile data issue (mobile data is lost after a while)

change log
2012.03.20. fixed wifi DHCP renewal issue
2012.03.30. updated pdroid source to 1.32
2012.04.02. CM9.0 updated to android 4.0.4

CM9 other devices
the source patch in post #1 should compile for any device and CM9.
confirmed devices : i9100, nook color, crespo4g, p930, P1000/N/L, vibrantmtd(AOKP), fascinate (AOKP), Galaxy Nexus (AOKP)

blind build of CM9 for other devices (untested. i do not own these devices.)
Samsung Maguro : http://www.mediafire.com/?g7klyf5ccu21ptm
LGE P930 CM9 : http://www.mediafire.com/?ow1y71l9axopa57
LGE P999 CM9 : http://www.mediafire.com/?5hxkigwgo354jd4
:) also read mateorod's post for an easy instruction how to use botbrew ! (big thanks to mateorod and inportb, who developed Botbrew)
 
Last edited:

pastime1971

Senior Member
Apr 25, 2011
1,893
1,076
Plesanton, CA
Other ROMs

other ROMs
auto_patcher
this patch has evolved to a more general one with a capability to patch many (pdroid & v6supercharger at the moment) at once. (see http://xdaforums.com/showthread.php?t=1719408)


pdroid_patcher
latest version: alpha v0.5.0 patches 2012.06.16. (md5sum= d7f13959858795562ed8df82d04236a0)
it works on linux for CM9 and AOKP. (other ROMs coming later)
it also supports CM7 (and hopefully other GB ROMs as well)
credit goes to mateorod for patch and script, me for scripting, and svyat for this awesome work on PDroid 1.32

Prerequisite
1. set up linux vm if you don't have a linux machine
2. install the linux packages "jdk" (and "jdk-devel" depending on linux distro) if missing "java" or "jar" (openjdk works as well as sun java jdk)
3. install the linux command "patch" if missing (see below)

HOW TO PATCH: (linux only)
1. download pdroid smali patcher for linux (see above)
2. unzip
3. run it by "./pp/pdroid_patcher YOUR_ROM_ZIP {PATCH}" (optional argument PATCH if you need to specify which patch to use, where PATCH is cm9, aokp, etc.)
4. flash pdroid.zip with CWM to install pdroid patched framework (flash restore.zip if you want to revert back to original)

HOW TO VM see robjective's post http://xdaforums.com/showpost.php?p=27241458&postcount=37
HOW TO INSTALL TOOLS if you encounter "Missing patch diff tools" error, see http://xdaforums.com/showpost.php?p=26388234&postcount=422

Change Log (incomplete)
# 2012.05.00. (v0.1)
# ...........
# 2012.05.12. (v0.2) allows user to specify a different version of patches
# 2012.05.13. (v0.3.0) force "patch -N", remove temp upon failure, generate log output
# 2012.05.13. (v0.3.1) revised the generation of updater-script (SGS2)
# 2012.05.15. added AOSP patches
# 2012.05.15. added crespo-aosp patches, added device-specific patching if patch exists
# 2012.05.15. remove restore.zip upon failure
# 2012.05.15. (v0.4.1) added CM7 (GB) patches
# 2012.05.18. (v0.4.2) added checking for tool commands
# 2012.05.21. (v0.4.3) apply device specific patches only when specified, removed crespo-*.patch
# 2012.05.31. (v0.4.4) CM9 patches updated, crespo-asop-*.patch added
# 2012.06.04. (v0.4.5) added checking tools and rom, added aroma installer support
# 2012.06.15. CM9 patches updated
# 2012.06.16. AOKP patches updated
# 2012.06.17. (v0.5.0) patcher script restructured

edit: please feel free to post a link to your ICS ROM if you get it to work w/ PDroid :)
 
Last edited:

wkwkwk

Senior Member
Jun 28, 2008
359
76
Hi.

I've successfully compiled PDroid into CM9.

One question though. If I afterwards do a 'repo sync -j16', do I have to diff the files again?
I assume I have to if those files get updated but if they don't and I still diff them, the diff will fail and that's that, correct?

Thanks.
 

pastime1971

Senior Member
Apr 25, 2011
1,893
1,076
Plesanton, CA
Hi.

I've successfully compiled PDroid into CM9.

One question though. If I afterwards do a 'repo sync -j16', do I have to diff the files again?
I assume I have to if those files get updated but if they don't and I still diff them, the diff will fail and that's that, correct?

Thanks.

i am no expert of "git", but i guess "repo sync" will always revert all the changes you make.
i do it a hard way (i have a separate folder which is a shadow copy of repo sync'ed one.)
i'd appreciate it if someone can explain a clever way to "git" and "patch".

edit: would you mind telling people which device you compiled it for ?
edit: never mind. i saw your other post saying I9100.
 
Last edited:

wkwkwk

Senior Member
Jun 28, 2008
359
76
I did a repo sync and then tried to apply the patch.
Diff said the files seem already patched so I left all of them alone.
I'm trying to recompile right now, although it's going to take a while. I'll let you know about the outcome.

Thanks for your work.
 

pastime1971

Senior Member
Apr 25, 2011
1,893
1,076
Plesanton, CA
I did a repo sync and then tried to apply the patch.
Diff said the files seem already patched so I left all of them alone.
I'm trying to recompile right now, although it's going to take a while. I'll let you know about the outcome.

Thanks for your work.

oh, i recall that if there was no change in those files in the repo, git will leave those files alone.
when there is a change in any files that patch changed, repo will complain and fail.
what i do then is delete those patched files, and repo sync again. re-apply patch after. (dirty hack, i know...:eek:)

edit: i would appreciate it if someone can post how to deal with git and manual patch elegantly...

edit: i guess one possibility is to treat the manual patch as a commit (git branch ics; git checkout ics; patch ?)
 
Last edited:
G

GuestK00293

Guest
To start a new topic branch in repo, try "repo start pdroid --all". This create pdroid branch in all git repositories in the android repo. To switch back, "repo start ics --all" or whatever branch you were initially on. Make sure to commit your changes into topic branch before switching
 

Keithn

Senior Member
Feb 24, 2011
859
242
Google Pixel 6 Pro
I did what I could as far as patching the cm9 source with the linked files. I'm building on my Fascinate (Samsung galaxy S) and the app seems to be not letting me use it from the market, do I need a different apk or is it just not applied correctly?
 

pastime1971

Senior Member
Apr 25, 2011
1,893
1,076
Plesanton, CA
I did what I could as far as patching the cm9 source with the linked files. I'm building on my Fascinate (Samsung galaxy S) and the app seems to be not letting me use it from the market, do I need a different apk or is it just not applied correctly?

PDroid app is the same one. (As far as I know, svyat doesn't have a different version for ICS.)

Do you mean that you can't download PDroid app from market ? If that is the case, check out svyat's thread post #1. He has a direct link to the app. Could you elaborate your symptom more in detail ? I didn't understand it.
 

tonyp

Inactive Recognized Developer
Feb 3, 2011
5,019
34,902
Hey pastime, I found this thread just right now - you managed to port it to ICS, well done, congratz :)

Won't use ICS untill full hwa is working in CM7 (aka LG releasing their ICS) but it's good to know I can continue to use PDroid then, found myself to really like it's functionality.
 

Keithn

Senior Member
Feb 24, 2011
859
242
Google Pixel 6 Pro
PDroid app is the same one. (As far as I know, svyat doesn't have a different version for ICS.)

Do you mean that you can't download PDroid app from market ? If that is the case, check out svyat's thread post #1. He has a direct link to the app. Could you elaborate your symptom more in detail ? I didn't understand it.


No I could download and install, just when I went to use it it said that it didn't support ICS and closed on me. So the app was not working for me. Sorry for the confusion I re-read that and could barely understand it myself lol
 

pastime1971

Senior Member
Apr 25, 2011
1,893
1,076
Plesanton, CA
No I could download and install, just when I went to use it it said that it didn't support ICS and closed on me. So the app was not working for me. Sorry for the confusion I re-read that and could barely understand it myself lol

the app will say that if cm9 framework is not patched with pdroid framework.
do you see frameworks/base/privacy/ ?
 

mateorod

Inactive Recognized Developer
Nov 16, 2011
1,981
3,503
New Orleans
www.gigmasters.com
Hey, this is great! I am in the middle of a build for my CM9 Nook, but as soon as it finishes i will try this! But it is gonna take some research on my end, I think. I have been building for several weeks but getting a successful build is about the extent of my abilities at the moment. I haven't cherry-picked, or added commits or anything like this. I guess I am about to learn!

Where do I put the downloaded patch in my build directory? Or is this a git branch you have already posted the source code to?

Sorry for so noob! I just need my hand held some, I guess.
 
  • Like
Reactions: giliath

pastime1971

Senior Member
Apr 25, 2011
1,893
1,076
Plesanton, CA
Hey, this is great! I am in the middle of a build for my CM9 Nook, but as soon as it finishes i will try this! But it is gonna take some research on my end, I think. I have been building for several weeks but getting a successful build is about the extent of my abilities at the moment. I haven't cherry-picked, or added commits or anything like this. I guess I am about to learn!

Where do I put the downloaded patch in my build directory? Or is this a git branch you have already posted the source code to?

Sorry for so noob! I just need my hand held some, I guess.

you can put diff files wherever you want.
just reference them when you do "patch -p1 < DIFF"

it is not going to be in git branch. (first of all, i am not the author of code, svyat is. i am a porter)
the author will post his (Froyo, GB) source code to a google site (soon).
 
  • Like
Reactions: mateorod

Top Liked Posts

  • There are no posts matching your filters.
  • 71
    For JB 4.2.1, see "OpenPDroid" thread by FFU5y

    This is to port PDroid 1.32 source code to ICS and JB (4.1.2) in AOSP, CM, AOKP.

    :) PDroid is the privacy protection framework (see svyat's PDroid thread). All the credit goes to svyat. I am just porting his source code to ICS.

    :) I am using CM9/CM10 on LGE P990, and that is my platform of "development". All the credit goes to CM team.

    Source code patch : http://code.google.com/p/pdroid/
    Download : PDroid app on the market, https://play.google.com/store/apps/details?id=com.privacy.pdroid
    Download : PDroid app (there is a direct download link at svyat's PDroid thread)

    # Jellybean (JB can't find the app from market any more. use the direct link above)
    Download : PDroid source code patch v1.32 for JB AOSP 4.1.1, http://www.mediafire.com/?cxe43zko42io4d6 (needs to split framework.jar into two files)
    Download : PDroid source code patch v1.32 for CM10 (4.1.1), http://www.mediafire.com/?5ox50wyse49p32s
    Download : PDroid source code patch v1.32 for CM10 (4.1.2), http://www.mediafire.com/?48bzsiufn74q7yo

    # Icecream sandwich
    Download : PDroid source code patch v1.32 for ICS AOSP 4.0.4, http://www.mediafire.com/?sjh8dmwcfbkeix8
    Download : PDroid source code patch v1.32 for CM9.0, http://www.mediafire.com/?ikw8qxsvkmiglh2

    # Gingerbread
    Download : PDroid source code patch v1.32 for CM7.2 , http://www.mediafire.com/?ddfz9b3eihm4i9h

    How to compile (simple) : it may potentially break git/repo
    cd ~/android
    repo sync -j16
    patch -p1 < ~/build.diff
    patch -p1 < ~/libcore.diff
    patch -p1 < ~/frameworks.diff

    . build/envsetup.sh
    brunch <DEVICE_TARGET>
    if your rom doesn't support brunch, then do lunch <DEVICE_TARGET> and then make otapackage
    for building modules only you can do make framework core services

    How to compile (under git)
    # removing previous compile
    cd ~/android; rm -rf out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/privacy/ out/host/common/obj/JAVA_LIBRARIES/layoutlib_intermediates/classes/android/privacy/
    #[OR] cd ~/android; make clobber
    # removing previous patch
    cd ~/android/build; git checkout . ; git clean -df
    cd ~/android/libcore; git checkout . ; git clean -df
    cd ~/android/frameworks/base; git checkout . ; git clean -df
    cd ~/android; repo abandon pdroid; repo sync -j16
    # applying pdroid patch
    cd ~/android/build; git checkout -b pdroid; patch -p2 < ~/build.diff;
    cd ~/android/libcore; git checkout -b pdroid; patch -p2 < ~/libcore.diff
    cd ~/android/frameworks/base; git checkout -b pdroid; patch -p3 < ~/frameworks.diff
    cd ~/android; . build/envsetup.sh; brunch <DEVICE_TARGET>

    see http://xdaforums.com/showpost.php?p=31525268&postcount=662 for 65536 method limit in framework.jar

    Current status:
    it should compile normally. ( @hide added )
    logcat shows some errors and exceptions. (possibly due to database api change)
    this is a work in progress, and therefore it needs more thorough testing ... your contribution is greatly appreciated.
    2012.04.06. updated to 1.32
    2012.04.08. @hide added to PhoneStateListener public methods to fix AOSP 4.0.4 compile error
    2012.05.07. CM9 patch updated to fix the error due to recent change in ActivityManager

    Binary smali patch:
    now we have a working smali patcher, see post #4.

    Screenshots
    picture.php
    picture.php
    picture.php
    28
    Other ROMs

    other ROMs
    auto_patcher
    this patch has evolved to a more general one with a capability to patch many (pdroid & v6supercharger at the moment) at once. (see http://xdaforums.com/showthread.php?t=1719408)


    pdroid_patcher
    latest version: alpha v0.5.0 patches 2012.06.16. (md5sum= d7f13959858795562ed8df82d04236a0)
    it works on linux for CM9 and AOKP. (other ROMs coming later)
    it also supports CM7 (and hopefully other GB ROMs as well)
    credit goes to mateorod for patch and script, me for scripting, and svyat for this awesome work on PDroid 1.32

    Prerequisite
    1. set up linux vm if you don't have a linux machine
    2. install the linux packages "jdk" (and "jdk-devel" depending on linux distro) if missing "java" or "jar" (openjdk works as well as sun java jdk)
    3. install the linux command "patch" if missing (see below)

    HOW TO PATCH: (linux only)
    1. download pdroid smali patcher for linux (see above)
    2. unzip
    3. run it by "./pp/pdroid_patcher YOUR_ROM_ZIP {PATCH}" (optional argument PATCH if you need to specify which patch to use, where PATCH is cm9, aokp, etc.)
    4. flash pdroid.zip with CWM to install pdroid patched framework (flash restore.zip if you want to revert back to original)

    HOW TO VM see robjective's post http://xdaforums.com/showpost.php?p=27241458&postcount=37
    HOW TO INSTALL TOOLS if you encounter "Missing patch diff tools" error, see http://xdaforums.com/showpost.php?p=26388234&postcount=422

    Change Log (incomplete)
    # 2012.05.00. (v0.1)
    # ...........
    # 2012.05.12. (v0.2) allows user to specify a different version of patches
    # 2012.05.13. (v0.3.0) force "patch -N", remove temp upon failure, generate log output
    # 2012.05.13. (v0.3.1) revised the generation of updater-script (SGS2)
    # 2012.05.15. added AOSP patches
    # 2012.05.15. added crespo-aosp patches, added device-specific patching if patch exists
    # 2012.05.15. remove restore.zip upon failure
    # 2012.05.15. (v0.4.1) added CM7 (GB) patches
    # 2012.05.18. (v0.4.2) added checking for tool commands
    # 2012.05.21. (v0.4.3) apply device specific patches only when specified, removed crespo-*.patch
    # 2012.05.31. (v0.4.4) CM9 patches updated, crespo-asop-*.patch added
    # 2012.06.04. (v0.4.5) added checking tools and rom, added aroma installer support
    # 2012.06.15. CM9 patches updated
    # 2012.06.16. AOKP patches updated
    # 2012.06.17. (v0.5.0) patcher script restructured

    edit: please feel free to post a link to your ICS ROM if you get it to work w/ PDroid :)
    16
    CyanogenMod 9

    the purpose of this kang is to test PDroid on ICS, not to provide another ICS rom for LG P990.

    PDroid/CM9/P990 (2012.06.26.) : http://www.mediafire.com/?3o736y3qy2v81y8

    known issues of PDroid
    google map can still find your location by its own network location service.
    (v1.32 fixes issues of alarm, yandex map, etc.)

    known issues of CM9
    web browser crashes upon rotation (flash libs.zip for a dirty hack fix)
    no hardware acceleration support
    no camcorder support
    mobile data issue (mobile data is lost after a while)

    change log
    2012.03.20. fixed wifi DHCP renewal issue
    2012.03.30. updated pdroid source to 1.32
    2012.04.02. CM9.0 updated to android 4.0.4

    CM9 other devices
    the source patch in post #1 should compile for any device and CM9.
    confirmed devices : i9100, nook color, crespo4g, p930, P1000/N/L, vibrantmtd(AOKP), fascinate (AOKP), Galaxy Nexus (AOKP)

    blind build of CM9 for other devices (untested. i do not own these devices.)
    Samsung Maguro : http://www.mediafire.com/?g7klyf5ccu21ptm
    LGE P930 CM9 : http://www.mediafire.com/?ow1y71l9axopa57
    LGE P999 CM9 : http://www.mediafire.com/?5hxkigwgo354jd4
    :) also read mateorod's post for an easy instruction how to use botbrew ! (big thanks to mateorod and inportb, who developed Botbrew)
    11
    Development notes

    dev note (suggestion/criticism welcomed)

    ICS changed framework, substantially in frameworks/base/core/java/android/app/ContextImpl.java, in terms of how service is registered and how to access static outer context.
    i added getStaticOuterContext() to address this issue. (any comment on it ?)

    JB changed framework again, splitted frameworks/base/services/java/com/android/server/am/BroadcastQueue.java off frameworks/base/services/java/com/android/server/am/ActivityManagerService.java
    again, added mContext to store context in BroadcastQueue.java
    11
    Since I know some people still end up at this thread, and because this thread was such a big part of keeping PDroid alive, I wanted to let people know that I have pushed all the build patches from the OP to the OpenPdroid github page.

    The patches are the same, except they have all been remade to apply in a standard manner. The directions are on each branches README (branches are by Android version and are occasionally split between AOSP and CM/custom) and follow the directions given by pastime1971 on the OP of this thread.

    I also found, rebuilt, and pushed svyat's original PDroid framework commit history, so I think I have pretty much got the whole project preserved under one repo.

    Thanks to everyone who worked with us; the list is long.

    Here is my post on the OpenPDroid thread, with links to our repos.