Adding a security exception to an app: הבדלים בין גרסאות בדף

מתוך ויקי נטפרי
קפיצה לניווט קפיצה לחיפוש
שלו' (שיחה | תרומות)
אין תקציר עריכה
DovidStroh (שיחה | תרומות)
אין תקציר עריכה
 
(2 גרסאות ביניים של 2 משתמשים אינן מוצגות)
שורה 1: שורה 1:
{{En|הוספת חריגת אבטחה לאפליקציה}}
{{He|הוספת חריגת אבטחה לאפליקציה}}
{{Navigation|Security certificate|Installation of certificate in Android}}
{{Navigation|Security certificate|Installation of certificate in Android}}


From Android 7 onwards, by default apps do not trust the security certificates that the user adds but only the system certificates so most apps will not work even after installing the certificate as the instructions provided [[Installation of certificate in Android|here]].
From Android 7 onwards, by default apps do not trust security certificates added by the user, only the system certificates. Therefore some apps will not work even after installing the certificate according to the instructions [[Installation of certificate in Android|here]].


But sometimes using the following steps you can edit the app file and configure in to support the security certificate that the user has installed. Note that there are many apps that adding the exception according to the instructions below will not work or will not be possible (like Google apps).
However, there are several ways to edit the app file and set in its configuration files that it should trust the security certificate the user installed. Note that for many apps, adding the exception according to the instructions below will not help or will not be possible, so several options are given, so that if one option does not help, another one might. '''Note that there are apps that cannot be edited with any of the options below (such as Google apps).'''


In this tutorial we will learn how to do this, the tutorial consists of two main steps, the first step is only relevant for those who do not have access to the Linux system, those who have access to the Linux system can go directly to the second part (script run):


'''The tutorial is based on screenshots, the numbers shown in parentheses mark the step in the screenshots'.'''
==Adding a security exception with the '[https://github.com/shroudedcode/apk-mitm apk-mitm]' script (recommended)==


===Installation of the Windows Linux subsystem for Windows 10===
Can be run on Linux/Windows/MacOS.
This step will allow us to run bash commands in windows, (Windows subsystem for Linux is only available in 64-bit versions of windows 10 version 1607 or higher).


First we need to enable this option, we will open PowerShell as an administrator<small>'''(2) (3)'''</small>, And run the following command there<small>'''(4)'''</small>:
First install Node.js from here: https://nodejs.org/en/download ([https://nodejs.org/dist/v20.17.0/node-v20.17.0-x64.msi direct download of the Windows installer])
 
And Java from here: https://www.oracle.com/technetwork/java/javase/downloads/index.html ([https://download.oracle.com/java/22/latest/jdk-22_windows-x64_bin.msi direct download of the Windows installer])
 
Then run in CMD or PowerShell on Windows, or in the terminal on Mac (replace with the full path to the apk file):
 
npx apk-mitm /path/to/yourapp.apk
 
You can easily add the file path by dragging the file into the CMD window, that is: type <code>npx apk-mitm</code>, a space, drag the apk file into the window, and press Enter.
 
The script decompiles, edits, and signs the app again.
 
=== Embedding the certificate in the app file ===
The script can also embed the NetFree certificate inside the app file itself, so the app can be used even on Android systems where a security certificate cannot be installed even at the user level (for example some car multimedia systems): https://github.com/shroudedcode/apk-mitm#allowing-specific-certificates
 
==Adding a security exception with the 'AddSecurityExceptionAndroid' script==
 
Can be run on Linux (or on Windows by installing the WSL environment, which emulates Linux).
 
In this guide we will learn how to do it. The guide consists of two main steps. The first step is adding a Linux system to Windows, and it is relevant only to those who do not have access to a Linux system. Those who have access to a Linux system can go directly to the second part (running the script):
 
'''The guide is based on screenshots; the numbers in parentheses mark the step shown in the screenshots in the 'Guide with pictures'.'''
 
===Installing the Windows Subsystem for Linux on Windows 10===
This step will let us run bash commands on Windows (the Windows Subsystem for Linux is only available on 64-bit versions of Windows 10, version 1607 and above).
 
First we need to enable the feature. Open PowerShell as administrator <small>'''(2) (3)'''</small>, and run the following command there <small>'''(4)'''</small>:


<code>Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux</code>
<code>Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux</code>


