4. Let $D$, $E$, and $F$ be points on the sides $BC$, $AB$, and $AC$ of $\triangle ABC$, respectively, such that $AE = AF$, $BE = BD$, and $CF = CD$. Given that $AB \cdot AC = 2BD \cdot DC$, $AB = 12$, and $AC = 5$. Then the inradius $r$ of $\triangle ABC$ is $\qquad$
4.2.

As shown in Figure 6, let
$$
\begin{array}{l}
A E=A F=x, \\
B E=B D=y, \\
C D=C F=z .
\end{array}
$$

Then $A B=x+y$,
$$
\begin{array}{l}
A C=x+z, \\
B C=y+z .
\end{array}
$$

From $A B \cdot A C=2 B D \cdot D C$
$$
\begin{array}{l}
\Rightarrow(x+y)(x+z)=2 y z \\
\Rightarrow x^{2}+x y+x z=y z \\
\text { Also } A B^{2}+A C^{2}=(x+y)^{2}+(x+z)^{2} \\
=y^{2}+z^{2}+2\left(x^{2}+x y+x z\right) \\
=y^{2}+z^{2}+2 y z \\
=(y+z)^{2}=B C^{2},
\end{array}
$$

Then $\angle A=90^{\circ}$, and
$$
B C=\sqrt{A B^{2}+A C^{2}}=13 \text {. }
$$

Thus $r=\frac{A B \cdot A C}{A B+B C+C A}=2$.