This paper studies reconfigurable intelligent surface (RIS) assisted device activity detection for grant-free (GF) uplink transmission in wireless communication networks. In particular, we consider mobile devices located in an area where the direct link to an access point (AP) is blocked. Thus, the devices try to connect to the AP via a reflected link provided by an RIS. Therefore, a RIS phase-shift design is desired that covers the entire blocked area with a wide reflection beam because the exact locations and times of activity of the devices are unknown in GF transmission. In order to study the impact of the phase-shift design on the device activity detection, we derive a generalized likelihood ratio test (GLRT) based detector and present an analytical expression for the probability of detection. Assuming knowledge of statistical CSI, we formulate an optimization problem for the phase-shift design for maximization of the guaranteed probability of detection for all locations within a given coverage area. To tackle the non-convexity of the problem, we propose two different approximations of the objective function. The first approximation leads to a design that aims to reduce the variations of the end-to-end channel while taking system parameters such as transmit power, noise power, and probability of false alarm into account. The second approximation can be adopted for versatile RIS deployments because it only depends on the line-of-sight component of the end-to-end channel and is not affected by system parameters. For comparison, we also consider a phase-shift design maximizing the average channel gain and a baseline analytical phase-shift design for large blocked areas. Our performance evaluation shows that the proposed approximations result in phase-shift designs that guarantee high probability of detection across the coverage area and outperform the baseline designs.