Skip to content

Commit

Permalink
Ability to get DRM-free version of app from appdb
Browse files Browse the repository at this point in the history
  • Loading branch information
ZonD80 committed Jun 6, 2020
1 parent c08a7d0 commit bc424cf
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
4 changes: 2 additions & 2 deletions duppy2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.5;
MARKETING_VERSION = 1.1.7;
PRODUCT_BUNDLE_IDENTIFIER = zond80.duppy2;
PRODUCT_NAME = Duppy;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -416,7 +416,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.5;
MARKETING_VERSION = 1.1.7;
PRODUCT_BUNDLE_IDENTIFIER = zond80.duppy2;
PRODUCT_NAME = Duppy;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Binary file not shown.
30 changes: 27 additions & 3 deletions duppy2/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ class ViewController: UIViewController , UITableViewDataSource , UITableViewDele
return;
}


var files = [URL]()
var plistEntities: [String:NSDictionary] = [:];

if let enumerator = FileManager.default.enumerator(at: url, includingPropertiesForKeys: [], options: []) {
Expand Down Expand Up @@ -369,6 +367,16 @@ class ViewController: UIViewController , UITableViewDataSource , UITableViewDele
refreshAlert.addAction(UIAlertAction(title: "Okay", style: .cancel, handler: { (action: UIAlertAction!) in
self.log("Handle Cancel Logic here")
}))

if appModel[indexPath.row].trackId != "" {
refreshAlert.addAction(UIAlertAction(title: "Get DRM-free from appdb", style: .default, handler: { (action: UIAlertAction!) in

let redirectURL = "https://appdb.to/view.php?trackid="+self.appModel[indexPath.row].trackId!+"&type=ios";
self.log("redirecting to appdb to \(redirectURL)")
guard let url = URL(string: redirectURL) else { return }
UIApplication.shared.open(url)
}))
}
} else {
refreshAlert = UIAlertController(title: "Clone \(appName) with DRM-free binary", message: "Please enter desired app name or leave blank to use original one. Don't worry, we will clear DRM-free binary once finished", preferredStyle: UIAlertController.Style.alert)

Expand Down Expand Up @@ -453,6 +461,22 @@ class ViewController: UIViewController , UITableViewDataSource , UITableViewDele

let mainInfoPlistURL = URL(fileURLWithPath: "\(finalAppDir)/Info.plist");



let iTunesMetadataPlistURL = URL(fileURLWithPath: "\(appsPath)/\(appUUIDDir)/iTunesMetadata.plist");

var iTunesMetadataPlistEntities:NSDictionary = [:];

var trackId:String = "";

do {
iTunesMetadataPlistEntities = try PropertyListSerialization.propertyList(from: Data(contentsOf: iTunesMetadataPlistURL), options: [], format: nil) as! NSDictionary
trackId = String(describing: iTunesMetadataPlistEntities["itemId"] ?? "") // wtf. it is stupid af
} catch {
self.log("App is not from appstore. okay");
}


var mainBundleId:String = appDir;
var mainBundleName:String = appDir;

Expand Down Expand Up @@ -499,7 +523,7 @@ class ViewController: UIViewController , UITableViewDataSource , UITableViewDele
if (FileManager.default.fileExists(atPath: "\(finalAppDir)/SC_Info/Manifest.plist")) {
isDRM = true;
}
let appObject = app(name: appDir, icon: mainBundleIcon, path: finalAppDir, mainBundleId: mainBundleId, mainBundleName: mainBundleName, isDRM:isDRM,mainBundleExecutable: mainBundleExecutable, mainBundleVersion: mainBundleVersion);
let appObject = app(name: appDir, icon: mainBundleIcon, path: finalAppDir, mainBundleId: mainBundleId, mainBundleName: mainBundleName, isDRM:isDRM,mainBundleExecutable: mainBundleExecutable, mainBundleVersion: mainBundleVersion, trackId: trackId);
appModel.append(appObject);
return;
}
Expand Down
4 changes: 3 additions & 1 deletion duppy2/appClass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ class app:NSObject{
var mainBundleExecutable: String?
var mainBundleVersion: String?
var isDRM: Bool?
var trackId: String?

init(name:String,icon:String,path:String,mainBundleId:String,mainBundleName:String,isDRM:Bool,mainBundleExecutable:String,mainBundleVersion:String) {
init(name:String,icon:String,path:String,mainBundleId:String,mainBundleName:String,isDRM:Bool,mainBundleExecutable:String,mainBundleVersion:String,trackId:String) {
self.name = name;
self.icon = icon;
self.path = path;
Expand All @@ -29,5 +30,6 @@ class app:NSObject{
self.isDRM = isDRM;
self.mainBundleExecutable = mainBundleExecutable;
self.mainBundleVersion = mainBundleVersion;
self.trackId = trackId;
}
}

0 comments on commit bc424cf

Please sign in to comment.