包名为获取 非写死

This commit is contained in:
ningwenqiang 2024-09-05 18:10:08 +08:00
parent c4a24be6f7
commit 55b53fb955
7 changed files with 13 additions and 13 deletions

View File

@ -4,7 +4,7 @@
> >
<queries> <queries>
<package android:name="com.newpandora.yo"/> <package android:name="${applicationId}"/>
<package android:name="com.facebook.orca"/> <package android:name="com.facebook.orca"/>
<package <package

View File

@ -25,7 +25,7 @@
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="com.newpandora.yo.fileprovider" android:authorities="${applicationId}.fileprovider"
android:exported="false" android:exported="false"
android:grantUriPermissions="true"> android:grantUriPermissions="true">
<meta-data <meta-data

View File

@ -417,7 +417,7 @@ public class CommonHttpUtil {
.params("purchaseToken", purchaseToken) .params("purchaseToken", purchaseToken)
.params("productId", productId) .params("productId", productId)
.params("orderno", orderno) .params("orderno", orderno)
.params("package_name", "com.newpandora.yo") .params("package_name", CommonAppContext.sInstance.getPackageName())
.execute(callback); .execute(callback);
} }
@ -425,7 +425,7 @@ public class CommonHttpUtil {
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE) HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE)
.params("purchaseToken", purchaseToken) .params("purchaseToken", purchaseToken)
.params("productId", productId) .params("productId", productId)
.params("package_name", "com.newpandora.yo") .params("package_name", CommonAppContext.sInstance.getPackageName())
.execute(callback); .execute(callback);
} }
@ -434,7 +434,7 @@ public class CommonHttpUtil {
.params("purchaseToken", purchaseToken) .params("purchaseToken", purchaseToken)
.params("orderno", orderNo) .params("orderno", orderNo)
.params("trade_no", tradeNo) .params("trade_no", tradeNo)
.params("package_name", "com.newpandora.yo") .params("package_name", CommonAppContext.sInstance.getPackageName())
.execute(callback); .execute(callback);
} }

View File

@ -83,7 +83,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
if (mNeedCrop) { if (mNeedCrop) {
Uri uri = null; Uri uri = null;
if (Build.VERSION.SDK_INT >= 24) { if (Build.VERSION.SDK_INT >= 24) {
uri = FileProvider.getUriForFile(mContext, "com.newpandora.yo.fileprovider", mCameraResult); uri = FileProvider.getUriForFile(mContext, mContext.getPackageName() +".fileprovider", mCameraResult);
} else { } else {
uri = Uri.fromFile(mCameraResult); uri = Uri.fromFile(mCameraResult);
} }
@ -195,7 +195,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
mCameraResult = getNewFile(); mCameraResult = getNewFile();
Uri uri = null; Uri uri = null;
if (Build.VERSION.SDK_INT >= 24) { if (Build.VERSION.SDK_INT >= 24) {
uri = FileProvider.getUriForFile(mContext, "com.newpandora.yo.fileprovider", mCameraResult); uri = FileProvider.getUriForFile(mContext, mContext.getPackageName()+".fileprovider", mCameraResult);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
} else { } else {
uri = Uri.fromFile(mCameraResult); uri = Uri.fromFile(mCameraResult);
@ -255,7 +255,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
startActivityForResult(intent, mCropResultCallback); startActivityForResult(intent, mCropResultCallback);
} catch (Exception e) { } catch (Exception e) {
try { try {
Uri resultUri = FileProvider.getUriForFile(mContext, "com.newpandora.yo.fileprovider", mCorpResult); Uri resultUri = FileProvider.getUriForFile(mContext, mContext.getPackageName()+".fileprovider", mCorpResult);
if (resultUri == null || mFragment == null || mContext == null) { if (resultUri == null || mFragment == null || mContext == null) {
return; return;
} }

View File

@ -63,7 +63,7 @@ public class VersionUtil {
@Override @Override
public void onConfirmClick(Dialog dialog, String content) { public void onConfirmClick(Dialog dialog, String content) {
Intent i = new Intent(android.content.Intent.ACTION_VIEW); Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.newpandora.yo")); i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+context.getPackageName()));
context.startActivity(i); context.startActivity(i);
context.finish(); context.finish();
} }
@ -85,7 +85,7 @@ public class VersionUtil {
@Override @Override
public void onConfirmClick(Dialog dialog, String content) { public void onConfirmClick(Dialog dialog, String content) {
Intent i = new Intent(android.content.Intent.ACTION_VIEW); Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.newpandora.yo")); i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+context.getPackageName()));
context.startActivity(i); context.startActivity(i);
context.finish(); context.finish();
} }

View File

@ -128,7 +128,7 @@ public class APKUpdateCustomPopup extends CenterPopupView {
public void onViewClicks() { public void onViewClicks() {
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) { if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
Intent i = new Intent(android.content.Intent.ACTION_VIEW); Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.newpandora.yo")); i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+mContext.getPackageName()));
mContext.startActivity(i); mContext.startActivity(i);
mContext.finish(); mContext.finish();
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) { } else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {

View File

@ -24,6 +24,6 @@ android.nonTransitiveRClass=false
systemProp.http.proxyHost=127.0.0.1 systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyHost=127.0.0.1 systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=10809 systemProp.https.proxyPort=9098
systemProp.http.proxyPort=10809 systemProp.http.proxyPort=9098
android.enableR8.fullMode=true android.enableR8.fullMode=true