PPCGeeks Forums HTC Arrive HTC HD2 HTC Thunderbolt HTC Touch Pro 2 HTC Evo 4G HTC Evo 3D Samsung Galaxy S II Motorola Droid X Apple iPhone Blackberry
Go Back   PPCGeeks > Android > Android Motorola Devices > Moto Droid
Register Community Search

Notices


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-08-2010, 01:26 PM
raidzero's Avatar
N00b
Offline
Pocket PC: Moto Droid @ 1.1GHz
Carrier: VZW
Location: PPCG
 
Join Date: Dec 2008
Posts: 2,193
Reputation: 5220
raidzero is a trusted member of the communityraidzero is a trusted member of the communityraidzero is a trusted member of the communityraidzero is a trusted member of the communityraidzero is a trusted member of the communityraidzero is a trusted member of the communityraidzero is a trusted member of the communityraidzero is a trusted member of the communityraidzero is a trusted member of the communityraidzero is a trusted member of the communityraidzero is a trusted member of the community
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Send a message via MSN to raidzero
FROYO Bypass Exchange Server Policy

First - I take no responsibility if your phone is stolen and all your company secrets get stolen. I have edited the Email.apk to not do anything when asked to set a policy. You will need root to use this, and it only works on Froyo. This was made from the Sapphire email apk.

How?

I decompiled the apk with apktool. I then looked onlien and found the source code for the email app. Within that I found the securitypolicy.java file. I opened it up and compared it to the SecurityPolicy.smali file that apktool made for me.

I found the code in smali and simply changed one "True" to "False", or 1 to 0 (line 151 in java, or 523 in smali). I then rebuilt the apk and lo and behold, no security policy.

Note - I only did this because my exchange policy does not work on Froyo, I am fine with having a policy I just wanted email to work at all, and touchdown basically sucked.

Thanks go to cvpcs, sniffle, and rotordroid for the tips.

I LOVE OPEN SOURCE

JAVA excerpt:
Code:
127        boolean policiesFound = false;
128
129   int minPasswordLength = Integer.MIN_VALUE;
130       int passwordMode = Integer.MIN_VALUE;
131        int maxPasswordFails = Integer.MAX_VALUE;
132        int maxScreenLockTime = Integer.MAX_VALUE;
133       boolean requireRemoteWipe = false;
134
135        Cursor c = mContext.getContentResolver().query(Account.CONTENT_URI,
136               ACCOUNT_SECURITY_PROJECTION, WHERE_ACCOUNT_SECURITY_NONZERO, null, null);
137        try {
138           while (c.moveToNext()) {
139                int flags = c.getInt(ACCOUNT_SECURITY_COLUMN_FLAGS);
140                if (flags != 0) {
141                   PolicySet p = new PolicySet(flags);
142                    minPasswordLength = Math.max(p.mMinPasswordLength, minPasswordLength);
143                    passwordMode  = Math.max(p.mPasswordMode, passwordMode);
144                    if (p.mMaxPasswordFails > 0) {
145                        maxPasswordFails = Math.min(p.mMaxPasswordFails, maxPasswordFails);
146                    }
147                    if (p.mMaxScreenLockTime > 0) {
148                        maxScreenLockTime = Math.min(p.mMaxScreenLockTime, maxScreenLockTime);
149                    }
150                    requireRemoteWipe |= p.mRequireRemoteWipe;
151                    policiesFound = true; //*CHANGE TO FALSE IN SMALI
152                }
153            }
SMALI excerpt:
Code:
520    or-int/2addr v5, v0
521
522    .line 151
523    const/4 v13, 0x0 //*WAS 0x1
524
525    goto :goto_0
Again - Froyo only. Not sure about other roms but since sapphire is built from AOSP and not modified it should work for all froyo roms
Attached Files
File Type: zip RZ_Froyo_Email_bypassPolicy.zip (722.2 KB, 38 views) Click for barcode!
__________________
Reply With Quote
This post has been thanked 1 times.
  #2 (permalink)  
Old 07-17-2010, 10:52 PM
seang's Avatar
PPCGeeks Regular
Offline
Pocket PC: Droid
Carrier: Verizon
Location: Central TX
 
Join Date: Aug 2007
Posts: 154
Reputation: 115
seang is keeping up the good workseang is keeping up the good work
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: FROYO Bypass Exchange Server Policy

i just want html email in the stock app. any ideas there?
__________________
Reply With Quote
Reply

  PPCGeeks > Android > Android Motorola Devices > Moto Droid


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 04:14 AM.


Powered by vBulletin® ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0
©2012 - PPCGeeks.com