After the operation <small>'''(5)'''</small> is complete, a message appears asking you to confirm a computer restart by pressing Y and Enter <small>'''(6)'''</small>.
When the operation <small>'''(5)'''</small> finishes, a message will ask us to confirm restarting the computer by typing Y and Enter <small>'''(6)'''</small>. Confirm.


Now, download [https://aka.ms/wsl-ubuntu-1804 this file] and install it <small> '''(7) (8)''' </small>, run the app, wait for the installation to complete <small> '''(9)''' </small>, first set username <small> '''(10)''' </small> and password <small> ''' (11) '''</small>, and again <small>' '(11)' '' </small> verificat password.
Now download [https://aka.ms/wsl-ubuntu-1804 this file] and install it <small>'''(7) (8)'''</small>. Run the app, wait until the installation completes <small>'''(9)'''</small>, first set a username <small>'''(10)'''</small> and password <small>'''(11)'''</small>, and enter the password once more to confirm <small>'''(11)'''</small>.


<small>'''(12)'''</small> Run the command <code>sudo apt-get update</code>,
<small>'''(12)'''</small> Run the command <code>sudo apt-get update</code>,


Wait until the action is ends <small>'''(13)'''</small> then run the command <small>'''(14)'''</small>
Wait until the operation finishes <small>'''(13)'''</small> and then run the command <small>'''(14)'''</small>


<code>sudo apt install default-jdk</code>
<code>sudo apt install default-jdk</code>


<small>'''(15)'''</small> Approve by typing Y,
<small>'''(15)'''</small> Confirm by typing Y,


Wait until the action is ends <small>'''(16)'''</small>,
Wait until the operation finishes <small>'''(16)'''</small>,


That is, we have now installed the Linux running environment on the computer. You can close the terminal.
That's it, we have now installed the Linux runtime environment on the computer. You can close the terminal.


===Running script===
===Running the script===
Now download this file [https://codeload.github.com/levyitay/AddSecurityExceptionAndroid/zip/master (zip file)], extract it to the folder, put in the same folder the apk file that we want to handle.
Now download this file [https://codeload.github.com/levyitay/AddSecurityExceptionAndroid/zip/master (zip file)], extract it to a folder, and put the apk file you want to handle in that same folder.


In the address bar of the folder (where the path register) write wsl and press enter <small> '''(17)''' </small>, a Linux terminal will open in the location of the folder <small> '''(18)'''< / small>,
In the folder's address bar (where the path is written) type wsl and press Enter <small>'''(17)'''</small>. A Linux terminal will open at the folder's location <small>'''(18)'''</small>,


<small>'''(18)'''</small> There run the command:
<small>'''(18)'''</small> There, run the command:


<code>&lrm;./addSecurityExceptions.sh app-name.apk</code>
<code>&lrm;./addSecurityExceptions.sh app-name.apk</code>


Insted of 'app-name.apk' write the name of the app
Instead of app-name.apk, write the name of the app.


<small>'''(19)'''</small> In the initial session we will need to update details, we can write down our name or any other word and finish typing yes.
<small>'''(19)'''</small> On the first run we will need to fill in details. We can write our name or any other word, and finally type yes.


That's it. <small>'''(20)'''</small>
That's it. <small>'''(20)'''</small>


Now you will see that in the script folder a file was added<small>'''(21)'''</small>.
Now you will see that a file was added in the script folder <small>'''(21)'''</small>.


Good luck!




שורה 62: שורה 87:




Photos tutorial:
Guide with pictures:


[[קובץ:שלב א - הוספת חריגה.jpg|לא ממוסגר|800x800 פיקסלים]]
[[קובץ:שלב א - הוספת חריגה.jpg|לא ממוסגר|800x800 פיקסלים]]
שורה 80: שורה 105:
[[קובץ:שלב טו - הוספת חריגה.jpg|לא ממוסגר|800x800 פיקסלים]]
[[קובץ:שלב טו - הוספת חריגה.jpg|לא ממוסגר|800x800 פיקסלים]]
[[קובץ:שלב טז - הוספת חריגה.jpg|לא ממוסגר|800x800 פיקסלים]]
[[קובץ:שלב טז - הוספת חריגה.jpg|לא ממוסגר|800x800 פיקסלים]]
==Adding a security exception manually==
Instructions can be found at the following link:
https://mitmachim.top/post/849673
==Lowering the SDK version with the APKTool app==
{{תיבת מידע|Can be run on Android (or with an Android emulator on Windows)}}
Download the [https://apkcombo.com/apktool-m/ru.maximoff.apktool/download/apk APKTool] app, open the option to edit an apk file, and in the target sdk line change it so that Android 6 or lower appears. Then sign the app (a "sign" option appears), and the new apk is created. Tap the file and choose install. If the app is already installed, uninstall the installed app first, and only then install the new app (the words mod-sign should be added to the original file name). [https://forum.netfree.link/post/111583 For more details see here.]

גרסה אחרונה מ־21:45, 24 בנובמבר 2026

לעברית לחצו כאן

To switch from edit view to read view

To search in the Wiki

Home page > Security certificate > Installation of certificate in Android > Adding a security exception to an app ‎‎


From Android 7 onwards, by default apps do not trust security certificates added by the user, only the system certificates. Therefore some apps will not work even after installing the certificate according to the instructions here.

However, there are several ways to edit the app file and set in its configuration files that it should trust the security certificate the user installed. Note that for many apps, adding the exception according to the instructions below will not help or will not be possible, so several options are given, so that if one option does not help, another one might. Note that there are apps that cannot be edited with any of the options below (such as Google apps).


Adding a security exception with the 'apk-mitm' script (recommended)

Can be run on Linux/Windows/MacOS.

First install Node.js from here: https://nodejs.org/en/download (direct download of the Windows installer)

And Java from here: https://www.oracle.com/technetwork/java/javase/downloads/index.html (direct download of the Windows installer)

Then run in CMD or PowerShell on Windows, or in the terminal on Mac (replace with the full path to the apk file):

npx apk-mitm /path/to/yourapp.apk

You can easily add the file path by dragging the file into the CMD window, that is: type npx apk-mitm, a space, drag the apk file into the window, and press Enter.

The script decompiles, edits, and signs the app again.

Embedding the certificate in the app file

The script can also embed the NetFree certificate inside the app file itself, so the app can be used even on Android systems where a security certificate cannot be installed even at the user level (for example some car multimedia systems): https://github.com/shroudedcode/apk-mitm#allowing-specific-certificates

Adding a security exception with the 'AddSecurityExceptionAndroid' script

Can be run on Linux (or on Windows by installing the WSL environment, which emulates Linux).

In this guide we will learn how to do it. The guide consists of two main steps. The first step is adding a Linux system to Windows, and it is relevant only to those who do not have access to a Linux system. Those who have access to a Linux system can go directly to the second part (running the script):

The guide is based on screenshots; the numbers in parentheses mark the step shown in the screenshots in the 'Guide with pictures'.

Installing the Windows Subsystem for Linux on Windows 10

This step will let us run bash commands on Windows (the Windows Subsystem for Linux is only available on 64-bit versions of Windows 10, version 1607 and above).

First we need to enable the feature. Open PowerShell as administrator (2) (3), and run the following command there (4):

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

When the operation (5) finishes, a message will ask us to confirm restarting the computer by typing Y and Enter (6). Confirm.

Now download this file and install it (7) (8). Run the app, wait until the installation completes (9), first set a username (10) and password (11), and enter the password once more to confirm (11).

(12) Run the command sudo apt-get update,

Wait until the operation finishes (13) and then run the command (14)

sudo apt install default-jdk

(15) Confirm by typing Y,

Wait until the operation finishes (16),

That's it, we have now installed the Linux runtime environment on the computer. You can close the terminal.

Running the script

Now download this file (zip file), extract it to a folder, and put the apk file you want to handle in that same folder.

In the folder's address bar (where the path is written) type wsl and press Enter (17). A Linux terminal will open at the folder's location (18),

(18) There, run the command:

‎./addSecurityExceptions.sh app-name.apk

Instead of app-name.apk, write the name of the app.

(19) On the first run we will need to fill in details. We can write our name or any other word, and finally type yes.

That's it. (20)

Now you will see that a file was added in the script folder (21).

Good luck!


Sources:

https://docs.microsoft.com/en-us/windows/wsl/install-win10

https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04

https://github.com/levyitay/AddSecurityExceptionAndroid


Guide with pictures:

Adding a security exception manually

Instructions can be found at the following link:

https://mitmachim.top/post/849673

Lowering the SDK version with the APKTool app


Download the APKTool app, open the option to edit an apk file, and in the target sdk line change it so that Android 6 or lower appears. Then sign the app (a "sign" option appears), and the new apk is created. Tap the file and choose install. If the app is already installed, uninstall the installed app first, and only then install the new app (the words mod-sign should be added to the original file name). For more details see here.