Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
View Poll Results: How well does PDroid framework work on ICS ?
fully (100%) 60 37.27%
well 32 19.88%
fine 24 14.91%
barely 14 8.70%
hardly 6 3.73%
not at all (0%) 25 15.53%
Voters: 161. You may not vote on this poll

Post Reply

[PDroid] ICS/JB port of PDroid framework

OP pastime1971

19th March 2012, 08:11 PM   |  #1  
pastime1971's Avatar
OP Senior Member
Flag Pasadena, CA
Thanks Meter: 1,084
 
1,883 posts
Join Date:Joined: Apr 2011
More
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/d...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
Quote:

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)
Quote:

# 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://forum.xda-developers.com/show...&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
Last edited by pastime1971; 15th January 2013 at 05:00 AM.
The Following 73 Users Say Thank You to pastime1971 For This Useful Post: [ View ]
19th March 2012, 08:11 PM   |  #2  
pastime1971's Avatar
OP Senior Member
Flag Pasadena, CA
Thanks Meter: 1,084
 
1,883 posts
Join Date:Joined: Apr 2011
More
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 by pastime1971; 14th September 2012 at 02:17 AM.
The Following 12 Users Say Thank You to pastime1971 For This Useful Post: [ View ]
19th March 2012, 08:12 PM   |  #3  
pastime1971's Avatar
OP Senior Member
Flag Pasadena, CA
Thanks Meter: 1,084
 
1,883 posts
Join Date:Joined: Apr 2011
More
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 by pastime1971; 3rd July 2012 at 02:58 AM.
The Following 16 Users Say Thank You to pastime1971 For This Useful Post: [ View ]
19th March 2012, 08:12 PM   |  #4  
pastime1971's Avatar
OP Senior Member
Flag Pasadena, CA
Thanks Meter: 1,084
 
1,883 posts
Join Date:Joined: Apr 2011
More
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://forum.xda-developers.com/show....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://forum.xda-developers.com/show...8&postcount=37
HOW TO INSTALL TOOLS if you encounter "Missing patch diff tools" error, see http://forum.xda-developers.com/show...&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 by pastime1971; 3rd July 2012 at 02:57 AM.
The Following 28 Users Say Thank You to pastime1971 For This Useful Post: [ View ]
21st March 2012, 08:36 PM   |  #5  
Senior Member
Thanks Meter: 55
 
267 posts
Join Date:Joined: Jun 2008
Hi.

Would the above zip work on CM9 on SGS2 (i9100)?

Thanks.
21st March 2012, 08:41 PM   |  #6  
pastime1971's Avatar
OP Senior Member
Flag Pasadena, CA
Thanks Meter: 1,084
 
1,883 posts
Join Date:Joined: Apr 2011
More
Quote:
Originally Posted by wkwkwk

Hi.

Would the above zip work on CM9 on SGS2 (i9100)?

Thanks.

source patch in post #1 should be able to compile into any CM9.
Last edited by pastime1971; 21st March 2012 at 11:17 PM.
The Following User Says Thank You to pastime1971 For This Useful Post: [ View ]
22nd March 2012, 04:46 PM   |  #7  
ev!denz's Avatar
Senior Member
Flag Frankfurt am Main
Thanks Meter: 12
 
132 posts
Join Date:Joined: Nov 2010
More
I have to compile the code directly on my phone haven't I?
22nd March 2012, 04:52 PM   |  #8  
pastime1971's Avatar
OP Senior Member
Flag Pasadena, CA
Thanks Meter: 1,084
 
1,883 posts
Join Date:Joined: Apr 2011
More
Quote:
Originally Posted by ev!denz

I have to compile the code directly on my phone haven't I?

That is the only way for now.
The Following User Says Thank You to pastime1971 For This Useful Post: [ View ]
22nd March 2012, 09:56 PM   |  #9  
Senior Member
Thanks Meter: 55
 
267 posts
Join Date:Joined: Jun 2008
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.
22nd March 2012, 10:46 PM   |  #10  
pastime1971's Avatar
OP Senior Member
Flag Pasadena, CA
Thanks Meter: 1,084
 
1,883 posts
Join Date:Joined: Apr 2011
More
Quote:
Originally Posted by wkwkwk

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 by pastime1971; 22nd March 2012 at 10:48 PM.

Post Reply Subscribe to Thread

Tags
cm9, ics, p990, pdroid
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes