In order to overcome the limitations of traditional stochastic models for smartphones, we introduce a double-difference code pseudorange residual (DDPR)-dependent stochastic model based on an optimal satellite subset, with the goal of mitigating the constraints imposed by the quality of GNSS observations in smartphones on the accuracy and reliability of phone-based GNSS positioning. In our methodology, the satellite selection process involved considering the integrated carrier-to-noise density ratio (C/N0) index of both the reference station and the smartphone, enabling us to construct a satellite subset characterized by superior observation quality. Furthermore, by leveraging the optimal subset of satellites and incorporating the C/N0-dependent stochastic model, we could determine the approximate location of the terminal through pseudorange differential positioning. Subsequently, we estimated the DDPRs for all satellites and utilized these values as prior information to build a stochastic model of the observations. Our findings indicate that in occluded environments, the DDPR-dependent stochastic model significantly enhances positioning accuracy for both the Huawei Mate40 and P40 terminals compared to the C/N0-dependent model. Numerically, the improvements in the north (N), east (E), and up (U) directions were approximately 30%, 32%, and 34% for the Mate40, and 26%, 33%, and 24% for the P40 terminal. This suggests that the proposed DDPR-dependent stochastic model effectively identifies and mitigates large gross error signals caused by multipath and non-line-of-sight (NLOS) signals, thereby assigning lower weights to these problematic observations and ultimately enhancing positioning accuracy. Moreover, the weighting method involves minimal computations and is straightforward to implement, making it particularly suitable for GNSS positioning applications on smartphones in complex urban environments.