1. Welcome to NoFap! We have disabled new forum accounts from being registered for the time being. In the meantime, you can join our weekly accountability groups.
    Dismiss Notice

ADB

Discussion in 'Off-topic Discussion' started by sinner76, Mar 20, 2021.

  1. sinner76

    sinner76 Fapstronaut

    780
    1,001
    93
    Entering ADB commands

    There are a few ways to run adb commands on your phone, the simplest one is using ADB shell app which works only if you're on Android 11+. If you're using android 10 or below, you'll have to use USB debugging. You can also use USB debugging on android 11+ if you're having trouble with wireless debugging.

    A)USB debugging using a PC/Mac:
    On your phone:
    1-Enable Developer mode and enable USB debugging: https://www.howtogeek.com/129728/how-to-access-the-developer-options-menu-and-enable-usb-debugging-on-android-4.2/
    2-Enable: "Disable permission monitoring". This is usually the last option in Developer mode. It's not present in some phones especially the the very old ones:https://pasteboard.co/JF6u4Pn.png

    On Xiaomi phones, also activate USB Debugging (Security Mode) and installations via usb. (not sure if those options are present on other phones)

    3-Change the USB option to Media Device/MTP. You could do that after connecting your phone to your PC by a USB cable as you usually get a notification to choose the USB option. You could also swipe down the status bar of your phone to set the USB options after you plug in the phone. If you still can't find it, typing "usb" in the search bar in your settings app could help.

    On your PC:
    1- Download the latest version of ADB ZIP file:
    Windows (13 MB): https://dl.google.com/android/repository/platform-tools-latest-windows.zip
    MacOS:https://dl.google.com/android/repository/platform-tools-latest-darwin.zip
    Linux:https://dl.google.com/android/repository/platform-tools-latest-linux.zip
    (There are versions of ADB for macOS or linux:
    https://www.xda-developers.com/install-adb-windows-macos-linux
    On macOS & Linux, all commands starting with adb have to be preceded with ./
    Example:
    macOS and Linux:
    Code:
    ./adb devices
    while on windows cmd:
    Code:
    adb devices
    2-Extract that zip file directly into your C: drive, so that you get a folder named platform-tools in your C: drive.
    3-From windows start menu open cmd
    4-Use the following code in cmd to change the directory to the platform-tools folder(the one in your C: drive):
    Code:
    cd C:\platform-tools
    5-Use this code to check that adb recognizes your device connected by the USB cable:
    Code:
    adb devices
    [​IMG]

    ADB is now connected and ready for action.

    UPDATE: you can use this web app to enter adb commands directly form your browser to your phone, still needs usb debugging enabled: https://app.webadb.com/shell


    B)Wireless debugging using another android phone/PC (Android 11+):

    You could install the ADB Shell app mentioned above on another android phone and connect your main phone and the other phone to the same wifi network. Now pair and connect your main phone to the ADB shell app on the other phone using the same steps.

    Debugging using a PC on the same WiFi network:
    (The following guide uses powershell instead of cmd, so all commands starting with adb will be preceded with ./ )
    https://www.unlockbase.com/blog/enable-wireless-adb-in-samsungs-one-ui-3-0/

    D)Local adb using ADB shell app + wireless debugging(Android 11+) Produces errors on Android 13:

    1-Install ADB Shell app on your phone.
    https://play.google.com/store/apps/details?id=com.github.standardadb&hl=en

    2-Activate developer options on your phone by searching for Build Number in your settings app, then tab Build Number 7 times.

    Pair and connect (video):


    Pair and connect (Text version):
    Open developer options from settings>Enable Wireless debugging, then click on Wireless debugging. Click on pair device with pairing code. You will get and IP and a port, in addition to a pairing code.
    Example:
    Pairing code:
    228448
    IP and port:
    192.168.1.9:726354

    (Note that if you click cancel or click home button, the pairing code and port will be changed. So open recent apps(the button beside home in your phone) then hold the settings app and open it in popup view.)
    If your phone doesn't support popup view, then you could either:
    -Install ADB shell app on another android phone and connect your main phone and the other phone to the same wifi. This way you could enter commands from the other phone to your main phone.
    -Use USB debugging (discussed later).

    3-Open the ADB Shell app, click on local shell and enter this (change the IP & port to the ones you got from your phone):
    adb pair 192.168.1.9:726354

    It will ask you for the pairing code, just enter it.
    The device should now be paired. Now click on cancel in the popup in wireless debugging.

    4-The next step after pairing is connecting. Go back to wireless debugging, you'll see Device name and under it, you'll find IP address and port, note that they are different than the ones that you used for pairing.
    Example:
    Device name:
    Galaxy S20
    IP address & port:
    192.168.1.9:99322

    -Go back to local shell and enter this (change the IP and port to yours):
    adb connect 192.168.1.9:99322

    -Now you're ready to enter the adb commands that you want. As long as @localhostis present in the list of paired devices on your phone (you could check it under wireless debugging), you could just start from the adb connect step next time you want to enter commands.
     
    Last edited: May 3, 2023
  2. sinner76

    sinner76 Fapstronaut

    780
    1,001
    93
    reserved
     
    Last edited: Aug 7, 2022
  3. Abzu

    Abzu Fapstronaut

    64
    1,067
    113
    i am confused, what does this even do?
     
    xXsinnerXx likes this.
  4. sinner76

    sinner76 Fapstronaut

    780
    1,001
    93
  5. Abzu

    Abzu Fapstronaut

    64
    1,067
    113
    well afaik it can be done without adb or pc, my brother sent me a trick couple of weeks back how to do it, i didn't open the link but he has applied that on his phone
     
    xXsinnerXx likes this.
  6. sinner76

    sinner76 Fapstronaut

    780
    1,001
    93
    It would be great, if you could share it! This would be extremely helpful!
     
  7. Abzu

    Abzu Fapstronaut

    64
    1,067
    113
    i am sorry man, i was hugely mistaken, it requires adb and all the computer stuff you mentioned.
     
    xXsinnerXx likes this.
  8. sinner76

    sinner76 Fapstronaut

    780
    1,001
    93
    No problem!
     
  9. ThisIsHard97

    ThisIsHard97 Fapstronaut

    101
    205
    43
    Hi, I have a Redmi Note 9 Pro and I can't find an option called "Disable permission monitoring". The closest thing I've read is Logging Level, which is off (other options are debug or verbose), but I guess it's another thing. Can you help me on this? Thanks in advance.
     
  10. sinner76

    sinner76 Fapstronaut

    780
    1,001
    93
    Try skipping this step. This option is not present on al phones.
     
    ThisIsHard97 likes this.
  11. The arabian man

    The arabian man Fapstronaut

    10
    8
    3
    how can i remove Device Owner???
     
    sinner76 likes this.
  12. sinner76

    sinner76 Fapstronaut

    780
    1,001
    93
    form test DPC app itself
     
  13. The arabian man

    The arabian man Fapstronaut

    10
    8
    3
    Screenshot_20220228-090208_One UI Home.jpg



    how can I disallow "split screen" by using this app....
     
  14. the300clean

    the300clean Fapstronaut

    113
    116
    43
    I tried to do it today by connecting the phone to the PC , and running the command "adb devices" and I got this:

    'adb' is not recognized as an internal or external command,
    operable program or batch file.


    than I checked and noticed that the folder "platform-tools" had another folder inside: "platform-tools". so the files were 1 layer too deep and the computer didn't found them.

    It might be useful to give a warning about this in the guide.
     
  15. 10HansTI

    10HansTI New Fapstronaut
    NoFap Defender

    2
    3
    3
    I finally found an effective way to lockdown my Android Phone with a modified version of Test DPC (which asks to set the password before opening the app)

    For users like myself who always look for sneaky ways around VPNs and can turn off the device admin apps like Truple Porn Filter / Blocker or App Lockers (disable draw over apps);
    this is the most bulletproof Android option I have found.


    I got this Test DPC file from someone online who was working on a fork from Github (not sure if he's part of the NoFap Community but his name is Michael)
    https://github.com/googlesamples/android-testdpc/issues/131
    https://github.com/routerdieb - github user profile

    Pre-requisites
    - Need a Cleanbrowsing Pro 50 subscription
    - Android Phone with Android 11 or higher software
    - Allow android phone to install unknown apps
    - Android ADB / usb debugging enabled
    - A backup usb to secure the Test DPC password


    1 - Install The Custom Test DPC Apk File (which has password lock enabled)

    I have uploaded this Test DPC file to my google drive, if you have any issues downloading / installing please PM me
    https://drive.google.com/file/d/1YP0bwrHglYz2gpIRzYoriAqm73ZJezXY/view?usp=share_link

    2 - Setup Test DPC as Device Owner (using adb)

    plug your phone into you PC / Mac and configure a new profile for Test DPC
    dpm set-device-owner com.afwsamples.testdpc/.DeviceAdminReceiver

    make sure you have removed all other accounts from your android phone


    3 - Open The Test DPC App (should be called Applock DPC) + Copy Password

    remember to copy / paste the password and put it somewhere (it gives you a random password, so remember this code!)
    disable uninstall apps in Test DPC
    disable configure dns option

    4 - Copy Your Custom DNS From The Cleanbrowsing Portal

    Under network settings you should see something like this
    DNS over TLS (DoT): customd4bcaaa123.dot.cleanbrowsing.org

    copy and paste the dns url into your private dns setting
    set the DNS config in Test DPC


    Your phone should now be unable to use any VPNs, Porn, Adult sites etc that Cleanbrowsing blocks
    You will be unable to disable your Android DNS settings either because its locked :)


    Hope this guide helps some Android users, I know its definitely helped me out


    cc: sinner76.354636
     
    Last edited: Nov 4, 2022
  16. Killyourlust

    Killyourlust Fapstronaut

    66
    93
    18
    Does this work even after we factory reset the phone ?
     
  17. 10HansTI

    10HansTI New Fapstronaut
    NoFap Defender

    2
    3
    3
    I haven't tried factory resetting the phone, but if you do that everything on your Android Phone gets uninstalled / removed.

    Never gone that far (yet) but yeah if users do factory reset all applications will be removed.

    There is an option in Test DPC to prevent factory reset, once the password has been set + you've locked the permissions the system settings will be un-editable without the password.
     

Share This Page