# [GUIDE](SAMSUNG)How to check if your Android Device has CIQ (NO APP) (with 100% Removal))



## krylon360

*This Guide is just for Samsung Devices for now. More devices to come.*

*CIQ 100% Removed. !!!!!!!*

*EDIT:*

*It seems that some of the CIQ detection apps that have recently been released are giving false results. This was tested by running a CIQ detection app by TrevE on the Samsung Galaxy S 4G by T-Mobile which is running the most recent OTA Gingerbread 2.3.6 T959VUVJK6 and the app reported that it did not find CIQ... The results and images below, beg to differ.........*

*Edit 2:*

*However, Supercurio's CIQ detection app shows that CIQ is present on the 2.3.6 JK6 Stock ROM.*

*







*

*I was able to fully remove CIQ and all code for it, and this is the new result:*

*







*

*CIQ=100% Defeated!*

So, while I was working on a new ROM, I found something that has been a heated discussion this past week. I was able to locate where CIQ is coded into the frameworks.

This should work for ALL Android devices.

FYI, CIQ is not added into any AOSP ROM or CM Based Roms.

You will only find these refs in a Manufactured Stock Rom 2.3.5 or greater (for now, still going back to earlier versions of GB and then Froyo.

*to start, pull the following files from your phone:*
*/system/framework/android.policy.jar*
*/system/framework/framework.jar*
*/system/framework/framework-res.apk*

Tools you will need:
*APKManager*
*Smali*
*BakSmali*
*7zip or winzip*

Windows:
*Notepad++*

Linux:
*Bluefish Editor*

Once you have all files, and the needed programs installed, follow these directions:

take *framework-res.apk*, and place it into the *apkmanager/place-apks-here-for-modding/*
open up *Script.bat*
Choose *Option 22* and then select the number for *framework-res.apk*
Then choose *option 9* to decompile.

Once decompiled navigation to /apkmanager/projects/framework-res.apk/

Open AndroidManifest.xml in either Notepad++ or BlueFish and scroll all the way to the bottom. You should see this:









There is also a file in xbin that needs to be removed. should be called* iqbridged*

when removing the code from the AndroidManifest.xml there is a line that HAS to remain in the code.. if you accidentally remove it, just make sure it's added right above </manifest>
That line will read: *</application>*
or it will fail when recompiling.

This is all of the CIQ references within the framework-res.apk file. Next we will move onto the Jar files.

take the smali and backsmali files you downloaded (you might need to rename them to remove the version number. they should just be called "smali" and "baksmali")
and place them into your sdk/tools dir

Next, open the android.policy.jar file in 7zip or winzip and move the classes.dex into your sdk/tools dir.
Open Terminal or the CMD prompt, and navigate to your sdk/tools dir.
run the following command. To make it easier, you can change the directory name it is extracting to.

*java -jar baksmali.jar -o AndroidPolicy/ classes.dex*

This will extract the smali files.

You will then want to navigate to sdk\tools\AndroidPolicy\com\android\internal\policy\impl

What you are looking for are the following files:
IQHandlerThread.smali
IQHandlerThread$1.smali
IQHandlerThread$2.smali
IQHandlerThread$3.smali

They will look like this:









Next, we are going to extract framework.jar by doing the same thing we did for android.policy.jar and opening the jar in 7zip and moving it to sdk/tols and running this command:

*java -jar baksmali.jar -o Framework/ classes.dex*

Then, you will want to navigate to this dir:

Framework\com\carrieriq\iqagent\service\receivers\
You will see this file:










Now, I haven't fully tested yet, but it's very possible you can remove all of the references I have just showed you. I will test that either tonight, or this weekend.

If you do decide to test by removing the refs, you will need to recompile everything after you have removed it. That....is another post for another time.


----------



## Bl4ckpheniX

Thanks for this! Great guide. Will dig into it when I have some free time .


----------



## krylon360

Updated OP. CIQ defeated 100%


----------



## neotoky

Excuse my noobness, but have some questions regarding your instructions. The apkmanager is by supercurio, right? Version 4.9? There are 4 things to download for the smali and baksmali from code.google.com. Which ones do I download? This should work for all android phones as you stated because I would like to try this on the epic 4g touch. Well these are some of the questions for now until I start trying to remove ciq


----------



## krylon360

No, APKManager is not by Supercurio, but the current version is 4.9.

You will need smali-1.3.0.jar and baksmali-1.3.0.jar (rename to smali.jar and baksmali.jar)

This guide is for Samsung phones.
There is also a file in xbin that needs to be removed. should be called* iqbridged*

when removing the code from the AndroidManifest.xml there is a line that HAS to remain in the code.. if you accidently remove it, just make sure it's added right above </manifest>
That line will read: *</application>*
or it will fail when recompiling.


----------



## neotoky

Where is the xml file located? Is that the result of the apkmanager? Is the file in the xbin as simple as deleting through root explorer? I will make sure not to delete anything that I am not suppose to and follow the directions from the your op. Cool that this is for samsung phones so it should work for the epic 4g touch. I am of course trying to do this on my sgs4g first to see if I succeed lol.


----------



## thomas.raines

I tried this with the android_policy.jar clsses.dex modded and the framework-res.apk modded (already modded the framework-res.jar). I got an FC on google voice and swype, then when I rebooted, I was stuck in a bootloop, but was able to push the original framework-res.apk back onto the phone, rebooted and all was fine. I checked the APK Manager log for any errors and did not see any. I still don't know what I am doing wrong with APK Manager. I made sure not to delete the </application> line this time. If this makes any difference, I am running my modded version of RaverX3X's beautifulsgs4g ROM on drhonk's kj1 voodoo kernel.


----------

