歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Android 系統強制禁用距離傳感器方法

Android 系統強制禁用距離傳感器方法

日期:2017/3/1 9:41:31   编辑:Linux編程

Android 系統強制禁用距離傳感器方法,下面介紹的前兩中辦法是網絡上流傳的方法,只針對有些機型使用:

方法一

通過修改系統文件實現,這就要求手機要已經root過。首先RE文件管理器(或ES文件管理器)進入根目錄下/system文件夾,找到build.prop文件,將該文件的所有權限都改為可讀和可寫,並用文本編輯器打開,查找文件中是否有以下兩行代碼

# try to disable proximity sensor in call by default
# gsm.proximity.enable=false

如果有,那麼將第二行的“#”刪除,改為

# try to disable proximity sensor in call by default
gsm.proximity.enable=false

如果文件中沒有這兩行代碼,那麼在文件最後手動加入一行,gsm.proximity.enable=false。修改完成後保存文件,並將文件的權限改回原來的狀態(rw- r-- r--)。重啟手機(需關閉“快速啟動”),這時距離感應器已經被強制關閉了

自己的小米1+android 原生 4.1.2,親測不可用。

方法二

OK people thanks to UksusoFF 's help and my own Linux background i was able to have my phone fixed and running. No more screen going offs & phone locks!!
I see that many of you had asked for a step by step process on working with the command line for disabling the proximity censor right?:cool:
Well here it goes folks , the complete step by step:
1 - You have to be ROOT to complete this task so ROOT your phone (There are many links on google on HowTo ROOT your phone so do it!!!)

操作前提:手機必須root !

2- Open the Emulator on your phone.

打開手機上的終端模擬器(如果沒有,去市場搜索下載安裝,或者使用在cmd 終端 使用adb shell ,如果有電腦有配置adb環境的話)

3- Type suand make sure that$ sign changes to # meaning you are the ROOT User now and can make serious changes to your device's system.

輸入 su ,獲取管理員權限,此時應該會看到開頭的 $ 符號變成了 # 號,說明成功獲取超級用戶(即管理員)權限。

4- Insert the following commands in the Emulator

隨後輸入下列指令

# cd /data/local
# touch userinit.sh
# echo "#!/system/bin/sh" > userinit.sh
# echo "#" >> userinit.sh
# echo "chmod 0000 /dev/cm3602" >> userinit.sh
# echo "chmod 000 /dev/cm3602" >> userinit.sh
# chmod 777 userinit.sh

5- Now verify that the file exists

然後輸入下一句指令來檢查userinit.sh文件是否成功創建並且內容輸入是否正確

# cat userinit.sh

(You should see the information inserted above appearing).

再一次對比確認輸入的內容

6- Restart your phone

重啟手機

If you have done it right , your phone should be fine now. Starting now You will be in charge of turning on/off your screen instead of the proximity censor.
Hope it works for ya:rolleyes:
Cheers!:p

此方法在米一測試不可用

方法三

去市場搜索下載安裝 HardWare Disabler,安裝後打開應用,能夠看到自己手機的所有硬件驅動的代號和開關選項,找到 /sys/bus/i2c/drivers/isl29028 目錄下的代號為0-0044的驅動,勾選disable之後就能夠成功禁用距離感應器了。

由於前兩種辦法在這我手機上都not works,只能自己摸索出第三個辦法,還是在不小心關錯了一個重要的驅動差點導致重刷的教訓之後,才最終得以實現。

目前只在自己的米一上嘗試成功了,其他機型未知。

由於不同設備驅動代號不一,自己的所列的代號僅供參考,具體手機具體分析。新手務必慎選,不確定的情況下千萬不能亂點,否則後果自負。

更多Android相關信息見Android 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=11

Copyright © Linux教程網 All Rights Reserved