Educational - FROYO Bypass Exchange Server Policy

Discussion in 'Android Hacks and Help' started by raidzero, Jul 8, 2010.

  1. raidzero
    Offline

    raidzero n00b. Theme Developer Premium Member Developer

    Joined:
    Apr 15, 2010
    Messages:
    1,054
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    Denver, CO
    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. :-D

    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
    
    Last edited: Jul 8, 2010
  2. Stretch2m
    Offline

    Stretch2m New Member

    Joined:
    Feb 28, 2010
    Messages:
    179
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Rochester, NY
    Works like a charm! Thank you!!
  3. ethan.r.besbris
    Offline

    ethan.r.besbris New Member

    Joined:
    Feb 7, 2010
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    will this reset on restart like the other fix?
  4. tahdor
    Offline

    tahdor New Member

    Joined:
    Jul 8, 2010
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    0
    Can I use it for Droid ?
  5. droiddadi
    Offline

    droiddadi New Member

    Joined:
    Apr 24, 2010
    Messages:
    223
    Likes Received:
    0
    Trophy Points:
    0
    Does this bypasses numeric pin lock also?
  6. aminaked
    Offline

    aminaked New Member

    Joined:
    Jan 10, 2010
    Messages:
    2,186
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    California, USA
    Last edited: Aug 16, 2010
  7. The_Hellion
    Offline

    The_Hellion New Member

    Joined:
    Aug 17, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I'm looking for some guidance on this install. My boss is trying to do it on his Motorola Droid, but after he starts the install he gets an error message regarding an invalid signature. Any idea what he's doing wrong?
  8. awakefie
    Offline

    awakefie New Member

    Joined:
    Jan 4, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Stops Working After Reboot

    This was working for me until I rebooted by phone. After the reboot it made me set up the pin again.

    I'm running a Moto Droid with Cyanogen 6 RC3

    Let me know if anyone has any ideas.
  9. Stretch2m
    Offline

    Stretch2m New Member

    Joined:
    Feb 28, 2010
    Messages:
    179
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Rochester, NY
  10. WillRunForBeer
    Offline

    WillRunForBeer New Member

    Joined:
    Nov 12, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Improved email works for me. Is there any down side to use it?

    Also, is there a way to say, only prompt for pin if 30 minutes goes by, or will I always be prompted for pin every time I turn on device.

    What if I unclick Improved Email as a device administrator? Will the application stop working completely?
  11. patmw123
    Offline

    patmw123 New Member

    Joined:
    Dec 20, 2009
    Messages:
    1,663
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    North Carolina
    Why don't you try and speak english, chief?
  12. Shadez
    Offline

    Shadez Super Mod/News Team Staff Member Premium Member

    Joined:
    Jan 27, 2010
    Messages:
    8,448
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Lafayette Hill, Pa
    Let's keep it clean guys! :)
  13. nanutik
    Offline

    nanutik New Member

    Joined:
    Jan 16, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Java files?

    Hello!
    I've unpacked the LotusTraveler.apk and now looking into the files however cannot find the ones mentioned by you. There are also no any .java files, there are mostly smali and xml files.
    Could you please help me to find a correct smali to edit and to remove the screenlock check? Thanks a lot!!!
  14. Hiker5208
    Offline

    Hiker5208 Member

    Joined:
    Mar 29, 2010
    Messages:
    121
    Likes Received:
    0
    Trophy Points:
    16
    There is an app out on the Android and the Amazon market called Enhanced email that is set up to provide this functionality and bypass security. I have an exchange server that my wife and I use and it has worked well with Exchange 2010 with skipping the security stuff. The author works full time at it and does a good job providing support. It does cost 9.99, but does the job well and supports multiple exchange accounts which Touchdown does not do. It is worth a try, they have a 7 day trial at their site, Enhanced Email • Index page .
  15. nanutik
    Offline

    nanutik New Member

    Joined:
    Jan 16, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    The lock is not on an exchange server here but is set in the program itself.... So, I need to modify it somehow in the root of the program
Search tags for this page

android bypass exchange security policy

,
android email client to bypass server policy
,
bypass android server specified security
,
bypass exchange security policy in android
,

bypass exchange server policy

,
bypass froyo pin lock
,

educational - froyo bypass exchange server policy

,
exchange android eas bypass java
,
exchange policy changed message on android phone
,
exchange rbac workaround hack
,
galaxy s4 bypass exchange admin
,
how to bypass exchange security policy in android